Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
@@ -0,0 +1,38 @@
// BlankPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "BlankPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CBlankPanel dialog
CBlankPanel::CBlankPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CBlankPanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CBlankPanel)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CBlankPanel::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBlankPanel)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBlankPanel, CDynaPanel)
//{{AFX_MSG_MAP(CBlankPanel)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBlankPanel message handlers
@@ -0,0 +1,50 @@
#if !defined(AFX_BLANKPANEL_H__F6215E8D_AABC_48DC_9187_F9850D4944B2__INCLUDED_)
#define AFX_BLANKPANEL_H__F6215E8D_AABC_48DC_9187_F9850D4944B2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BlankPanel.h : header file
//
#include "DynaPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CBlankPanel dialog
class CBlankPanel : public CDynaPanel
{
// Construction
public:
CBlankPanel(CWnd* pParent = NULL); // standard constructor
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CBlankPanel)
enum { IDD = IDD_BLANKHDR };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CBlankPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CBlankPanel)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BLANKPANEL_H__F6215E8D_AABC_48DC_9187_F9850D4944B2__INCLUDED_)
@@ -0,0 +1,112 @@
// ChildFrm.cpp : implementation of the CChildFrame class
//
#include "stdafx.h"
#include "PixelWhipPro.h"
#include "ChildFrm.h"
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_COMMAND(ID_FILE_CLOSE, OnFileClose)
ON_WM_SETFOCUS()
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
cs.lpszClass = AfxRegisterWndClass(0);
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
void CChildFrame::OnFileClose()
{
// To close the frame, just send a WM_CLOSE, which is the equivalent
// choosing close from the system menu.
SendMessage(WM_CLOSE);
}
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// create a view to occupy the client area of the frame
if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
{
TRACE0("Failed to create view window\n");
return -1;
}
return 0;
}
void CChildFrame::OnSetFocus(CWnd* pOldWnd)
{
CMDIChildWnd::OnSetFocus(pOldWnd);
m_wndView.SetFocus();
}
BOOL CChildFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// let the view have first crack at the command
if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
// otherwise, do default handling
return CMDIChildWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
@@ -0,0 +1,61 @@
// ChildFrm.h : interface of the CChildFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHILDFRM_H__748F875B_194E_4F74_99F4_7301190AD13F__INCLUDED_)
#define AFX_CHILDFRM_H__748F875B_194E_4F74_99F4_7301190AD13F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ChildView.h"
class CChildFrame : public CMDIChildWnd
{
DECLARE_DYNCREATE(CChildFrame)
public:
CChildFrame();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
//}}AFX_VIRTUAL
// Implementation
public:
// view for the client area of the frame.
CChildView m_wndView;
virtual ~CChildFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CChildFrame)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
afx_msg void OnFileClose();
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHILDFRM_H__748F875B_194E_4F74_99F4_7301190AD13F__INCLUDED_)
@@ -0,0 +1,53 @@
// ChildView.cpp : implementation of the CChildView class
//
#include "stdafx.h"
#include "PixelWhipPro.h"
#include "ChildView.h"
/////////////////////////////////////////////////////////////////////////////
// CChildView
CChildView::CChildView()
{
}
CChildView::~CChildView()
{
}
BEGIN_MESSAGE_MAP(CChildView,CWnd )
//{{AFX_MSG_MAP(CChildView)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildView message handlers
BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
{
if (!CWnd::PreCreateWindow(cs))
return FALSE;
cs.dwExStyle |= WS_EX_CLIENTEDGE;
cs.style &= ~WS_BORDER;
cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_WINDOW+1), NULL);
return TRUE;
}
void CChildView::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CWnd::OnPaint() for painting messages
}
@@ -0,0 +1,51 @@
// ChildView.h : interface of the CChildView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHILDVIEW_H__D08EE0CE_108D_4E8D_A5E9_B46C68D791AE__INCLUDED_)
#define AFX_CHILDVIEW_H__D08EE0CE_108D_4E8D_A5E9_B46C68D791AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CChildView window
class CChildView : public CWnd
{
// Construction
public:
CChildView();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildView)
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CChildView();
// Generated message map functions
protected:
//{{AFX_MSG(CChildView)
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHILDVIEW_H__D08EE0CE_108D_4E8D_A5E9_B46C68D791AE__INCLUDED_)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,109 @@
#if !defined(AFX_CURVEEDITOR_H__C1749ED7_BBE2_445B_9862_5F21486104CE__INCLUDED_)
#define AFX_CURVEEDITOR_H__C1749ED7_BBE2_445B_9862_5F21486104CE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CurveEditor.h : header file
//
#include <Stuff\Stuff.hpp>
#include <gosFX\gosFX.hpp>
#define MAXCURVES 128
class CurveSet;
/////////////////////////////////////////////////////////////////////////////
// CCurveEditor frame
class CCurveEditor : public CWnd
{
// DECLARE_DYNCREATE(CCurveEditor)
protected:
// Attributes
public:
CCurveEditor(); // protected constructor used by dynamic creation
virtual ~CCurveEditor();
// Operations
public:
void ReDraw() {InvalidateRect(NULL);}
void ReDrawInternal();
void DrawTicks(CDC *dc);
void FixCurve(gosFX::Curve *Curve);
void UpdateCurveList(HTREEITEM itm=TVI_ROOT);
void DrawCurve(CDC *dc,gosFX::Curve *curve,bool DrawKeys=false);
void DrawHandles(CDC *dc,gosFX::Curve *curve);
void Refresh();
int GetClosestKey(CPoint &pnt);
CPen InactivePen,EditablePen,VarPen,SelVertPen,TickPen,BlackPen,HandlePen,ZeroPen;
CBrush BGBrush;
gosFX::Curve *Curves[MAXCURVES],*DCurve,*VCurve;
CurveSet *CurrentCSet;
int NumCurves,SelectedKey;
float StartY,EndY;
CPoint OldPoint;
int CurveToClient(float h,int whgt)
{
return whgt-(int)(((h-StartY)/(EndY-StartY))*whgt);
}
float ClientToCurve(int h,int w)
{
return (EndY-StartY)*(1.0f-(float)h/w)+StartY;
}
enum EditMode {MOVE,INSERT,ZOOM,PAN,SCALE};
EditMode CurrentEditMode;
bool EditVar,EditHan;
CPoint H1Pos,H2Pos;
CBitmap BackBuffer;
void BuildBackBuffer();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCurveEditor)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CCurveEditor)
afx_msg void OnClose();
afx_msg void OnPaint();
afx_msg void OnEditInsertmode();
afx_msg void OnEditMovemode();
afx_msg void OnEditPanmode();
afx_msg void OnEditScalemode();
afx_msg void OnEditZoommode();
afx_msg void OnUpdateEditInsertmode(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditMovemode(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditPanmode(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditScalemode(CCmdUI* pCmdUI);
afx_msg void OnUpdateEditZoommode(CCmdUI* pCmdUI);
afx_msg void OnEditEditvaraincecurve();
afx_msg void OnUpdateEditEditvaraincecurve(CCmdUI* pCmdUI);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnEditDeletevertex();
afx_msg void OnViewZoomtocurve();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CURVEEDITOR_H__C1749ED7_BBE2_445B_9862_5F21486104CE__INCLUDED_)
@@ -0,0 +1,94 @@
// CurveEditorFrame.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "CurveEditorFrame.h"
/////////////////////////////////////////////////////////////////////////////
// CCurveEditorFrame
//IMPLEMENT_DYNCREATE(CCurveEditorFrame, CFrameWnd)
CCurveEditorFrame::CCurveEditorFrame(CWnd *parent)
{
LoadFrame(IDR_CURVEEDITMENU,WS_OVERLAPPED|WS_THICKFRAME|WS_CAPTION|WS_MAXIMIZEBOX|WS_MINIMIZEBOX|WS_SYSMENU,parent);
}
CCurveEditorFrame::~CCurveEditorFrame()
{
}
BEGIN_MESSAGE_MAP(CCurveEditorFrame, CFrameWnd)
//{{AFX_MSG_MAP(CCurveEditorFrame)
ON_WM_CREATE()
ON_WM_SETFOCUS()
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCurveEditorFrame message handlers
int CCurveEditorFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// create a view to occupy the client area of the frame
if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
{
TRACE0("Failed to create view window\n");
return -1;
}
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_CURVEEDITMENU))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
/*
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
*/
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
// m_wndView.InitWindow();
return 0;
}
void CCurveEditorFrame::OnSetFocus(CWnd* pOldWnd)
{
CFrameWnd::OnSetFocus(pOldWnd);
m_wndView.SetFocus();
}
BOOL CCurveEditorFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
return TRUE;
return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
void CCurveEditorFrame::OnClose()
{
ShowWindow(SW_HIDE);
}
@@ -0,0 +1,53 @@
#if !defined(AFX_CURVEEDITORFRAME_H__059B1593_4E6B_42BA_B7CF_245CC05A8D00__INCLUDED_)
#define AFX_CURVEEDITORFRAME_H__059B1593_4E6B_42BA_B7CF_245CC05A8D00__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CurveEditorFrame.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CCurveEditorFrame frame
#include"CurveEditor.h"
class CCurveEditorFrame : public CFrameWnd
{
// DECLARE_DYNCREATE(CCurveEditorFrame)
protected:
CToolBar m_wndToolBar;
// Attributes
public:
CCurveEditorFrame(CWnd *parent=NULL); // protected constructor used by dynamic creation
CCurveEditor m_wndView;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCurveEditorFrame)
public:
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CCurveEditorFrame();
// Generated message map functions
//{{AFX_MSG(CCurveEditorFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnClose();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CURVEEDITORFRAME_H__059B1593_4E6B_42BA_B7CF_245CC05A8D00__INCLUDED_)
@@ -0,0 +1,277 @@
#include "stdafx.h"
#include <GosFx\GosFx.hpp>
#include <GosFx\Card.hpp>
#include "resource.h"
#include "CurveSet.h"
#include "TextPanel.h"
#include "BlankPanel.h"
#include "DVPanel.h"
#include "TexturePanel.h"
#include "TexturePanel2.h"
#include "TFPanel.h"
#include "NumPanel.h"
#include "FloatPanel.h"
#include "ShapePanel.h"
#include "ShapeCloudPanel.h"
#include "ProfilePanel.h"
#include "EBFPanel.h"
#include "Point3DPanel.h"
#include "FloatPanel.h"
#include "EditMLRStatePanel.h"
void CurveSet::Reset()
{
StackLevel=0;
if(Stream)
{
Unregister_Object(Stream);
delete Stream;
}
EffSpec=NULL;
Curve=NULL;
Stream=NULL;
Type=BLANK;
// Min=-99999999.9f;
// Max=99999999.9f;
if(Panel)
{
delete Panel;
Panel=NULL;
}
}
void CurveSet::SetType(ConTypeTag tg,void *dat)
{
Verify(Panel==NULL);
Type=tg;
switch(Type)
{
case BLANK: Panel=new CBlankPanel; break;
case TEXT: Panel=new CTextPanel; break;
case TEXTUREBROWSER: Panel=new CTexturePanel; break;
case TEXTUREBROWSER2: Panel=new CTexturePanel2; break;
case TFPANEL: Panel=new CTFPanel; break;
case FLOATVAL: Panel=new CFloatPanel; break;
case NUMVAL: Panel=new CNumPanel; break;
case POINTPANEL: Panel=new CPoint3DPanel; break;
case SHAPEPANEL: Panel=new CShapePanel; break;
case SHAPECLOUDPANEL: Panel=new CShapeCloudPanel; break;
case EBFPANEL: Panel=new CEBFPanel; break;
case PROFILEPANEL: Panel=new CProfilePanel; break;
case CURVEPANEL: Panel=new DVPanel; break;
case MLRSTATEPANEL: Panel=new CEditMLRStatePanel; break;
default:
Panel=new CBlankPanel;
break;
}
Verify(Panel);
Panel->Set(dat);
Panel->MyCSet=this;
}
bool CurveSet::IsDataValid()
{
switch(Type)
{
case BLANK:
case TEXT:
case TEXTUREBROWSER:
case TEXTUREBROWSER2:
case TFPANEL:
case POINTPANEL:
case SHAPEPANEL:
case SHAPECLOUDPANEL:
case EBFPANEL:
case PROFILEPANEL:
case VARVAL:
case MLRSTATEPANEL:
break;
case NUMVAL:
{
CNumPanel *pan=(CNumPanel *)Panel;
// if(*(pan->intval)<Min || *(pan->intval)>Max)
// return false;
if(EffSpec!=NULL)
{
if(EffSpec->IsDataValid()==false) return false;
switch(EffSpec->GetClassID())
{
case gosFX::TubeClassID:
gosFX::Tube__Specification *tspec;
tspec=Cast_Pointer(gosFX::Tube__Specification *,EffSpec);
Check_Object(tspec);
if(!tspec->CalculateUBias(false)) return false;
break;
}
}
}
case CURVEPANEL:
{
if(EffSpec!=NULL)
{
if(!EffSpec->IsDataValid()) return false;
switch(EffSpec->GetClassID())
{
case gosFX::TubeClassID:
{
gosFX::Tube__Specification *tspec;
tspec=Cast_Pointer(gosFX::Tube__Specification *,EffSpec);
Check_Object(tspec);
if(!tspec->CalculateUBias(false)) return false;
}
break;
case gosFX::CardCloudClassID:
{
gosFX::CardCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::CardCloud__Specification *,EffSpec);
Check_Object(tspec);
tspec->SetWidth();
}
break;
case gosFX::CardClassID:
{
gosFX::Card__Specification *tspec;
tspec=Cast_Pointer(gosFX::Card__Specification *,EffSpec);
Check_Object(tspec);
tspec->SetWidth();
}
break;
}
}
}
}
return true;
}
void CurveSet::PushState()
{
if(StackLevel>0) STOP(("Nested Pushes Not Supported yet"));
Verify(!(StackLevel==0 && Stream!=NULL));
if(Stream==NULL)
{
Stream=new Stuff::DynamicMemoryStream;
Register_Object(Stream);
}
switch(Type)
{
case BLANK:
case TEXT:
case TEXTUREBROWSER:
case TEXTUREBROWSER2:
case TFPANEL:
case POINTPANEL:
case SHAPEPANEL:
case SHAPECLOUDPANEL:
case EBFPANEL:
case PROFILEPANEL:
case VARVAL:
case MLRSTATEPANEL:
case FLOATVAL:
case NUMVAL:
STOP(("Push Method Unimplemented"));
break;
case CURVEPANEL:
{
Verify(Curve);
Curve->Save(Stream);
}
}
StackLevel++;
}
void CurveSet::PopState()
{
Verify(StackLevel>0);
Check_Pointer(Stream);
Stream->Rewind();
switch(Type)
{
case BLANK:
case TEXT:
case TEXTUREBROWSER:
case TEXTUREBROWSER2:
case TFPANEL:
case POINTPANEL:
case SHAPEPANEL:
case SHAPECLOUDPANEL:
case EBFPANEL:
case PROFILEPANEL:
case VARVAL:
case MLRSTATEPANEL:
case FLOATVAL:
case NUMVAL:
STOP(("Pop Method Unimplemented"));
break;
case CURVEPANEL:
{
Verify(Curve);
Curve->Load(Stream, gosFX::CurrentGFXVersion);
}
}
StackLevel--;
if(StackLevel==0)
{
Unregister_Object(Stream);
delete Stream;
Stream=0;
}
else
if(StackLevel<0)
{
STOP(("Save State Stack Underflow"));
}
}
void CurveSet::PopNoSave()
{
Verify(StackLevel>0);
Check_Pointer(Stream);
StackLevel--;
if(StackLevel==0)
{
Unregister_Object(Stream);
delete Stream;
Stream=0;
}
else
if(StackLevel<0)
{
STOP(("Save State Stack Underflow"));
}
}
void CurveSet::VerifyAndPop()
{
if(IsDataValid())
PopNoSave();
else
PopState();
}
@@ -0,0 +1,36 @@
#ifndef CURVESET_H
#define CURVESET_H
#include "DynaPanel.h"
#include <Stuff\Stuff.hpp>
#include <gosFX\gosFX.hpp>
#include <gosFX\effect.hpp>
class CurveSet
{
public:
enum ConTypeTag {BLANK,TEXT,TEXTUREBROWSER,TEXTUREBROWSER2,
CURVEPANEL,TFPANEL,VARVAL,NUMVAL,FLOATVAL,
SHAPEPANEL,SHAPECLOUDPANEL,PROFILEPANEL,
EBFPANEL,POINTPANEL,MLRSTATEPANEL};
protected:
ConTypeTag Type;
Stuff::DynamicMemoryStream *Stream;
int StackLevel;
public:
// float Min,Max;
CString Name;
gosFX::Curve *Curve;
CDynaPanel *Panel;
void PushState();
void PopState();
void PopNoSave();
void VerifyAndPop();
gosFX::Effect__Specification *EffSpec;
void SetType(ConTypeTag,void *dat=NULL);
CurveSet() { Stream=NULL; Panel=NULL; Reset();}
bool IsDataValid();
void Reset();
};
#endif
@@ -0,0 +1,265 @@
// DVPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "DVPanel.h"
#include "EffectEditWin.h"
#include "CurveEditorFrame.h"
/////////////////////////////////////////////////////////////////////////////
// DVPanel dialog
extern CPixelWhipProApp theApp;
DVPanel::DVPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(DVPanel::IDD, pParent)
{
LastPos=-1;
LastNum=0.0f;
//{{AFX_DATA_INIT(DVPanel)
//}}AFX_DATA_INIT
RecurseGaurd=false;
}
void DVPanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DVPanel)
DDX_Control(pDX, IDC_USEVAR, m_varbut);
DDX_Control(pDX, IDC_NUM, m_numedit);
DDX_Control(pDX, IDC_SLIDER, m_slider);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DVPanel, CDynaPanel)
//{{AFX_MSG_MAP(DVPanel)
ON_WM_HSCROLL()
ON_WM_LBUTTONDOWN()
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER, OnReleasedcaptureSlider)
ON_EN_CHANGE(IDC_NUM, OnChangeNum)
ON_EN_KILLFOCUS(IDC_NUM, OnKillfocusNum)
ON_BN_CLICKED(IDC_USEVAR, OnUsevar)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DVPanel message handlers
void DVPanel::UpdateControl()
{
if(MyCSet && MyCSet->Curve)
{
UpdateCurve();
gosFX::Curve *Curve=MyCSet->Curve->GetSubCurve(theApp.ParamWin->ViewVar?1:0);
if(Curve)
{
Check_Object(Curve);
float Max,Min;
float SliVal;
BaseCap=SliVal=Curve->ExpensiveCompute(0.0f,theApp.ParamWin->ViewVar);
Curve->ExpensiveComputeRange(&Min,&Max,theApp.ParamWin->ViewVar);
SliUnit=Max/100;
if(SliUnit<.00001f) SliUnit=.01f;
CString str;
str.Format("%5.3f",SliVal);
m_numedit.SetWindowText(str);
m_numedit.RedrawWindow();
m_slider.SetRange(0,200);
m_slider.SetPos(100);
if(Curve->IsComplex())
CheckDlgButton(IDC_USEVAR,Curve->GetSeedFlagIfComplex());
m_slider.ShowWindow(SW_SHOW);
m_numedit.ShowWindow(SW_SHOW);
// m_slider.EnableWindow(TRUE);
// m_numedit.EnableWindow(TRUE);
}
else
{
m_slider.ShowWindow(SW_HIDE);
m_numedit.ShowWindow(SW_HIDE);
// m_slider.EnableWindow(FALSE);
// m_numedit.EnableWindow(FALSE);
// m_numedit.SetWindowText("");
}
}
}
void DVPanel::Set(void *pt)
{
}
void DVPanel::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
theApp.Modified=true;
if(LastPos==-1)
{
LastPos=m_slider.GetPos();
}
else
{
if(MyCSet)
{
gosFX::Curve *Curve=MyCSet->Curve->GetSubCurve(theApp.ParamWin->ViewVar?1:0);
if(Curve)
{
Check_Object(Curve);
Stuff::DynamicMemoryStream stream;
if(Curve)
MyCSet->Curve->Save(&stream);
Curve->TranslateTo(BaseCap+(float)(m_slider.GetPos()-LastPos)*(SliUnit),theApp.ParamWin->ViewVar);
CString str;
if(MyCSet->IsDataValid())
{
str.Format("%5.3f",Curve->ExpensiveCompute(0.0f,theApp.ParamWin->ViewVar));
m_numedit.SetWindowText(str);
}
else
{
stream.Rewind();
MyCSet->Curve->Load(&stream, gosFX::CurrentGFXVersion);
}
theApp.CurveWin->m_wndView.ReDraw();
if(Curve->IsComplex())
CheckDlgButton(IDC_USEVAR,Curve->GetSeedFlagIfComplex());
UpdateData(FALSE);
UpdateCurve();
}
CDynaPanel::OnHScroll(nSBCode, nPos, pScrollBar);
}
}
}
BOOL DVPanel::OnInitDialog()
{
CDynaPanel::OnInitDialog();
m_slider.SetRange(0,200);
m_slider.SetPos(100);
if(MyCSet->Curve->IsComplex())
{
m_varbut.ShowWindow(SW_SHOW);
CheckDlgButton(IDC_USEVAR,MyCSet->Curve->GetSeedFlagIfComplex());
}
else
{
m_varbut.ShowWindow(SW_HIDE);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DVPanel::OnLButtonDown(UINT nFlags, CPoint point)
{
CDynaPanel::OnLButtonDown(nFlags, point);
}
void DVPanel::OnReleasedcaptureSlider(NMHDR* pNMHDR, LRESULT* pResult)
{
LastPos=-1;
m_slider.SetPos(100);
// UpdateControl();
if(MyCSet->Curve)
{
Check_Object(MyCSet->Curve);
BaseCap=MyCSet->Curve->ExpensiveCompute(0.0f,theApp.ParamWin->ViewVar);
}
*pResult = 0;
}
void DVPanel::OnChangeNum()
{
if(RecurseGaurd==true) return;
theApp.Modified=true;
if(LastPos==-1)
{
CString str;
m_numedit.GetWindowText(str);
m_slider.SetPos(100);
gosFX::Curve *Curve=MyCSet->Curve->GetSubCurve(theApp.ParamWin->ViewVar?1:0);
if(Curve)
{
Stuff::DynamicMemoryStream stream;
if(MyCSet->Curve)
MyCSet->Curve->Save(&stream);
Check_Object(Curve);
Curve->TranslateTo((float)atof(str),theApp.ParamWin->ViewVar);
stream.Rewind();
if(!MyCSet->IsDataValid())
{
str.Format("%5.3f",LastNum);
RecurseGaurd=true;
m_numedit.SetWindowText(str);
RecurseGaurd=false;
MyCSet->Curve->Load(&stream, gosFX::CurrentGFXVersion);
if(!MyCSet->IsDataValid())
STOP(("Curve %s Cannot Be fixed",(LPCSTR)MyCSet->Name));
}
theApp.CurveWin->m_wndView.ReDraw();
}
}
{
CString str;
m_numedit.GetWindowText(str);
LastNum=(float)atof(str);
}
}
void DVPanel::OnKillfocusNum()
{
UpdateControl();
}
void DVPanel::OnUsevar()
{
UpdateData(TRUE);
bool newcheckstate=(IsDlgButtonChecked(IDC_USEVAR)==0)?false:true;
MyCSet->Curve->SetSeedFlagIfComplex(newcheckstate);
if(!MyCSet->IsDataValid())
{
newcheckstate=!newcheckstate;
CheckDlgButton(IDC_USEVAR,newcheckstate?1:0);
MyCSet->Curve->SetSeedFlagIfComplex(newcheckstate);
}
}
@@ -0,0 +1,64 @@
#if !defined(AFX_DVPANEL_H__53B6ED89_59B3_4CBF_BDBD_09D3FA56966D__INCLUDED_)
#define AFX_DVPANEL_H__53B6ED89_59B3_4CBF_BDBD_09D3FA56966D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DVPanel.h : header file
//
#include "DynaPanel.h"
#include "CurveSet.h"
/////////////////////////////////////////////////////////////////////////////
// DVPanel dialog
class DVPanel : public CDynaPanel
{
// Construction
public:
DVPanel(CWnd* pParent = NULL); // standard constructor
virtual void UpdateControl();
virtual void Set(void *pt);
int LastPos;
bool RecurseGaurd;
virtual void OnCancel() {}
virtual void OnOK() {}
float BaseCap,SliUnit,LastNum;
// Dialog Data
//{{AFX_DATA(DVPanel)
enum { IDD = IDD_DVSWITCH };
CButton m_varbut;
CEdit m_numedit;
CSliderCtrl m_slider;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(DVPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(DVPanel)
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
virtual BOOL OnInitDialog();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnReleasedcaptureSlider(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnChangeNum();
afx_msg void OnKillfocusNum();
afx_msg void OnUsevar();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DVPANEL_H__53B6ED89_59B3_4CBF_BDBD_09D3FA56966D__INCLUDED_)
@@ -0,0 +1,195 @@
// DataParamView.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "DataParamView.h"
#include "EffectEditWin.h"
#include "TreeParamView.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CDataParamView
IMPLEMENT_DYNCREATE(CDataParamView, CView)
CDataParamView::CDataParamView()
{
VisiblePanelCount=0;
Initalized=false;
}
CDataParamView::~CDataParamView()
{
}
BEGIN_MESSAGE_MAP(CDataParamView, CView)
//{{AFX_MSG_MAP(CDataParamView)
ON_WM_SIZE()
ON_WM_PAINT()
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDataParamView drawing
void CDataParamView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CDataParamView diagnostics
#ifdef _DEBUG
void CDataParamView::AssertValid() const
{
CView::AssertValid();
}
void CDataParamView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CDataParamView message handlers
void CDataParamView::Refresh()
{
HideNotVisible();
SHORT cy=theApp.ParamWin->TreePane->m_PTree.GetItemHeight();
int ypos=0;
ypos=-theApp.ParamWin->TreePane->m_PTree.GetScrollPos(SB_VERT)*cy;
CRect crct,tvrct;
GetClientRect(&crct);
theApp.ParamWin->TreePane->GetClientRect(&tvrct);
SetWindowPos(NULL,0,0,crct.Width(),tvrct.Height(),SWP_NOMOVE|SWP_NOZORDER);
SetActivePanels();
Initalized=true;
UpdateControls();
UpdateScrollPos();
}
void CDataParamView::HideNotVisible()
{
for(int i=0;i<VisiblePanelCount;i++)
PanPnt[i]->ShowWindow(SW_HIDE);
VisiblePanelCount=0;
}
void CDataParamView::UpdateControls()
{
for(int i=0;i<VisiblePanelCount;i++)
PanPnt[i]->UpdateControl();
}
void CDataParamView::UpdateScrollPos()
{
CRect rct;
GetClientRect(&rct);
SHORT cy=theApp.ParamWin->TreePane->m_PTree.GetItemHeight();
int oypos,ypos,lsstart;
oypos=ypos=-theApp.ParamWin->TreePane->m_PTree.GetScrollPos(SB_VERT)*cy;
CWnd *LastShown;
for(int i=0;i<VisiblePanelCount;i++)
{
PanPnt[i]->SetWindowPos(NULL,0,ypos,rct.Width(),cy,SWP_SHOWWINDOW|SWP_NOZORDER);
if(ypos>0 && ypos<rct.bottom) {LastShown=PanPnt[i]; lsstart=ypos;}
ypos+=cy;
}
if( VisiblePanelCount!=0)
LastShown->SetWindowPos(NULL,0,lsstart,rct.Width(),rct.bottom,SWP_SHOWWINDOW|SWP_NOZORDER);
}
void CDataParamView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
if(!Initalized) return;
UpdateScrollPos();
}
void CDataParamView::SetActivePanels(HTREEITEM itm)
{
if(itm==NULL) return;
if(itm==TVI_ROOT)
{
HTREEITEM nitm=theApp.ParamWin->TreePane->m_PTree.GetChildItem(itm);
while(nitm!=NULL)
{
SetActivePanels(nitm);
nitm=theApp.ParamWin->TreePane->m_PTree.GetNextSiblingItem(nitm);
}
return;
}
CRect crct;
GetClientRect(&crct);
SHORT cy=theApp.ParamWin->TreePane->m_PTree.GetItemHeight();
CurveSet *cset;
cset=(CurveSet *)theApp.ParamWin->TreePane->m_PTree.GetItemData(itm);
if(cset && cset->Panel)
{
cset->Panel->SetWindowPos(NULL,0,VisiblePanelCount*cy,crct.Width(),cy,SWP_SHOWWINDOW|SWP_NOZORDER);
cset->Panel->UpdateControl();
PanPnt[VisiblePanelCount++]=cset->Panel;
}
if(theApp.ParamWin->TreePane->m_PTree.GetItemState(itm,0xff)&TVIS_EXPANDED)
{
HTREEITEM nitm=theApp.ParamWin->TreePane->m_PTree.GetChildItem(itm);
while(nitm!=NULL)
{
SetActivePanels(nitm);
nitm=theApp.ParamWin->TreePane->m_PTree.GetNextSiblingItem(nitm);
}
}
}
void CDataParamView::Reset()
{
VisiblePanelCount=0;
}
void CDataParamView::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CView::OnPaint() for painting messages
}
BOOL CDataParamView::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
return TRUE;
// return CView::OnEraseBkgnd(pDC);
}
@@ -0,0 +1,62 @@
#if !defined(AFX_DATAPARAMVIEW_H__D0605BFC_C062_468B_9EAB_806C56D61136__INCLUDED_)
#define AFX_DATAPARAMVIEW_H__D0605BFC_C062_468B_9EAB_806C56D61136__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DataParamView.h : header file
//
class CDynaPanel;
/////////////////////////////////////////////////////////////////////////////
// CDataParamView view
class CDataParamView : public CView
{
protected:
CDataParamView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CDataParamView)
// Attributes
public:
// Operations
public:
void Reset();
void SetActivePanels(HTREEITEM itm=TVI_ROOT);
bool Initalized;
void UpdateScrollPos();
void UpdateControls();
void HideNotVisible();
void Refresh();
CDynaPanel *PanPnt[256];
int VisiblePanelCount;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDataParamView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CDataParamView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CDataParamView)
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnPaint();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DATAPARAMVIEW_H__D0605BFC_C062_468B_9EAB_806C56D61136__INCLUDED_)
@@ -0,0 +1,49 @@
// DynaPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "DynaPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CDynaPanel dialog
CDynaPanel::CDynaPanel(UINT nIDTemplate,CWnd* pParent /*=NULL*/)
: CDialog(nIDTemplate, pParent)
{
dID=nIDTemplate;
Initalized=false;
//{{AFX_DATA_INIT(CDynaPanel)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
MyCSet=NULL;
}
void CDynaPanel::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDynaPanel)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDynaPanel, CDialog)
//{{AFX_MSG_MAP(CDynaPanel)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDynaPanel message handlers
void CDynaPanel::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
}
@@ -0,0 +1,56 @@
#if !defined(AFX_DYNAPANEL_H__43823062_31F6_43D6_99B1_21299313C607__INCLUDED_)
#define AFX_DYNAPANEL_H__43823062_31F6_43D6_99B1_21299313C607__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DynaPanel.h : header file
//
class CurveSet;
/////////////////////////////////////////////////////////////////////////////
// CDynaPanel dialog
class CDynaPanel : public CDialog
{
// Construction
public:
UINT dID;
bool Initalized;
CurveSet *MyCSet;
CDynaPanel(UINT nIDTemplate,CWnd* pParent = NULL); // standard constructor
virtual void UpdateControl() {};
virtual void UpdateCurve() {};
virtual void Set(void *pt) {};
void Initalize(CWnd *par) { Create(dID,par); Initalized=true;};
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CDynaPanel)
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDynaPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDynaPanel)
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DYNAPANEL_H__43823062_31F6_43D6_99B1_21299313C607__INCLUDED_)
@@ -0,0 +1,82 @@
// EBFPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "EBFPanel.h"
#include <GosFx\EffectLibrary.hpp>
#include <MLR\MLRTexturePool.hpp>
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CEBFPanel dialog
#include <GosFx\GosFx.hpp>
CEBFPanel::CEBFPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CEBFPanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CEBFPanel)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CEBFPanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEBFPanel)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEBFPanel, CDynaPanel)
//{{AFX_MSG_MAP(CEBFPanel)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEBFPanel message handlers
void CEBFPanel::Set(void *dat)
{
ShapeSpec=(gosFX::DebrisCloud__Specification *)dat;
}
void CEBFPanel::OnBrowse()
{
CString doc_path=theApp.DocPath.Left(theApp.DocPath.ReverseFind('\\')),shape_path;
// if(doc_path.GetLength()==0) GetCurrentDirectory(doc_path);
SetCurrentDirectory(doc_path);
CFileDialog dlg1(TRUE,"ebf",NULL,OFN_NOCHANGEDIR,"EBF Geometry(*.ebf)|*.ebf||",this);
if(dlg1.DoModal()==IDOK)
{
shape_path=dlg1.GetPathName();
if(doc_path.GetLength()>shape_path.GetLength() ||
shape_path.Left(doc_path.GetLength()).CompareNoCase(doc_path)
)
{
MessageBox("Shape Path Error");
}
else
{
shape_path=shape_path.Mid(doc_path.GetLength()+1);
MString mstr;
mstr=(char *)(LPCSTR)shape_path;
gosFX::EffectLibrary::Instance->LoadDebrisArray(ShapeSpec,mstr);
ShapeSpec->m_shapeFile=shape_path;
MidLevelRenderer::MLRTexturePool::Instance->LoadImages();
}
theApp.StopEffects();
theApp.StartEffects();
}
}
@@ -0,0 +1,54 @@
#if !defined(AFX_EBFPANEL_H__E0DB7F41_7593_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_EBFPANEL_H__E0DB7F41_7593_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EBFPanel.h : header file
//
#include "DynaPanel.h"
#include <MLR\MLR.hpp>
#include <GosFx\GosFx.hpp>
#include <GosFx\DebrisCloud.hpp>
/////////////////////////////////////////////////////////////////////////////
// CEBFPanel dialog
class CEBFPanel : public CDynaPanel
{
// Construction
public:
CEBFPanel(CWnd* pParent = NULL); // standard constructor
virtual void Set(void *dat);
gosFX::DebrisCloud__Specification *ShapeSpec;
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CEBFPanel)
enum { IDD = IDD_EBFPANEL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEBFPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CEBFPanel)
afx_msg void OnBrowse();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EBFPANEL_H__E0DB7F41_7593_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,667 @@
// EditMLRStateDlg.cpp : implementation file
//
#include "stdafx.h"
#include "PixelWhipPro.h"
#include "EditMLRStateDlg.h"
#include <MLR\MLRTexture.hpp>
#include <MLR\MLRTexturePool.hpp>
/////////////////////////////////////////////////////////////////////////////
// CEditMLRStateDlg dialog
CEditMLRStateDlg::CEditMLRStateDlg(CWnd* pParent /*=NULL*/)
: CDialog(CEditMLRStateDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CEditMLRStateDlg)
m_AlphaList = -1;
m_BackFaceList = -1;
m_DitherList = -1;
m_FilterList = -1;
m_LightList = -1;
m_TCorrectList = -1;
m_TextureList = -1;
m_ZBWriteList = -1;
m_ZBCompareList = -1;
m_WireFrameList = -1;
m_FogList = -1;
m_PriList = -1;
m_PAlpha = FALSE;
m_PBackFace = FALSE;
m_PDither = FALSE;
m_PFilter = FALSE;
m_PFog = FALSE;
m_PLight = FALSE;
m_PPriority = FALSE;
m_PTCorrect = FALSE;
m_PTexture = FALSE;
m_PWireFrame = FALSE;
m_PZBWrite = FALSE;
m_PZBCompare = FALSE;
m_PColoring = FALSE;
m_PSpecular = FALSE;
m_ColoringList = -1;
m_SpecularList = -1;
//}}AFX_DATA_INIT
States=NULL;
LastState=-1;
}
void CEditMLRStateDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEditMLRStateDlg)
DDX_Control(pDX, IDC_STATELIST, m_StateList);
DDX_Control(pDX, IDC_TEXTUREDSP, m_TextureText);
DDX_CBIndex(pDX, IDC_ALPHALIST, m_AlphaList);
DDX_CBIndex(pDX, IDC_BACKFACELIST, m_BackFaceList);
DDX_CBIndex(pDX, IDC_DITHERLIST, m_DitherList);
DDX_CBIndex(pDX, IDC_FILTERLIST, m_FilterList);
DDX_CBIndex(pDX, IDC_LIGHTLIST, m_LightList);
DDX_CBIndex(pDX, IDC_TCORRECTLIST, m_TCorrectList);
DDX_CBIndex(pDX, IDC_TEXTURELIST, m_TextureList);
DDX_CBIndex(pDX, IDC_ZBWRITELIST, m_ZBWriteList);
DDX_CBIndex(pDX, IDC_ZBCOMPARELIST, m_ZBCompareList);
DDX_CBIndex(pDX, IDC_WIREFRAMELIST, m_WireFrameList);
DDX_CBIndex(pDX, IDC_FOGLIST, m_FogList);
DDX_CBIndex(pDX, IDC_PRILEVEL, m_PriList);
DDX_Check(pDX, IDC_PER_ALPHA, m_PAlpha);
DDX_Check(pDX, IDC_PER_BACKFACE, m_PBackFace);
DDX_Check(pDX, IDC_PER_DITHER, m_PDither);
DDX_Check(pDX, IDC_PER_FILTER, m_PFilter);
DDX_Check(pDX, IDC_PER_FOG, m_PFog);
DDX_Check(pDX, IDC_PER_LIGHT, m_PLight);
DDX_Check(pDX, IDC_PER_PRI, m_PPriority);
DDX_Check(pDX, IDC_PER_TCORRECT, m_PTCorrect);
DDX_Check(pDX, IDC_PER_TEXTURE, m_PTexture);
DDX_Check(pDX, IDC_PER_WIREFRAME, m_PWireFrame);
DDX_Check(pDX, IDC_PER_ZBWRI, m_PZBWrite);
DDX_Check(pDX, IDC_PER_ZBCOM, m_PZBCompare);
DDX_Check(pDX, IDC_PER_COLORING, m_PColoring);
DDX_Check(pDX, IDC_PER_SPECULAR, m_PSpecular);
DDX_CBIndex(pDX, IDC_COLORINGLIST, m_ColoringList);
DDX_CBIndex(pDX, IDC_SPECULARLIST, m_SpecularList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEditMLRStateDlg, CDialog)
//{{AFX_MSG_MAP(CEditMLRStateDlg)
ON_BN_CLICKED(IDC_SAVEBUT, OnSavebut)
ON_LBN_SELCHANGE(IDC_STATELIST, OnSelchangeStatelist)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEditMLRStateDlg message handlers
BOOL CEditMLRStateDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CString tstr;
int i;
for(i=0;i<States->GetLength();i++)
{
tstr.Format("State#%i",i);
m_StateList.InsertString(-1,tstr);
}
LastState=0;
m_StateList.SetCurSel(0);
ReadState(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CEditMLRStateDlg::ReadState(int stidx)
{
Verify(stidx<States->GetLength());
MidLevelRenderer::MLRState rstate;
rstate=(*States)[stidx];
MidLevelRenderer::MLRTexture *tex = NULL;
if(rstate.GetTextureHandle() && ((tex = (*MidLevelRenderer::MLRTexturePool::Instance)[&rstate]) != NULL))
{
m_TextureText.SetWindowText(tex->GetTextureName());
}
else
m_TextureText.SetWindowText("none");
m_AlphaList=0;
m_WireFrameList=0;
m_FilterList=0;
m_LightList=0;
m_FogList=0;
m_DitherList=0;
m_TCorrectList=0;
m_ZBWriteList=0;
m_ZBCompareList=0;
m_BackFaceList=0;
m_PriList=0;
m_SpecularList=0;
m_ColoringList=0;
int RDMask,PDMask;
RDMask=rstate.GetRenderDeltaMask();
PDMask=rstate.GetProcessDeltaMask();
if(RDMask&MidLevelRenderer::MLRState::AlphaMask)
switch(rstate.GetAlphaMode())
{
case MidLevelRenderer::MLRState::OneZeroMode:
m_AlphaList=1;
break;
case MidLevelRenderer::MLRState::OneOneMode:
m_AlphaList=2;
break;
case MidLevelRenderer::MLRState::AlphaOneMode:
m_AlphaList=3;
break;
case MidLevelRenderer::MLRState::OneAlphaMode:
m_AlphaList=4;
break;
case MidLevelRenderer::MLRState::AlphaInvAlphaMode:
m_AlphaList=5;
break;
case MidLevelRenderer::MLRState::OneInvAlphaMode:
m_AlphaList=6;
break;
}
if(RDMask&MidLevelRenderer::MLRState::WireFrameMask)
switch(rstate.GetWireFrameMode())
{
case MidLevelRenderer::MLRState::WireFrameOffMode:
m_WireFrameList=1;
break;
case MidLevelRenderer::MLRState::WireFrameOnlyMode:
m_WireFrameList=2;
break;
case MidLevelRenderer::MLRState::WireFrameAddMode:
m_WireFrameList=3;
break;
}
if(RDMask&MidLevelRenderer::MLRState::FilterMask)
switch(rstate.GetFilterMode())
{
case MidLevelRenderer::MLRState::NoFilterMode:
m_FilterList=1;
break;
case MidLevelRenderer::MLRState::BiLinearFilterMode:
m_FilterList=2;
break;
case MidLevelRenderer::MLRState::TriLinearFilterMode:
m_FilterList=3;
break;
}
if(PDMask&MidLevelRenderer::MLRState::LightingMask)
{
if( rstate.GetLightingMode()==MidLevelRenderer::MLRState::LightingOffMode)
m_LightList=1;
else
if( rstate.GetLightingMode()==(MidLevelRenderer::MLRState::VertexLightingMode|
MidLevelRenderer::MLRState::FaceLightingMode|
MidLevelRenderer::MLRState::LookupLightingMode))
m_LightList=2;
else
if( rstate.GetLightingMode()==(MidLevelRenderer::MLRState::VertexLightingMode|
MidLevelRenderer::MLRState::FaceLightingMode))
m_LightList=3;
else
if( rstate.GetLightingMode()==(MidLevelRenderer::MLRState::LightMapLightingMode|
MidLevelRenderer::MLRState::FaceLightingMode))
m_LightList=4;
else
if( rstate.GetLightingMode()==MidLevelRenderer::MLRState::LightMapLightingMode)
m_LightList=5;
else
PAUSE(("Light Switch is in Invalid State"));
}
if(RDMask&MidLevelRenderer::MLRState::FogMask)
m_FogList=rstate.GetFogMode()+1;
if(RDMask&MidLevelRenderer::MLRState::DitherMask)
switch(rstate.GetDitherMode())
{
case MidLevelRenderer::MLRState::DitherOnMode:
m_DitherList=1;
break;
case MidLevelRenderer::MLRState::DitherOffMode:
m_DitherList=2;
break;
}
if(RDMask&MidLevelRenderer::MLRState::TextureCorrectionMask)
switch(rstate.GetTextureCorrectionMode())
{
case MidLevelRenderer::MLRState::TextureCorrectionOnMode:
m_TCorrectList=1;
break;
case MidLevelRenderer::MLRState::TextureCorrectionOffMode:
m_TCorrectList=2;
break;
}
if(RDMask&MidLevelRenderer::MLRState::SpecularMask)
switch(rstate.GetSpecularMode())
{
case MidLevelRenderer::MLRState::SpecularOnMode:
m_SpecularList=1;
break;
case MidLevelRenderer::MLRState::SpecularOffMode:
m_SpecularList=2;
break;
}
if(RDMask&MidLevelRenderer::MLRState::FlatColoringMask)
switch(rstate.GetFlatColoringMode())
{
case MidLevelRenderer::MLRState::FlatColoringOnMode:
m_ColoringList=1;
break;
case MidLevelRenderer::MLRState::FlatColoringOffMode:
m_ColoringList=2;
break;
}
if(RDMask&MidLevelRenderer::MLRState::ZBufferCompareMask)
switch(rstate.GetZBufferCompareMode())
{
case MidLevelRenderer::MLRState::ZBufferCompareOnMode:
m_ZBCompareList=1;
break;
case MidLevelRenderer::MLRState::ZBufferCompareOffMode:
m_ZBCompareList=2;
break;
}
if(RDMask&MidLevelRenderer::MLRState::ZBufferWriteMask)
switch(rstate.GetZBufferWriteMode())
{
case MidLevelRenderer::MLRState::ZBufferWriteOnMode:
m_ZBWriteList=1;
break;
case MidLevelRenderer::MLRState::ZBufferWriteOffMode:
m_ZBWriteList=2;
break;
}
if(PDMask&MidLevelRenderer::MLRState::BackFaceMask)
m_BackFaceList=(rstate.GetBackFaceMode()==MidLevelRenderer::MLRState::BackFaceOnMode)?1:2;
if(PDMask&MidLevelRenderer::MLRState::PriorityMask)
m_PriList=rstate.GetPriority()+1;
int PerMask;
PerMask=rstate.GetRenderPermissionMask();
m_PAlpha=(PerMask&MidLevelRenderer::MLRState::AlphaMask)?TRUE:FALSE;
m_PTexture=(PerMask&MidLevelRenderer::MLRState::TextureMask)?TRUE:FALSE;
m_PFilter=(PerMask&MidLevelRenderer::MLRState::FilterMask)?TRUE:FALSE;
m_PWireFrame=(PerMask&MidLevelRenderer::MLRState::WireFrameMask)?TRUE:FALSE;
m_PFog=(PerMask&MidLevelRenderer::MLRState::FogMask)?TRUE:FALSE;
m_PDither=(PerMask&MidLevelRenderer::MLRState::DitherMask)?TRUE:FALSE;
m_PTCorrect=(PerMask&MidLevelRenderer::MLRState::TextureCorrectionMask)?TRUE:FALSE;
m_PSpecular=(PerMask&MidLevelRenderer::MLRState::SpecularMask)?TRUE:FALSE;
m_PColoring=(PerMask&MidLevelRenderer::MLRState::FlatColoringMask)?TRUE:FALSE;
m_PZBCompare=(PerMask&MidLevelRenderer::MLRState::ZBufferCompareMask)?TRUE:FALSE;
m_PZBWrite=(PerMask&MidLevelRenderer::MLRState::ZBufferWriteMask)?TRUE:FALSE;
m_PLight=(rstate.GetProcessPermissionMask()&MidLevelRenderer::MLRState::LightingMask)?TRUE:FALSE;
m_PBackFace=(rstate.GetProcessPermissionMask()&MidLevelRenderer::MLRState::BackFaceMask)?TRUE:FALSE;
m_PPriority=(rstate.GetProcessPermissionMask()&MidLevelRenderer::MLRState::PriorityMask)?TRUE:FALSE;
UpdateData(FALSE);
}
void CEditMLRStateDlg::OnSavebut()
{
UpdateState(m_StateList.GetCurSel());
CDialog::OnOK();
}
void CEditMLRStateDlg::OnOK()
{
// CDialog::OnOK();
}
void CEditMLRStateDlg::UpdateState(int idx)
{
Verify(idx<States->GetLength());
MidLevelRenderer::MLRState rstate;
rstate=(*States)[idx];
UpdateData(TRUE);
//Set Delta Masks
int RDMask,PDMask;
RDMask=rstate.GetRenderDeltaMask();
// RDMask|=MidLevelRenderer::MLRState::TextureMask;
RDMask|=MidLevelRenderer::MLRState::ZBufferCompareMask;
RDMask|=MidLevelRenderer::MLRState::ZBufferWriteMask;
RDMask|=MidLevelRenderer::MLRState::FilterMask;
RDMask|=MidLevelRenderer::MLRState::WireFrameMask;
RDMask|=MidLevelRenderer::MLRState::FogMask;
RDMask|=MidLevelRenderer::MLRState::DitherMask;
RDMask|=MidLevelRenderer::MLRState::TextureCorrectionMask;
RDMask|=MidLevelRenderer::MLRState::SpecularMask;
RDMask|=MidLevelRenderer::MLRState::FlatColoringMask;
PDMask=rstate.GetProcessDeltaMask();
PDMask|=MidLevelRenderer::MLRState::LightingMask;
PDMask|=MidLevelRenderer::MLRState::BackFaceMask;
PDMask|=MidLevelRenderer::MLRState::PriorityMask;
// RDMask=RDMask&~MidLevelRenderer::MLRState::TextureMask;
switch(m_AlphaList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::AlphaMask;
break;
case 1:
rstate.SetAlphaMode(MidLevelRenderer::MLRState::OneZeroMode);
RDMask|=MidLevelRenderer::MLRState::AlphaMask;
break;
case 2:
rstate.SetAlphaMode(MidLevelRenderer::MLRState::OneOneMode);
RDMask|=MidLevelRenderer::MLRState::AlphaMask;
break;
case 3:
rstate.SetAlphaMode(MidLevelRenderer::MLRState::AlphaOneMode);
RDMask|=MidLevelRenderer::MLRState::AlphaMask;
break;
case 4:
rstate.SetAlphaMode(MidLevelRenderer::MLRState::OneAlphaMode);
RDMask|=MidLevelRenderer::MLRState::AlphaMask;
break;
case 5:
rstate.SetAlphaMode(MidLevelRenderer::MLRState::AlphaInvAlphaMode);
RDMask|=MidLevelRenderer::MLRState::AlphaMask;
break;
case 6:
rstate.SetAlphaMode(MidLevelRenderer::MLRState::OneInvAlphaMode);
RDMask|=MidLevelRenderer::MLRState::AlphaMask;
break;
}
switch(m_WireFrameList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::WireFrameMask;
break;
case 1:
rstate.SetWireFrameMode(MidLevelRenderer::MLRState::WireFrameOffMode);
RDMask|=MidLevelRenderer::MLRState::WireFrameMask;
break;
case 2:
rstate.SetWireFrameMode(MidLevelRenderer::MLRState::WireFrameOnlyMode);
RDMask|=MidLevelRenderer::MLRState::WireFrameMask;
break;
case 3:
rstate.SetWireFrameMode(MidLevelRenderer::MLRState::WireFrameAddMode);
RDMask|=MidLevelRenderer::MLRState::WireFrameMask;
break;
}
switch(m_FilterList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::FilterMask;
break;
case 1:
rstate.SetFilterMode(MidLevelRenderer::MLRState::NoFilterMode);
RDMask|=MidLevelRenderer::MLRState::FilterMask;
break;
case 2:
rstate.SetFilterMode(MidLevelRenderer::MLRState::BiLinearFilterMode);
RDMask|=MidLevelRenderer::MLRState::FilterMask;
break;
case 3:
rstate.SetFilterMode(MidLevelRenderer::MLRState::TriLinearFilterMode);
RDMask|=MidLevelRenderer::MLRState::FilterMask;
break;
}
switch(m_LightList)
{
case 0:
PDMask=PDMask^MidLevelRenderer::MLRState::LightingMask;
break;
case 1:
rstate.SetLightingMode(MidLevelRenderer::MLRState::LightingOffMode);
PDMask|=MidLevelRenderer::MLRState::LightingMask;
break;
case 2:
rstate.SetLightingMode( MidLevelRenderer::MLRState::VertexLightingMode|
MidLevelRenderer::MLRState::FaceLightingMode|
MidLevelRenderer::MLRState::LookupLightingMode);
PDMask|=MidLevelRenderer::MLRState::LightingMask;
break;
case 3:
rstate.SetLightingMode(MidLevelRenderer::MLRState::VertexLightingMode|
MidLevelRenderer::MLRState::FaceLightingMode
);
PDMask|=MidLevelRenderer::MLRState::LightingMask;
break;
case 4:
rstate.SetLightingMode(MidLevelRenderer::MLRState::LightMapLightingMode|
MidLevelRenderer::MLRState::FaceLightingMode);
PDMask|=MidLevelRenderer::MLRState::LightingMask;
break;
case 5:
rstate.SetLightingMode(MidLevelRenderer::MLRState::LightMapLightingMode);
PDMask|=MidLevelRenderer::MLRState::LightingMask;
break;
}
if(m_FogList==0)
{
RDMask=RDMask&~MidLevelRenderer::MLRState::FogMask;
}
else
{
rstate.SetFogMode(m_FogList-1);
RDMask|=MidLevelRenderer::MLRState::FogMask;
}
switch(m_DitherList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::DitherMask;
break;
case 1:
rstate.SetDitherOn();
RDMask|=MidLevelRenderer::MLRState::DitherMask;
break;
case 2:
rstate.SetDitherOff();
RDMask|=MidLevelRenderer::MLRState::DitherMask;
break;
}
switch(m_TCorrectList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::TextureCorrectionMask;
break;
case 1:
rstate.SetTextureCorrectionOn();
RDMask|=MidLevelRenderer::MLRState::TextureCorrectionMask;
break;
case 2:
rstate.SetTextureCorrectionOff();
RDMask|=MidLevelRenderer::MLRState::TextureCorrectionMask;
break;
}
switch(m_SpecularList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::SpecularMask;
break;
case 1:
rstate.SetSpecularOn();
RDMask|=MidLevelRenderer::MLRState::SpecularMask;
break;
case 2:
rstate.SetSpecularOff();
RDMask|=MidLevelRenderer::MLRState::SpecularMask;
break;
}
switch(m_ColoringList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::FlatColoringMask;
break;
case 1:
rstate.SetFlatColoringOn();
RDMask|=MidLevelRenderer::MLRState::FlatColoringMask;
break;
case 2:
rstate.SetFlatColoringOff();
RDMask|=MidLevelRenderer::MLRState::FlatColoringMask;
break;
}
switch(m_ZBCompareList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::ZBufferCompareMask;
break;
case 1:
rstate.SetZBufferCompareOn();
RDMask|=MidLevelRenderer::MLRState::ZBufferCompareMask;
break;
case 2:
rstate.SetZBufferCompareOff();
RDMask|=MidLevelRenderer::MLRState::ZBufferCompareMask;
}
switch(m_ZBWriteList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::ZBufferWriteMask;
break;
case 1:
rstate.SetZBufferWriteOn();
RDMask|=MidLevelRenderer::MLRState::ZBufferWriteMask;
break;
case 2:
rstate.SetZBufferWriteOff();
RDMask|=MidLevelRenderer::MLRState::ZBufferWriteMask;
}
switch(m_BackFaceList)
{
case 0:
PDMask=PDMask^MidLevelRenderer::MLRState::BackFaceMask;
break;
case 1:
rstate.SetBackFaceOn();
PDMask|=MidLevelRenderer::MLRState::BackFaceMask;
break;
case 2:
rstate.SetBackFaceOff();
PDMask|=MidLevelRenderer::MLRState::BackFaceMask;
break;
}
if(m_PriList!=0)
{
rstate.SetPriority(m_PriList-1);
PDMask|=MidLevelRenderer::MLRState::PriorityMask;
}
else
{
PDMask=PDMask^MidLevelRenderer::MLRState::PriorityMask;
}
rstate.SetRenderDeltaMask(RDMask);
rstate.SetProcessDeltaMask(PDMask);
//Set Permission Masks
RDMask=rstate.GetRenderPermissionMask();
RDMask=RDMask&~MidLevelRenderer::MLRState::TextureMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::ZBufferCompareMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::ZBufferWriteMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::AlphaMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::FilterMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::WireFrameMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::FogMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::DitherMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::TextureCorrectionMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::SpecularMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::FlatColoringMask;
RDMask|=m_PTexture?MidLevelRenderer::MLRState::TextureMask:0;
RDMask|=m_PZBCompare?MidLevelRenderer::MLRState::ZBufferCompareMask:0;
RDMask|=m_PZBWrite?MidLevelRenderer::MLRState::ZBufferWriteMask:0;
RDMask|=m_PAlpha?MidLevelRenderer::MLRState::AlphaMask:0;
RDMask|=m_PFilter?MidLevelRenderer::MLRState::FilterMask:0;
RDMask|=m_PWireFrame?MidLevelRenderer::MLRState::WireFrameMask:0;
RDMask|=m_PFog?MidLevelRenderer::MLRState::FogMask:0;
RDMask|=m_PDither?MidLevelRenderer::MLRState::DitherMask:0;
RDMask|=m_PTCorrect?MidLevelRenderer::MLRState::TextureCorrectionMask:0;
RDMask|=m_PSpecular?MidLevelRenderer::MLRState::SpecularMask:0;
RDMask|=m_PColoring?MidLevelRenderer::MLRState::FlatColoringMask:0;
rstate.SetRenderPermissionMask(RDMask);
PDMask=rstate.GetProcessPermissionMask();
PDMask=PDMask&~MidLevelRenderer::MLRState::LightingMask;
PDMask=PDMask&~MidLevelRenderer::MLRState::BackFaceMask;
PDMask=PDMask&~MidLevelRenderer::MLRState::PriorityMask;
PDMask|=m_PLight?MidLevelRenderer::MLRState::LightingMask:0;
PDMask|=m_PBackFace?MidLevelRenderer::MLRState::BackFaceMask:0;
PDMask|=m_PPriority?MidLevelRenderer::MLRState::PriorityMask:0;
rstate.SetProcessPermissionMask(PDMask);
(*States)[idx]=rstate;
}
void CEditMLRStateDlg::SetStates(Stuff::DynamicArrayOf<MidLevelRenderer::MLRState> *stt)
{
States=stt;
}
void CEditMLRStateDlg::OnSelchangeStatelist()
{
UpdateState(LastState);
ReadState(m_StateList.GetCurSel());
}
@@ -0,0 +1,93 @@
#if !defined(AFX_EDITMLRSTATEDLG_H__13CCAF64_6905_11D2_8409_00A0C933BCAC__INCLUDED_)
#define AFX_EDITMLRSTATEDLG_H__13CCAF64_6905_11D2_8409_00A0C933BCAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditMLRStateDlg.h : header file
//
#include <GameOS\GameOS.hpp>
#include <MLR\MLR.hpp>
/////////////////////////////////////////////////////////////////////////////
// CEditMLRStateDlg dialog
class CEditMLRStateDlg : public CDialog
{
// Construction
public:
void UpdateState(int idx);
CEditMLRStateDlg(CWnd* pParent = NULL); // standard constructor
Stuff::DynamicArrayOf<MidLevelRenderer::MLRState> *States;
CButton m_Alpha10, m_Alpha11, m_Alpha1A, m_AlphaA1, m_AlphaAIA;
CButton m_LightOff, m_LightClassic, m_LightMap,m_LightMapClass;
CButton m_FilterNone,m_FilterBiLinear,m_FilterTriLinear;
CButton m_WFOff, m_WFOnly, m_WFAdd;
void SetStates(Stuff::DynamicArrayOf<MidLevelRenderer::MLRState> *stt);
// Dialog Data
//{{AFX_DATA(CEditMLRStateDlg)
enum { IDD = IDD_EDITMLRSTATE };
CListBox m_StateList;
CComboBox m_FogNum;
CStatic m_TextureText;
int m_AlphaList;
int m_BackFaceList;
int m_DitherList;
int m_FilterList;
int m_LightList;
int m_TCorrectList;
int m_TextureList;
int m_ZBWriteList;
int m_ZBCompareList;
int m_WireFrameList;
int m_FogList;
int m_PriList;
BOOL m_PAlpha;
BOOL m_PBackFace;
BOOL m_PDither;
BOOL m_PFilter;
BOOL m_PFog;
BOOL m_PLight;
BOOL m_PPriority;
BOOL m_PTCorrect;
BOOL m_PTexture;
BOOL m_PWireFrame;
BOOL m_PZBWrite;
BOOL m_PZBCompare;
BOOL m_PColoring;
BOOL m_PSpecular;
int m_ColoringList;
int m_SpecularList;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEditMLRStateDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
void DisableControls();
void ReadState(int stidx);
int LastState;
// Generated message map functions
//{{AFX_MSG(CEditMLRStateDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSavebut();
virtual void OnOK();
afx_msg void OnFogDisable();
afx_msg void OnFogOfog();
afx_msg void OnFogOfogcolor();
afx_msg void OnSelchangeStatelist();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EDITMLRSTATEDLG_H__13CCAF64_6905_11D2_8409_00A0C933BCAC__INCLUDED_)
@@ -0,0 +1,59 @@
// EditMLRStatePanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "EditMLRStatePanel.h"
#include "EditMLRStateDlg.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CEditMLRStatePanel dialog
CEditMLRStatePanel::CEditMLRStatePanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CEditMLRStatePanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CEditMLRStatePanel)
//}}AFX_DATA_INIT
}
void CEditMLRStatePanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEditMLRStatePanel)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEditMLRStatePanel, CDynaPanel)
//{{AFX_MSG_MAP(CEditMLRStatePanel)
ON_BN_CLICKED(IDC_SETSTATE, OnSetstate)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEditMLRStatePanel message handlers
void CEditMLRStatePanel::Set(void *dat)
{
State=(MidLevelRenderer::MLRState *)dat;
}
void CEditMLRStatePanel::OnSetstate()
{
CEditMLRStateDlg dlg1;
Stuff::DynamicArrayOf< MidLevelRenderer::MLRState> States(1);
States[0]=*State;
dlg1.SetStates(&States);
if(dlg1.DoModal()==IDOK)
{
*State=States[0];
}
}
@@ -0,0 +1,52 @@
#if !defined(AFX_EDITMLRSTATEPANEL_H__FC4360C1_8AEE_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_EDITMLRSTATEPANEL_H__FC4360C1_8AEE_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditMLRStatePanel.h : header file
//
#include "DynaPanel.h"
#include <GosFx\GosFx.hpp>
/////////////////////////////////////////////////////////////////////////////
// CEditMLRStatePanel dialog
class CEditMLRStatePanel : public CDynaPanel
{
// Construction
public:
virtual void Set(void *dat);
CEditMLRStatePanel(CWnd* pParent = NULL); // standard constructor
MidLevelRenderer::MLRState *State;
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CEditMLRStatePanel)
enum { IDD = IDD_MLRSTATEPANEL };
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEditMLRStatePanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CEditMLRStatePanel)
afx_msg void OnSetstate();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EDITMLRSTATEPANEL_H__FC4360C1_8AEE_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,139 @@
// EffectEditWin.cpp : implementation file
//
#include "stdafx.h"
#include "PixelWhipPro.h"
#include "EffectEditWin.h"
#include "TreeParamView.h"
#include "DataParamView.h"
/////////////////////////////////////////////////////////////////////////////
// CEffectEditWin
IMPLEMENT_DYNCREATE(CEffectEditWin, CFrameWnd)
CEffectEditWin::CEffectEditWin()
{
ViewVar=false;
}
CEffectEditWin::~CEffectEditWin()
{
}
BEGIN_MESSAGE_MAP(CEffectEditWin, CFrameWnd)
//{{AFX_MSG_MAP(CEffectEditWin)
ON_WM_CLOSE()
ON_COMMAND(ID_VIEW_VIEWVARIANCEVALUES, OnViewViewvariancevalues)
ON_UPDATE_COMMAND_UI(ID_VIEW_VIEWVARIANCEVALUES, OnUpdateViewViewvariancevalues)
ON_WM_CREATE()
ON_COMMAND(ID_VIEW_VIEWVARIANCECURVE, OnViewViewvariancecurve)
ON_UPDATE_COMMAND_UI(ID_VIEW_VIEWVARIANCECURVE, OnUpdateViewViewvariancecurve)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEffectEditWin message handlers
void CEffectEditWin::OnClose()
{
ShowWindow(SW_HIDE);
// CFrameWnd::OnClose();
}
void CEffectEditWin::Create(CWnd *Parent)
{
CRect rct=rectDefault;
rct.right=rct.left+512;
rct.bottom=rct.top+640;
//CWnd::Create(NULL,"Effect Parameters",WS_THICKFRAME|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU,rct,Parent,IDR_PARAMMENU);
//CFrameWnd::Create(NULL,"Effect Parameters",WS_THICKFRAME|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU,rct,Parent,MAKEINTRESOURCE(IDR_PARAMMENU));
//LoadFrame(IDR_PARAMMENU,WS_THICKFRAME|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU,Parent,NULL);
LoadFrame(IDR_PARAMMENU,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
}
void CEffectEditWin::Refresh()
{
TreePane->Refresh();
//DataPane->Refresh();
}
void CEffectEditWin::OnViewViewvariancevalues()
{
ViewVar=!ViewVar;
DataPane->Refresh();
}
void CEffectEditWin::OnUpdateViewViewvariancevalues(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(ViewVar?1:0);
}
int CEffectEditWin::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_PARAMMENU))
{
TRACE0("Failed to create toolbar\n");
}
// TODO: Delete these three lines if you don't want the toolbar to be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
m_splitter.CreateStatic(this,1,2);
m_splitter.CreateView(0,0,RUNTIME_CLASS(CTreeParamView),CSize(200,1024),NULL);
m_splitter.CreateView(0,1,RUNTIME_CLASS(CDataParamView),CSize(200,1024),NULL);
TreePane=(CTreeParamView *)m_splitter.GetPane(0,0);
DataPane=(CDataParamView *)m_splitter.GetPane(0,1);
RecalcLayout();
return 0;
}
BOOL CEffectEditWin::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Add your specialized code here and/or call the base class
// cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
// cs.lpszClass = AfxRegisterWndClass(0);
return CFrameWnd::PreCreateWindow(cs);
}
BOOL CEffectEditWin::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// TODO: Add your specialized code here and/or call the base class
return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
void CEffectEditWin::OnViewViewvariancecurve()
{
// TODO: Add your command handler code here
ViewVar=!ViewVar;
}
void CEffectEditWin::OnUpdateViewViewvariancecurve(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(ViewVar?1:0);
}
@@ -0,0 +1,63 @@
#if !defined(AFX_EFFECTEDITWIN_H__EBD9049B_E279_4429_8415_4BE583C5EC3D__INCLUDED_)
#define AFX_EFFECTEDITWIN_H__EBD9049B_E279_4429_8415_4BE583C5EC3D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EffectEditWin.h : header file
//
class CTreeParamView;
class CDataParamView;
/////////////////////////////////////////////////////////////////////////////
// CEffectEditWin frame
class CEffectEditWin : public CFrameWnd
{
DECLARE_DYNCREATE(CEffectEditWin)
protected:
// Attributes
public:
void Create(CWnd *parent);
CEffectEditWin(); // protected constructor used by dynamic creation
virtual ~CEffectEditWin();
CSplitterWnd m_splitter;
CToolBar m_wndToolBar;
CTreeParamView *TreePane;
CDataParamView *DataPane;
bool ViewVar;
// Operations
public:
void Refresh();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEffectEditWin)
public:
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CEffectEditWin)
afx_msg void OnClose();
afx_msg void OnViewViewvariancevalues();
afx_msg void OnUpdateViewViewvariancevalues(CCmdUI* pCmdUI);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnViewViewvariancecurve();
afx_msg void OnUpdateViewViewvariancecurve(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EFFECTEDITWIN_H__EBD9049B_E279_4429_8415_4BE583C5EC3D__INCLUDED_)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,138 @@
#if !defined(AFX_EFFECTLISTTREECTRL_H__1C0F1312_C9C6_4AE8_830F_200EF03906BD__INCLUDED_)
#define AFX_EFFECTLISTTREECTRL_H__1C0F1312_C9C6_4AE8_830F_200EF03906BD__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EffectListTreeCtrl.h : header file
//
#include <GosFx\GosFx.hpp>
#include <GosFx\EffectLibrary.hpp>
/////////////////////////////////////////////////////////////////////////////
// CEffectListTreeCtrl window
class CEffectListTreeCtrl : public CTreeCtrl
{
// Construction
public:
CEffectListTreeCtrl();
HTREEITEM selitm;
CString MakeUnique(CString &str);
bool InList(CString &str,HTREEITEM itm=TVI_ROOT);
void UpdatePlayIcons();
void UpdatePlayIcons(HTREEITEM itm);
void ClearPlayIcons(HTREEITEM itm=TVI_ROOT);
CImageList IList;
CPoint cmousepos;
// Attributes
public:
// Operations
public:
enum {
IDX_SHAPE=0,
IDX_NULL,
IDX_POINTCLOUD,
IDX_SHAPECLOUD,
IDX_PERTCLOUD,
IDX_DEBRISCLOUD,
IDX_EFFECTCLOUD,
IDX_LASER,
IDX_TUBE,
IDX_LIGHT,
IDX_FLARE,
IDX_CARD,
IDX_CARDCLOUD,
IDX_SHARDCLOUD,
IDX_SPRITECLOUD,
IDX_SHAPESEL,
IDX_NULLSEL,
IDX_POINTCLOUDSEL,
IDX_SHAPECLOUDSEL,
IDX_PERTCLOUDSEL,
IDX_DEBRISCLOUDSEL,
IDX_LASERSEL,
IDX_TUBESEL,
IDX_LIGHTSEL,
IDX_FLARESEL,
IDX_CARDSEL,
IDX_CARDCLOUDSEL,
IDX_SHARDCLOUDSEL,
IDX_SPRITECLOUDSEL,
IDX_EFFECTCLOUDSEL,
IDX_TOTALICONS
};
int IconIdx[IDX_TOTALICONS];
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEffectListTreeCtrl)
//}}AFX_VIRTUAL
// Implementation
public:
void CopySelectedIntoLib(gosFX::EffectLibrary *fxLib);
void CopySelectedIntoLib(gosFX::EffectLibrary *fxLib,HTREEITEM itm);
void SortEvents(gosFX::Effect::Specification *spec);
int ListChildren(gosFX::Effect::Specification *spec,gosFX::Effect::Specification **speclist);
void DeleteEffect(gosFX::Effect::Specification *spec);
int DuplicateEffect(int efnum);
virtual ~CEffectListTreeCtrl();
int EffectsInBranch(gosFX::Effect::Specification *spec,int par=0);
void DeleteSelectedEffect();
gosFX::Effect::Specification *GetParentEffect(gosFX::Effect::Specification *spec);
void DetachReferences(gosFX::Effect::Specification *spec,gosFX::Effect::Specification *parspec);
void ScaleSelectedEffect(float sfact,bool recurse=false,bool bright=false);
void ScaleAllEffects(float sfact,bool bright=false);
void ScaleEffectTree(HTREEITEM itm,float sfact,bool bright);
void ScaleEffect(gosFX::Effect::Specification *spec,float sfact,bool bright);
int IdxBlank,IdxPlay;
void MakeAllNamesUnique();
void InitImages();
int NewSpriteCloud();
int NewBeam();
int NewNullEffect();
int NewDebrisCloud();
int NewCardCloud();
int NewPertcloud();
int NewPointCloud();
int NewShapeCloud();
int NewShardCloud();
int NewSingletonCard();
int NewSingletonShape();
int NewSingletonFlare();
int NewEffectCloud();
int NewTube();
int NewPointLight();
int GetIconIdx(Stuff::RegisteredClass::ClassID id,bool selected=false);
// Generated message map functions
protected:
//{{AFX_MSG(CEffectListTreeCtrl)
afx_msg void OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EFFECTLISTTREECTRL_H__1C0F1312_C9C6_4AE8_830F_200EF03906BD__INCLUDED_)
@@ -0,0 +1,294 @@
// EffectListWin.cpp : implementation file
//
#include "stdafx.h"
#include "PixelWhipPro.h"
#include "EffectListWin.h"
#include "EffectEditWin.h"
#include "EventProps.h"
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\gosFXElement.hpp>
#include <GosFx\GosFx.hpp>
#include <GosFx\EffectCloud.hpp>
extern ElementRenderer::gosFXElement *EffectWrapper;
extern gosFX::Effect *CurrentEffect;
extern ElementRenderer::GroupElement *Scene;
/////////////////////////////////////////////////////////////////////////////
// CEffectListWin dialog
extern CPixelWhipProApp theApp;
CEffectListWin::CEffectListWin(CWnd* pParent /*=NULL*/)
: CDialog(CEffectListWin::IDD, pParent)
{
//{{AFX_DATA_INIT(CEffectListWin)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
AllowRedraw=0;
Initalized=false;
}
void CEffectListWin::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEffectListWin)
DDX_Control(pDX, IDC_EFFECTLIST, m_EffectList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEffectListWin, CDialog)
//{{AFX_MSG_MAP(CEffectListWin)
ON_WM_CLOSE()
ON_NOTIFY(TVN_SELCHANGED, IDC_EFFECTLIST, OnSelchangedEffectlist)
ON_NOTIFY(TVN_ENDLABELEDIT, IDC_EFFECTLIST, OnEndlabeleditEffectlist)
ON_NOTIFY(NM_DBLCLK, IDC_EFFECTLIST, OnDblclkEffectlist)
ON_WM_SIZE()
ON_WM_CHAR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEffectListWin message handlers
void CEffectListWin::OnCancel()
{
// CDialog::OnCancel();
}
void CEffectListWin::OnOK()
{
// CDialog::OnOK();
}
void CEffectListWin::OnClose()
{
ShowWindow(SW_HIDE);
// CDialog::OnClose();
}
void CEffectListWin::Refresh()
{
AllowRedraw++;
theApp.FixEffectNameTable();
int effnum;
HTREEITEM CurItem=TVI_ROOT,LastItem=TVI_ROOT;
m_EffectList.DeleteAllItems();
gos_PushCurrentHeap(gosFX::Heap);
gosFX::Effect::Specification **speclist=new gosFX::Effect::Specification *[gosFX::EffectLibrary::Instance->m_effects.GetLength()];
gos_PopCurrentHeap();
for(effnum=0;effnum<gosFX::EffectLibrary::Instance->m_effects.GetLength();effnum++)
{
speclist[effnum]= gosFX::EffectLibrary::Instance->m_effects[effnum];
}
for(effnum=0;effnum<gosFX::EffectLibrary::Instance->m_effects.GetLength();effnum++)
{
DeleteChildrenFromList(speclist[effnum],speclist);
}
for(effnum=0;effnum<gosFX::EffectLibrary::Instance->m_effects.GetLength();effnum++)
{
if(speclist[effnum]!=NULL)
{
LastItem=m_EffectList.InsertItem(speclist[effnum]->m_name,0,0,CurItem,LastItem);
m_EffectList.SetItemData(LastItem,(DWORD)speclist[effnum]);
AddEventToList(LastItem);
}
}
AllowRedraw--;
m_EffectList.ClearPlayIcons();
theApp.StopEffects();
theApp.StartEffects();
theApp.ParamWin->Refresh();
delete speclist;
}
void CEffectListWin::DeleteChildrenFromList(gosFX::Effect::Specification *spec,gosFX::Effect::Specification **speclist)
{
if(spec==NULL) return;
gosFX::Event *event;
Stuff::ChainIteratorOf<gosFX::Event*> eitr(&(spec->m_events));
if(spec->GetClassID()==gosFX::EffectCloudClassID)
{
gosFX::EffectCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::EffectCloud__Specification *,spec);
Check_Object(tspec);
if(tspec->m_particleEffectID!=BADINDEX)
{
for(int effnum=0;effnum<gosFX::EffectLibrary::Instance->m_effects.GetLength();effnum++)
{
if(speclist[effnum]==gosFX::EffectLibrary::Instance->m_effects[tspec->m_particleEffectID])
speclist[effnum]=NULL;
}
DeleteChildrenFromList(gosFX::EffectLibrary::Instance->m_effects[tspec->m_particleEffectID],speclist);
}
}
else
{
eitr.First();
while(NULL!=(event=eitr.ReadAndNext()))
{
// int testvar=1;
// Verify(event->m_effectID!=testvar);
for(int effnum=0;effnum<gosFX::EffectLibrary::Instance->m_effects.GetLength();effnum++)
{
if(speclist[effnum] && speclist[effnum]==gosFX::EffectLibrary::Instance->m_effects[event->m_effectID])
speclist[effnum]=NULL;
}
DeleteChildrenFromList(gosFX::EffectLibrary::Instance->m_effects[event->m_effectID],speclist);
}
}
}
void CEffectListWin::OnSelchangedEffectlist(NMHDR* pNMHDR, LRESULT* pResult)
{
if(AllowRedraw) return;
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
theApp.StopEffects();
theApp.StartEffects();
theApp.ParamWin->Refresh();
m_EffectList.ClearPlayIcons();
m_EffectList.UpdatePlayIcons();
*pResult = 0;
}
void CEffectListWin::AddEventToList(HTREEITEM itm)
{
if(itm==NULL) return;
gosFX::Effect::Specification *spec,*nspec;
gosFX::Event *event;
spec = (gosFX::Effect::Specification *)m_EffectList.GetItemData(itm);
HTREEITEM LastItem=TVI_LAST;
Stuff::ChainIteratorOf<gosFX::Event*> eitr(&(spec->m_events));
if(spec->GetClassID()==gosFX::EffectCloudClassID)
{
gosFX::EffectCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::EffectCloud__Specification *,spec);
Check_Object(tspec);
if(tspec->m_particleEffectID!=BADINDEX)
{
nspec=gosFX::EffectLibrary::Instance->m_effects[tspec->m_particleEffectID];
LastItem=m_EffectList.InsertItem(nspec->m_name,0,0,itm,LastItem);
m_EffectList.SetItemData(LastItem,(DWORD)nspec);
AddEventToList(LastItem);
}
}
else
{
eitr.First();
while(NULL!=(event=eitr.ReadAndNext()))
{
nspec=gosFX::EffectLibrary::Instance->m_effects[event->m_effectID];
LastItem=m_EffectList.InsertItem(nspec->m_name,0,0,itm,LastItem);
m_EffectList.SetItemData(LastItem,(DWORD)nspec);
AddEventToList(LastItem);
}
}
}
void CEffectListWin::OnEndlabeleditEffectlist(NMHDR* pNMHDR, LRESULT* pResult)
{
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
// TODO: Add your control notification handler code here
if(pTVDispInfo->item.pszText)
{
gosFX::Effect::Specification *spec;
spec = (gosFX::Effect::Specification *)m_EffectList.GetItemData(m_EffectList.GetSelectedItem());
spec->m_name=pTVDispInfo->item.pszText;
m_EffectList.SetItemText(pTVDispInfo->item.hItem,spec->m_name);
}
*pResult = 0;
}
void CEffectListWin::OnDblclkEffectlist(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
CEventProps propdlg;
HTREEITEM ParItem,Cursel=m_EffectList.GetSelectedItem();
ParItem=m_EffectList.GetParentItem(Cursel);
gosFX::Event *tmpevent;
if(Cursel!=NULL && ParItem!=NULL)
{
gosFX::Effect::Specification *spec=(gosFX::Effect::Specification *)m_EffectList.GetItemData(Cursel);
gosFX::Effect::Specification *parspec=(gosFX::Effect::Specification *)m_EffectList.GetItemData(ParItem);
Stuff::ChainIteratorOf<gosFX::Event*> eitr(&(parspec->m_events));
eitr.First();
while(NULL!=(tmpevent=eitr.ReadAndNext()) && tmpevent->m_effectID!=spec->m_effectID);
ASSERT(tmpevent!=NULL); //Fatal Error
propdlg.DoModal(tmpevent);
}
*pResult = 0;
}
void CEffectListWin::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
CRect rct;
GetClientRect(&rct);
if(Initalized)
m_EffectList.SetWindowPos(NULL,10,10,rct.Width()-20,rct.Height()-20,SWP_NOZORDER);
}
BOOL CEffectListWin::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
Initalized=true;
m_EffectList.InitImages();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CEffectListWin::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
switch(nChar)
{
case VK_DELETE:
m_EffectList.DeleteSelectedEffect();
break;
}
CDialog::OnChar(nChar, nRepCnt, nFlags);
}
@@ -0,0 +1,59 @@
#if !defined(AFX_EFFECTLISTWIN_H__8E27202B_E127_448C_8F15_07FDAFC3BF5B__INCLUDED_)
#define AFX_EFFECTLISTWIN_H__8E27202B_E127_448C_8F15_07FDAFC3BF5B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EffectListWin.h : header file
//
#include <GosFx\GosFx.hpp>
#include "EffectListTreeCtrl.h"
/////////////////////////////////////////////////////////////////////////////
// CEffectListWin dialog
class CEffectListWin : public CDialog
{
// Construction
public:
void DeleteChildrenFromList(gosFX::Effect::Specification *spec,gosFX::Effect::Specification **speclist);
void AddEventToList(HTREEITEM itm);
void Refresh();
int AllowRedraw;
CEffectListWin(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CEffectListWin)
enum { IDD = IDD_EFFECTSLIST };
CEffectListTreeCtrl m_EffectList;
//}}AFX_DATA
bool Initalized;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEffectListWin)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CEffectListWin)
virtual void OnCancel();
virtual void OnOK();
afx_msg void OnClose();
afx_msg void OnSelchangedEffectlist(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndlabeleditEffectlist(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDblclkEffectlist(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSize(UINT nType, int cx, int cy);
virtual BOOL OnInitDialog();
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EFFECTLISTWIN_H__8E27202B_E127_448C_8F15_07FDAFC3BF5B__INCLUDED_)
@@ -0,0 +1,166 @@
// EventProps.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "EventProps.h"
/////////////////////////////////////////////////////////////////////////////
// CEventProps dialog
CEventProps::CEventProps(CWnd* pParent /*=NULL*/)
: CDialog(CEventProps::IDD, pParent)
{
//{{AFX_DATA_INIT(CEventProps)
m_ETime = 0.0f;
m_xpos = 0.0f;
m_ypos = 0.0f;
m_zpos = 0.0f;
m_LoopFlag = FALSE;
m_SimSpace = -1;
m_EndDist = 0.0f;
m_StartDist = 0.0f;
//}}AFX_DATA_INIT
CurEvt=NULL;
}
void CEventProps::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEventProps)
DDX_Text(pDX, IDC_EVENTTIME, m_ETime);
DDV_MinMaxFloat(pDX, m_ETime, 0.f, 1.f);
DDX_Text(pDX, IDC_XPOS, m_xpos);
DDX_Text(pDX, IDC_YPOS, m_ypos);
DDX_Text(pDX, IDC_ZPOS, m_zpos);
DDX_Check(pDX, IDC_LOOPING, m_LoopFlag);
DDX_CBIndex(pDX, IDC_SIMSPACE, m_SimSpace);
DDX_Text(pDX, IDC_ENDDIST, m_EndDist);
DDX_Text(pDX, IDC_STARTDIST, m_StartDist);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEventProps, CDialog)
//{{AFX_MSG_MAP(CEventProps)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEventProps message handlers
BOOL CEventProps::OnInitDialog()
{
CDialog::OnInitDialog();
/*
// TODO: Add extra initialization here
int effnum,inum;
for(effnum=0;effnum<gosFX::EffectLibrary::Instance->m_effects.GetLength();effnum++)
if(effnum!=ParSpec->m_effectID)
{
gosFX::Effect::Specification *spec = gosFX::EffectLibrary::Instance->m_effects[effnum];
inum=m_EList.AddString(spec->m_name);
m_EList.SetItemDataPtr(inum,(void *)spec);
}
m_EList.SetCurSel(0);
*/
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CEventProps::OnCancel()
{
CDialog::OnCancel();
}
void CEventProps::OnOK()
{
UpdateData(TRUE);
/*
gosFX::Effect::Specification *spec=(gosFX::Effect::Specification *)m_EList.GetItemDataPtr(m_EList.GetCurSel());
CurEvt->m_effectID=spec->m_effectID;
*/
CurEvt->m_time=m_ETime;
Stuff::Point3D pnt(0,0,0);
pnt.x=m_xpos;
pnt.y=m_ypos;
pnt.z=m_zpos;
CurEvt->m_localToParent=pnt;
CurEvt->m_nearLimit=m_StartDist*m_StartDist;
CurEvt->m_farLimit=m_EndDist*m_EndDist;
CurEvt->m_flags=0;
if(m_LoopFlag)
CurEvt->m_flags|=gosFX::Effect::LoopFlag;
switch(m_SimSpace)
{
case 0:
CurEvt->m_flags|=gosFX::Effect::ParentSimulationMode;
break;
case 1:
CurEvt->m_flags|=gosFX::Effect::LocalSpaceSimulationMode;
break;
case 2:
CurEvt->m_flags|=gosFX::Effect::StaticWorldSpaceSimulationMode;
break;
case 3:
CurEvt->m_flags|=gosFX::Effect::DynamicWorldSpaceSimulationMode;
break;
}
CDialog::OnOK();
}
int CEventProps::DoModal(gosFX::Event *evt)
{
Check_Object(evt);
CurEvt=evt;
Stuff::Point3D pnt(0,0,0);
m_ETime=CurEvt->m_time;
pnt*=CurEvt->m_localToParent;
m_xpos=pnt.x;
m_ypos=pnt.y;
m_zpos=pnt.z;
m_LoopFlag=(CurEvt->m_flags&gosFX::Effect::LoopFlag)?TRUE:FALSE;
m_StartDist=(float)sqrt(CurEvt->m_nearLimit);
m_EndDist=(float)sqrt(CurEvt->m_farLimit);
DWORD AllFlags= (gosFX::Effect::StaticWorldSpaceSimulationMode|
gosFX::Effect::DynamicWorldSpaceSimulationMode|
gosFX::Effect::ParentSimulationMode|
gosFX::Effect::LocalSpaceSimulationMode
);
DWORD tflag=CurEvt->m_flags&AllFlags;
if(tflag==gosFX::Effect::StaticWorldSpaceSimulationMode)
m_SimSpace=2;
if(tflag==gosFX::Effect::DynamicWorldSpaceSimulationMode)
m_SimSpace=3;
if(tflag==gosFX::Effect::ParentSimulationMode)
m_SimSpace=0;
if(tflag==gosFX::Effect::LocalSpaceSimulationMode)
m_SimSpace=1;
return CDialog::DoModal();
}
@@ -0,0 +1,59 @@
#if !defined(AFX_EVENTPROPS_H__B5699EC6_6F03_41B4_9FA7_9DFCC2929AC6__INCLUDED_)
#define AFX_EVENTPROPS_H__B5699EC6_6F03_41B4_9FA7_9DFCC2929AC6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EventProps.h : header file
//
#include <GosFx\GosFx.hpp>
#include <GosFx\EffectLibrary.hpp>
/////////////////////////////////////////////////////////////////////////////
// CEventProps dialog
class CEventProps : public CDialog
{
// Construction
public:
CEventProps(CWnd* pParent = NULL); // standard constructor
gosFX::Event *CurEvt;
// Dialog Data
//{{AFX_DATA(CEventProps)
enum { IDD = IDD_NEWEVENTDLG };
float m_ETime;
float m_xpos;
float m_ypos;
float m_zpos;
BOOL m_LoopFlag;
int m_SimSpace;
float m_EndDist;
float m_StartDist;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEventProps)
public:
virtual int DoModal(gosFX::Event *evt);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CEventProps)
virtual BOOL OnInitDialog();
virtual void OnCancel();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EVENTPROPS_H__B5699EC6_6F03_41B4_9FA7_9DFCC2929AC6__INCLUDED_)
@@ -0,0 +1,14 @@
#ifndef EXPORT_H_
#define EXPORT_H_
#include <GosFx\GosFx.hpp>
#include <GosFx\Effect.hpp>
#include <MLR\MLR.hpp>
#include <MLR\MLRState.hpp>
void ExportEffect(FILE *fl,gosFX::Effect::Specification *spec,CString prefix="");
void ExportCurve(FILE *fl,gosFX::Curve *Curve,char *CurveName,CString prefix="");
void ExportState(FILE *fl,MidLevelRenderer::MLRState *State,char *Name,CString prefix="");
bool IsRootEffect(gosFX::Effect::Specification *spec);
#endif
@@ -0,0 +1,94 @@
// FloatPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "FloatPanel.h"
#include "CurveSet.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CFloatPanel dialog
CFloatPanel::CFloatPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CFloatPanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CFloatPanel)
m_FloatVal = 0;
//}}AFX_DATA_INIT
NeedUpdate=false;
}
void CFloatPanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFloatPanel)
DDX_Text(pDX, IDC_FLOATNUM, m_FloatVal);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFloatPanel, CDynaPanel)
//{{AFX_MSG_MAP(CFloatPanel)
ON_EN_CHANGE(IDC_FLOATNUM, OnChangeFloat)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFloatPanel message handlers
void CFloatPanel::UpdateControl()
{
m_FloatVal=1/(*floatval);
UpdateData(FALSE);
}
void CFloatPanel::Set(void *pt)
{
floatval=(float *)pt;
}
void CFloatPanel::OnChangeFloat()
{
UpdateData(TRUE);
NeedUpdate=true;
SetTimer(1,1000,NULL);
}
BOOL CFloatPanel::OnInitDialog()
{
CDynaPanel::OnInitDialog();
UpdateControl();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CFloatPanel::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
if(NeedUpdate)
{
theApp.StopEffects();
float OldValue=*floatval;
*floatval=1/(m_FloatVal);
if(!MyCSet->IsDataValid())
{
*floatval=m_FloatVal=OldValue;
UpdateData(FALSE);
}
NeedUpdate=false;
theApp.StartEffects();
}
CDynaPanel::OnTimer(nIDEvent);
}
@@ -0,0 +1,56 @@
#if !defined(AFX_FLOATPANEL_H__EA7F79E1_CB63_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_FLOATPANEL_H__EA7F79E1_CB63_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// FloatPanel.h : header file
//
#include "DynaPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CFloatPanel dialog
class CFloatPanel : public CDynaPanel
{
// Construction
public:
bool NeedUpdate;
CFloatPanel(CWnd* pParent = NULL); // standard constructor
virtual void UpdateControl();
virtual void Set(void *pt);
virtual void OnCancel() {}
virtual void OnOK() {}
float *floatval;
// Dialog Data
//{{AFX_DATA(CFloatPanel)
enum { IDD = IDD_FLOATPANEL };
float m_FloatVal;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFloatPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CFloatPanel)
afx_msg void OnChangeFloat();
virtual BOOL OnInitDialog();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FLOATPANEL_H__EA7F79E1_CB63_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,552 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "PixelWhipPro.h"
#include "MainFrm.h"
#include "PixelWhipPro.h"
#include "View3DChildWindow.h"
#include "EffectListWin.h"
#include "PP2KEffectLibrary.hpp"
#include "ScaleOpt.h"
#include <MFCPlatform\MFCPlatform.hpp>
#include <MLR\MLRHeaders.hpp>
#include <GosFx\GosFx.hpp>
#include <ElementRenderer\ElementRenderer.hpp>
#include "EffectEditWin.h"
#include "CurveEditorFrame.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
ON_WM_CLOSE()
ON_WM_SIZE()
ON_WM_MOVE()
ON_COMMAND(ID_FILE_LOADEFFECT, OnFileLoadeffect)
ON_COMMAND(ID_FILE_SAVEEFFECT, OnFileSaveeffect)
ON_COMMAND(ID_FILE_QUICKSAVE, OnFileQuicksave)
ON_UPDATE_COMMAND_UI(ID_FILE_QUICKSAVE, OnUpdateFileQuicksave)
ON_COMMAND(ID_EDIT_NEWEFFECT_CARDCLOUD, OnEditNeweffectCardcloud)
ON_COMMAND(ID_EDIT_NEWEFFECT_PERTCLOUD, OnEditNeweffectPertcloud)
ON_COMMAND(ID_EDIT_NEWEFFECT_POINTCLOUD, OnEditNeweffectPointcloud)
ON_COMMAND(ID_EDIT_NEWEFFECT_SHAPECLOUD, OnEditNeweffectShapecloud)
ON_COMMAND(ID_EDIT_NEWEFFECT_SHARDCLOUD, OnEditNeweffectShardcloud)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_UPDATE_COMMAND_UI(ID_FILE_NEW, OnUpdateFileNew)
ON_COMMAND(ID_EDIT_DELETEEFFECT, OnEditDeleteeffect)
ON_COMMAND(ID_EDIT_NEWEFFECT_SINGLETON_CARD, OnEditNeweffectSingletonCard)
ON_COMMAND(ID_EDIT_NEWEFFECT_SINGLETON_SHAPE, OnEditNeweffectSingletonShape)
ON_COMMAND(ID_EDIT_NEWEFFECT_EFFECTCLOUD, OnEditNeweffectEffectcloud)
ON_COMMAND(ID_FILE_LOADLASTLIBRARY, OnFileLoadlastlibrary)
ON_COMMAND(ID_EDIT_NEWEFFECT_NULLEFFECT, OnEditNeweffectNulleffect)
ON_COMMAND(ID_EDIT_NEWEFFECT_TUBE, OnEditNeweffectTube)
ON_COMMAND(ID_EDIT_NEWEFFECT_DEBRISCLOUD, OnEditNeweffectDebriscloud)
ON_COMMAND(ID_EDIT_NEWEFFECT_POINTLIGHT, OnEditNeweffectPointlight)
ON_COMMAND(ID_FILE_IMPORT, OnFileImport)
ON_COMMAND(ID_EDIT_NEWEFFECT_BEAM, OnEditNeweffectBeam)
ON_COMMAND(ID_EDIT_NEWEFFECT_SINGLETON_FLARE, OnEditNeweffectSingletonFlare)
ON_COMMAND(ID_EDIT_NEWEFFECT_CLOUDS_SPRITECLOUD, OnEditNeweffectCloudsSpritecloud)
ON_WM_TIMER()
ON_COMMAND(ID_FILE_EXPORTCURRENTEFFECT, OnFileExportcurrenteffect)
ON_COMMAND(ID_EDIT_SCALEEFFECT, OnEditScaleeffect)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
theApp.DocTitle="Untitled.effects";
theApp.DocPath="";
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
SetTimer(1,500,NULL);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CMDIFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CMDIFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
void CMainFrame::OnClose()
{
int res=IDYES;
if(theApp.Modified)
{
res=MessageBox("Unsaved Data... Do you really want to Quit?","Quit Confirmation",MB_YESNO);
}
if(res==IDYES)
{
theApp.SaveWindowStates();
theApp.GOSCleanUp();
PostQuitMessage(0);
// CMDIFrameWnd::OnClose();
}
}
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CMDIFrameWnd::OnSize(nType, cx, cy);
if(theApp.GOSActive)
theApp.Window3D->Fix3DView();
}
void CMainFrame::OnMove(int x, int y)
{
CMDIFrameWnd::OnMove(x, y);
if(theApp.GOSActive)
theApp.Window3D->Fix3DView();
}
void CMainFrame::OnFileLoadeffect()
{
int res=IDYES;
if(theApp.Modified)
{
res=MessageBox("Unsaved Data... Do you really want to Load?","Quit Confirmation",MB_YESNO);
}
if(res!=IDYES) return;
CFileDialog dlg1(TRUE,"effects",NULL,NULL,"Effects (*.effects)|*.effects||",this);
if(dlg1.DoModal()==IDOK)
{
LoadEffect(dlg1.GetPathName());
}
}
void CMainFrame::OnFileSaveeffect()
{
CFileDialog dlg1(FALSE,"effects",theApp.DocTitle,NULL,"Effects (*.effects)|*.effects||",this);
if(dlg1.DoModal()==IDOK)
{
theApp.DocPath=dlg1.GetPathName();
theApp.DocTitle=dlg1.GetFileName();
theApp.WriteProfileString("PixelPro2000","LastLib",theApp.DocPath);
OnFileQuicksave();
}
}
void CMainFrame::OnFileQuicksave()
{
theApp.EListWin->m_EffectList.MakeAllNamesUnique();
Stuff::FileStream gfx_file(theApp.DocPath, Stuff::FileStream::WriteOnly);
/*
if (!gosFX::EffectLibrary::Instance->SortSpecifications())
{
// >>> *** one or more events lost due to circular reference *** <<<
}
*/
theApp.Modified=false;
gosFX::EffectLibrary::Instance->Save(&gfx_file);
}
void CMainFrame::OnUpdateFileQuicksave(CCmdUI* pCmdUI)
{
pCmdUI->Enable(theApp.DocPath.GetLength()>0);
}
void CMainFrame::OnEditNeweffectCardcloud()
{
theApp.EListWin->m_EffectList.NewCardCloud();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectPertcloud()
{
theApp.EListWin->m_EffectList.NewPertcloud();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectPointcloud()
{
theApp.EListWin->m_EffectList.NewPointCloud();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectShapecloud()
{
theApp.EListWin->m_EffectList.NewShapeCloud();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectShardcloud()
{
theApp.EListWin->m_EffectList.NewShardCloud();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectSingletonCard()
{
theApp.EListWin->m_EffectList.NewSingletonCard();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectSingletonShape()
{
theApp.EListWin->m_EffectList.NewSingletonShape();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectSingletonFlare()
{
theApp.EListWin->m_EffectList.NewSingletonFlare();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectEffectcloud()
{
theApp.EListWin->m_EffectList.NewEffectCloud();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectTube()
{
theApp.EListWin->m_EffectList.NewTube();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectDebriscloud()
{
theApp.EListWin->m_EffectList.NewDebrisCloud();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectPointlight()
{
theApp.EListWin->m_EffectList.NewPointLight();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnFileNew()
{
int res=IDYES;
if(theApp.Modified)
{
res=MessageBox("Unsaved Data... Do you really want New?","Quit Confirmation",MB_YESNO);
}
if(res!=IDYES) return;
theApp.StopEffects();
theApp.ClearEffects();
theApp.DocTitle="Untitled.effects";
theApp.DocPath="";
theApp.RefreshAllWins();
theApp.StartEffects();
}
void CMainFrame::OnUpdateFileNew(CCmdUI* pCmdUI)
{
}
BOOL CMainFrame::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
void CMainFrame::OnEditDeleteeffect()
{
theApp.StopEffects();
theApp.EListWin->m_EffectList.DeleteSelectedEffect();
theApp.EListWin->Refresh();
theApp.StartEffects();
theApp.Modified=true;
}
void CMainFrame::OnFileLoadlastlibrary()
{
int res=IDYES;
if(theApp.Modified)
{
res=MessageBox("Unsaved Data... Do you really want to Load?","Quit Confirmation",MB_YESNO);
}
if(res!=IDYES) return;
CString LastLib=theApp.GetProfileString("PixelPro2000","LastLib");
if(LastLib.GetLength()>0)
LoadEffect(LastLib);
}
void CMainFrame::OnEditNeweffectNulleffect()
{
theApp.EListWin->m_EffectList.NewNullEffect();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::LoadEffect(CString &pathname)
{
CString wdir;
wdir=pathname.Left(pathname.ReverseFind('\\'));
SetCurrentDirectory(wdir);
theApp.StopEffects();
theApp.ClearEffects();
theApp.DocPath=pathname;
theApp.DocTitle=pathname.Right(pathname.GetLength()-pathname.ReverseFind('\\'));
theApp.WriteProfileString("PixelPro2000","LastLib",theApp.DocPath);
if(gosFX::EffectLibrary::Instance)
{
Unregister_Object(gosFX::EffectLibrary::Instance);
delete gosFX::EffectLibrary::Instance;
}
gos_PushCurrentHeap(gosFX::Heap);
gosFX::EffectLibrary::Instance = new PP2KEffectLibrary;
Register_Object(gosFX::EffectLibrary::Instance);
//----------------------
// Read it in from disk
//----------------------
if(theApp.fx_stream!=NULL) delete theApp.fx_stream;
Check_Object(Stuff::FileStreamManager::Instance);
theApp.fx_stream=new Stuff::FileStream((LPCSTR)theApp.DocPath);
gosFX::EffectLibrary::Instance->Load(theApp.fx_stream);
gos_PopCurrentHeap();
theApp.Modified=false;
theApp.RefreshAllWins();
MidLevelRenderer::MLRTexturePool::Instance->LoadImages();
theApp.TranslateTextureNames();
//Fix Effects if Bad
int effnum;
for(effnum=0;effnum<gosFX::EffectLibrary::Instance->m_effects.GetLength();effnum++)
{
gosFX::EffectLibrary::Instance->m_effects[effnum]->IsDataValid(true);
}
theApp.VerifyEffectLib();
theApp.StartEffects();
}
void CMainFrame::OnFileImport()
{
CFileDialog dlg1(TRUE,"effects",NULL,NULL,"Effects (*.effects)|*.effects||",this);
if(dlg1.DoModal()==IDOK)
{
ImportEffects(dlg1.GetPathName());
}
}
void CMainFrame::ImportEffects(CString &pathname)
{
theApp.StopEffects();
Verify(gosFX::EffectLibrary::Instance);
gos_PushCurrentHeap(gosFX::Heap);
Check_Object(Stuff::FileStreamManager::Instance);
Stuff::FileStream *gfx_file=new Stuff::FileStream((LPCSTR)pathname);
gosFX::EffectLibrary::Instance->Load(gfx_file);
gos_PopCurrentHeap();
theApp.VerifyEffectLib();
theApp.Modified=true;
theApp.RefreshAllWins();
MidLevelRenderer::MLRTexturePool::Instance->LoadImages();
theApp.StartEffects();
}
void CMainFrame::OnEditNeweffectBeam()
{
theApp.EListWin->m_EffectList.NewBeam();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnEditNeweffectCloudsSpritecloud()
{
theApp.EListWin->m_EffectList.NewSpriteCloud();
theApp.RefreshAllWins();
theApp.Modified=true;
}
void CMainFrame::OnTimer(UINT nIDEvent)
{
if(theApp.EListWin)
theApp.EListWin->m_EffectList.UpdatePlayIcons();
CMDIFrameWnd::OnTimer(nIDEvent);
}
void CMainFrame::OnFileExportcurrenteffect()
{
CFileDialog dlg1(FALSE,"effects","export.effects",NULL,"Effects (*.effects)|*.effects||",this);
gos_PushCurrentHeap(gosFX::Heap);
if(dlg1.DoModal()==IDOK)
{
gosFX::EffectLibrary *templib=new PP2KEffectLibrary;
theApp.EListWin->m_EffectList.MakeAllNamesUnique();
theApp.EListWin->m_EffectList.CopySelectedIntoLib(templib);
Stuff::FileStream gfx_file((char *)(LPCSTR)dlg1.GetPathName(), Stuff::FileStream::WriteOnly);
templib->Save(&gfx_file);
templib->m_effects.SetLength(0);
delete templib;
}
gos_PopCurrentHeap();
}
void CMainFrame::OnEditScaleeffect()
{
CScaleOpt dlg;
if(dlg.DoModal()==IDOK)
{
if(dlg.ScaleAll)
{
theApp.EListWin->m_EffectList.ScaleAllEffects(dlg.m_SFact,dlg.Brightness);
}
else
{
theApp.EListWin->m_EffectList.ScaleSelectedEffect(dlg.m_SFact,dlg.m_Recurse?true:false,dlg.Brightness);
}
if(theApp.ParamWin) theApp.ParamWin->Refresh();
if(theApp.CurveWin) theApp.CurveWin->m_wndView.Refresh();
}
}
@@ -0,0 +1,88 @@
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__EB0BEC34_635F_4703_AB3C_E3679AA0335A__INCLUDED_)
#define AFX_MAINFRM_H__EB0BEC34_635F_4703_AB3C_E3679AA0335A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainFrame : public CMDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
//}}AFX_VIRTUAL
// Implementation
public:
void ImportEffects(CString &pathname);
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
void LoadEffect(CString &str);
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnClose();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnMove(int x, int y);
afx_msg void OnFileLoadeffect();
afx_msg void OnFileSaveeffect();
afx_msg void OnFileQuicksave();
afx_msg void OnUpdateFileQuicksave(CCmdUI* pCmdUI);
afx_msg void OnEditNeweffectCardcloud();
afx_msg void OnEditNeweffectPertcloud();
afx_msg void OnEditNeweffectPointcloud();
afx_msg void OnEditNeweffectShapecloud();
afx_msg void OnEditNeweffectShardcloud();
afx_msg void OnFileNew();
afx_msg void OnUpdateFileNew(CCmdUI* pCmdUI);
afx_msg void OnEditDeleteeffect();
afx_msg void OnEditNeweffectSingletonCard();
afx_msg void OnEditNeweffectSingletonShape();
afx_msg void OnEditNeweffectEffectcloud();
afx_msg void OnFileLoadlastlibrary();
afx_msg void OnEditNeweffectNulleffect();
afx_msg void OnEditNeweffectTube();
afx_msg void OnEditNeweffectDebriscloud();
afx_msg void OnEditNeweffectPointlight();
afx_msg void OnFileImport();
afx_msg void OnEditNeweffectBeam();
afx_msg void OnEditNeweffectSingletonFlare();
afx_msg void OnEditNeweffectCloudsSpritecloud();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnFileExportcurrenteffect();
afx_msg void OnEditScaleeffect();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__EB0BEC34_635F_4703_AB3C_E3679AA0335A__INCLUDED_)
@@ -0,0 +1,52 @@
// MoveProps.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "MoveProps.h"
/////////////////////////////////////////////////////////////////////////////
// CMoveProps dialog
CMoveProps::CMoveProps(CWnd* pParent /*=NULL*/)
: CDialog(CMoveProps::IDD, pParent)
{
//{{AFX_DATA_INIT(CMoveProps)
m_rtime = 0.0;
m_velx = 0.0f;
m_vely = 0.0f;
m_velz = 0.0f;
m_accy = 0.0f;
m_accx = 0.0f;
m_accz = 0.0f;
//}}AFX_DATA_INIT
}
void CMoveProps::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMoveProps)
DDX_Text(pDX, IDC_RTIME, m_rtime);
DDV_MinMaxDouble(pDX, m_rtime, 0., 9999999.);
DDX_Text(pDX, IDC_VELX, m_velx);
DDX_Text(pDX, IDC_VELY, m_vely);
DDX_Text(pDX, IDC_VELZ, m_velz);
DDX_Text(pDX, IDC_ACCY, m_accy);
DDX_Text(pDX, IDC_ACCX, m_accx);
DDX_Text(pDX, IDC_ACCZ, m_accz);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMoveProps, CDialog)
//{{AFX_MSG_MAP(CMoveProps)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMoveProps message handlers
@@ -0,0 +1,52 @@
#if !defined(AFX_MOVEPROPS_H__64FEEE81_6697_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_MOVEPROPS_H__64FEEE81_6697_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MoveProps.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CMoveProps dialog
class CMoveProps : public CDialog
{
// Construction
public:
CMoveProps(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CMoveProps)
enum { IDD = IDD_MOVEPROPS };
double m_rtime;
float m_velx;
float m_vely;
float m_velz;
float m_accy;
float m_accx;
float m_accz;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMoveProps)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CMoveProps)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MOVEPROPS_H__64FEEE81_6697_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,94 @@
// NumPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "NumPanel.h"
#include "CurveSet.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CNumPanel dialog
CNumPanel::CNumPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CNumPanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CNumPanel)
m_NumVal = 0;
//}}AFX_DATA_INIT
NeedUpdate=false;
}
void CNumPanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNumPanel)
DDX_Text(pDX, IDC_NUM, m_NumVal);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNumPanel, CDynaPanel)
//{{AFX_MSG_MAP(CNumPanel)
ON_EN_CHANGE(IDC_NUM, OnChangeNum)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNumPanel message handlers
void CNumPanel::UpdateControl()
{
m_NumVal=*intval;
UpdateData(FALSE);
}
void CNumPanel::Set(void *pt)
{
intval=(int *)pt;
}
void CNumPanel::OnChangeNum()
{
UpdateData(TRUE);
NeedUpdate=true;
SetTimer(1,1000,NULL);
}
BOOL CNumPanel::OnInitDialog()
{
CDynaPanel::OnInitDialog();
UpdateControl();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CNumPanel::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
if(NeedUpdate)
{
theApp.StopEffects();
int OldValue=*intval;
*intval=m_NumVal;
if(!MyCSet->IsDataValid())
{
*intval=m_NumVal=OldValue;
UpdateData(FALSE);
}
NeedUpdate=false;
theApp.StartEffects();
}
CDynaPanel::OnTimer(nIDEvent);
}
@@ -0,0 +1,54 @@
#if !defined(AFX_NUMPANEL_H__8B0E877C_8EA3_4068_9519_6EBF93C171F2__INCLUDED_)
#define AFX_NUMPANEL_H__8B0E877C_8EA3_4068_9519_6EBF93C171F2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// NumPanel.h : header file
//
#include "DynaPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CNumPanel dialog
class CNumPanel : public CDynaPanel
{
// Construction
public:
bool NeedUpdate;
CNumPanel(CWnd* pParent = NULL); // standard constructor
virtual void UpdateControl();
virtual void Set(void *pt);
virtual void OnCancel() {}
virtual void OnOK() {}
int *intval;
// Dialog Data
//{{AFX_DATA(CNumPanel)
enum { IDD = IDD_NUMPANEL };
int m_NumVal;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNumPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CNumPanel)
afx_msg void OnChangeNum();
virtual BOOL OnInitDialog();
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NUMPANEL_H__8B0E877C_8EA3_4068_9519_6EBF93C171F2__INCLUDED_)
@@ -0,0 +1,255 @@
#include "stdafx.h"
#include "PixelWhipPro.h"
#include "PP2KEffectLibrary.hpp"
#include <gosFX\DebrisCloud.hpp>
#include <Stuff\Stuff.hpp>
#include <MLR\MLRCulturShape.hpp>
using namespace Stuff;
extern CPixelWhipProApp theApp;
//------------------------------------------------------------------------------
//
PP2KEffectLibrary::PP2KEffectLibrary():
gosFX::EffectLibrary(),
m_shapeHash(23, NULL, true)
{
HintFile = new NotationFile(theApp.TexturePath+"Textures.hint");
}
//------------------------------------------------------------------------------
//
PP2KEffectLibrary::~PP2KEffectLibrary()
{
delete HintFile;
}
//------------------------------------------------------------------------------
//
MidLevelRenderer::MLRShape*
PP2KEffectLibrary::UseShape(Stuff::MString& shape_file)
{
Check_Object(this);
Check_Object(&shape_file);
Verify(shape_file);
//
//-------------------------------------------------------------------------
// If we can find the shape file already in our hash, return it immediately
//-------------------------------------------------------------------------
//
MidLevelRenderer::MLRShape *shape = m_shapeHash.Find(shape_file);
if (shape)
{
Check_Object(shape);
shape->AttachReference();
return shape;
}
FileStream *file_stream=new FileStream(shape_file);
//
//------------------------------------------------------------------------
// Now that we have the file loaded, make the shape out of it and stick it
// in the hash
//------------------------------------------------------------------------
//
int version = MidLevelRenderer::ReadMLRVersion(file_stream);
OBB obb;
*file_stream >> obb;
if(version<14)
{
shape = MidLevelRenderer::MLRShape::Make(file_stream, version);
Check_Object(shape);
}
else
{
RegisteredClass::ClassID class_id;
*file_stream >> class_id;
switch(class_id)
{
case MidLevelRenderer::MLRShapeClassID:
shape = MidLevelRenderer::MLRShape::Make(file_stream, version);
break;
case MidLevelRenderer::MLRCulturShapeClassID:
shape = MidLevelRenderer::MLRCulturShape::Make(file_stream, version);
break;
}
Check_Object(shape);
}
bool mod=false;
//Translate Textures here
MidLevelRenderer::MLRPrimitiveBase *primitive;
for(int prim=0;prim<shape->GetNum();prim++)
{
primitive = shape->Find(prim);
MidLevelRenderer::MLRState state = primitive->GetReferenceState();
CString tname(((*MidLevelRenderer::MLRTexturePool::Instance)[&state])->GetTextureName());
if(TranslateName(tname, *HintFile))
{
MidLevelRenderer::MLRTexture *tex = MidLevelRenderer::MLRTexturePool::Instance->Add((LPCSTR)tname);
state.SetTextureHandle(tex->GetTextureHandle());
primitive->SetReferenceState(state);
mod = true;
}
}
if(mod || version<18)
{
PAUSE(("%s has been modified and rewritten",(char *)shape_file));
FileStream *out_stream = new FileStream(shape_file);
out_stream->Open(shape_file, FileStream::WriteOnly);
MidLevelRenderer::WriteMLRVersion(out_stream);
*out_stream << obb;
shape->Save(out_stream);
out_stream->Close();
}
m_shapeHash.AddValue(shape, shape_file);
return shape;
}
//------------------------------------------------------------------------------
//
void
PP2KEffectLibrary::LoadDebrisArray(
gosFX::DebrisCloud__Specification *spec,
Stuff::MString& debris_file
)
{
Check_Object(this);
Check_Object(spec);
Check_Object(&debris_file);
Verify(debris_file);
FileStream *file_stream=new FileStream(debris_file);
//
//------------------------------
// Now start building the arrays
//------------------------------
//
int gosfx_version = gosFX::ReadGFXVersion(file_stream);
int mlr_version = MidLevelRenderer::ReadMLRVersion(file_stream);
unsigned debris_count;
*file_stream >> debris_count;
spec->m_debrisPieces.SetLength(debris_count);
spec->m_debrisPositions.SetLength(debris_count);
spec->m_debrisSpheres.SetLength(debris_count);
spec->m_debrisSeed.SetLength(debris_count);
//
//----------------------------------------------------------
// Load in each shape and calculate a decent bounding volume
//----------------------------------------------------------
//
Stuff::Scalar minRadius = 100000000000.0f, maxRadius = 0.0f;
bool mod=false;
unsigned i;
for(i=0;i<debris_count;i++)
{
*file_stream >> spec->m_debrisPositions[i];
*file_stream >> spec->m_debrisSpheres[i].center;
*file_stream >> spec->m_debrisSpheres[i].radius;
if(spec->m_debrisSpheres[i].radius < minRadius)
minRadius = spec->m_debrisSpheres[i].radius;
if(spec->m_debrisSpheres[i].radius > maxRadius)
maxRadius = spec->m_debrisSpheres[i].radius;
//
//---------------
// Load the shape
//---------------
//
if(mlr_version<14)
{
spec->m_debrisPieces[i] = MidLevelRenderer::MLRShape::Make(file_stream, mlr_version);
}
else
{
RegisteredClass::ClassID class_id;
*file_stream >> class_id;
switch(class_id)
{
case MidLevelRenderer::MLRShapeClassID:
spec->m_debrisPieces[i] = MidLevelRenderer::MLRShape::Make(file_stream, mlr_version);
break;
case MidLevelRenderer::MLRCulturShapeClassID:
spec->m_debrisPieces[i] = MidLevelRenderer::MLRCulturShape::Make(file_stream, mlr_version);
break;
}
}
Check_Object(spec->m_debrisPieces[i]);
//Translate Textures here
MidLevelRenderer::MLRPrimitiveBase *primitive;
for(int prim=0;prim<spec->m_debrisPieces[i]->GetNum();prim++)
{
primitive = spec->m_debrisPieces[i]->Find(prim);
MidLevelRenderer::MLRState state = primitive->GetReferenceState();
CString tname(((*MidLevelRenderer::MLRTexturePool::Instance)[&state])->GetTextureName());
if(TranslateName(tname, *HintFile))
{
MidLevelRenderer::MLRTexture *tex = MidLevelRenderer::MLRTexturePool::Instance->Add((LPCSTR)tname);
state.SetTextureHandle(tex->GetTextureHandle());
primitive->SetReferenceState(state);
mod = true;
}
}
}
Verify(maxRadius > minRadius);
for(i=0;i<debris_count;i++)
{
spec->m_debrisSeed[i] = (spec->m_debrisSpheres[i].radius-minRadius)/(maxRadius-minRadius);
}
if(mod || mlr_version<18)
{
PAUSE(("%s has been modified and rewritten",(char *)debris_file));
FileStream *out_stream = new FileStream(debris_file);
out_stream->Open(debris_file, FileStream::WriteOnly);
gosFX::WriteGFXVersion(out_stream);
MidLevelRenderer::WriteMLRVersion(out_stream);
*out_stream << debris_count;
for(i=0;i<debris_count;i++)
{
*out_stream << spec->m_debrisPositions[i];
*out_stream << spec->m_debrisSpheres[i].center;
*out_stream << spec->m_debrisSpheres[i].radius;
spec->m_debrisPieces[i]->Save(out_stream);
}
out_stream->Close();
}
}
@@ -0,0 +1,45 @@
//==========================================================================//
// File: EffectLibrary.hpp //
// Project: gosFX //
// Contents: Base Effect Component //
//--------------------------------------------------------------------------//
// Date Who Modification //
// 10/07/98 JMA Created //
// //
//--------------------------------------------------------------------------//
// Copyright (C) 1997-1998, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//==========================================================================//
#pragma once
#include <gosFX\EffectLibrary.hpp>
class PP2KEffectLibrary:
public gosFX::EffectLibrary
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Constructors/Destructors
//
public:
NotationFile *HintFile;
PP2KEffectLibrary();
~PP2KEffectLibrary();
//----------------------------------------------------------------------------
// Shape table
//
public:
MidLevelRenderer::MLRShape*
UseShape(Stuff::MString& shape_file);
void
LoadDebrisArray(
gosFX::DebrisCloud__Specification *spec,
Stuff::MString& debris_file
);
protected:
Stuff::HashOf<MidLevelRenderer::MLRShape*, Stuff::MString>
m_shapeHash;
};
@@ -0,0 +1,54 @@
// PP2KTexturePool.cpp: implementation of the PP2KTexturePool class.
//
//////////////////////////////////////////////////////////////////////
#include "PP2KTexturePool.h"
#include<Gameos\\Toolos.hpp>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
PP2KTexturePool::PP2KTexturePool(const char* path,const char* hint_file):TGAFilePool(path,hint_file)
{
HintFile=new NotationFile(texturePath+"Textures.hint");
}
bool PP2KTexturePool::LoadImageGOS(GOSImage *image, int t)
{
/*
MString full_name,file_name = texturePath;
file_name += image->imageName;
full_name =file_name;
full_name +=".png";
const char *tstr;
if(!gos_DoesFileExist(full_name))
{
full_name=file_name;
full_name += ".tga";
if(!gos_DoesFileExist(full_name))
{
Page *page=HintFile->FindPage(image->imageName);
if(page && page->GetEntry("alias",&tstr))
{
image->imageName=tstr;
}
else
{
}
}
}
*/
return TGAFilePool::LoadImageGOS(image,t);
}
PP2KTexturePool::~PP2KTexturePool()
{
delete HintFile;
}
@@ -0,0 +1,21 @@
#pragma once
#include<Stuff\\Stuff.hpp>
using namespace Stuff;
#include<MLR\MLR.hpp>
#include<MLR\\GosImage.hpp>
#include<MLR\\GosImagePool.hpp>
using namespace MidLevelRenderer;
class PP2KTexturePool: public MidLevelRenderer::TGAFilePool
{
protected:
NotationFile *HintFile;
public:
PP2KTexturePool(const char* path,const char* hint_file=NULL);
bool LoadImageGOS(GOSImage *image, int i);
~PP2KTexturePool();
};
@@ -0,0 +1,142 @@
// PPLightManager.cpp: implementation of the CPPLightManager class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "pixelwhippro.h"
#include "PPLightManager.h"
#include <MLR\MLR.hpp>
extern CPixelWhipProApp theApp;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CPPLightManager::CPPLightManager()
{
}
CPPLightManager::~CPPLightManager()
{
}
gosFX::Light *CPPLightManager::MakePointLight(const char* light_map, bool light_vertex)
{
int i;
for(i=0;i<MidLevelRenderer::Limits::Max_Number_Of_Lights_Per_Primitive && theApp.LightState->m_lights[i];i++)
{
}
MidLevelRenderer::MLRPointLight *new_light;
gos_PushCurrentHeap(MidLevelRenderer::LightsHeap);
new_light=new MidLevelRenderer::MLRPointLight;
if(i<MidLevelRenderer::Limits::Max_Number_Of_Lights_Per_Primitive)
theApp.LightState->m_lights[i]=new_light;
MString name = light_map;
if(name)
{
Check_Object(MidLevelRenderer::MLRTexturePool::Instance);
MidLevelRenderer::MLRTexture *texture =
(*MidLevelRenderer::MLRTexturePool::Instance)(name, 0);
if (!texture)
texture = MidLevelRenderer::MLRTexturePool::Instance->Add(name, 0);
Check_Object(texture);
MidLevelRenderer::MLRLightMap *map = new MidLevelRenderer::MLRLightMap(texture);
Check_Object(map);
new_light->SetLightMap(map);
if (!light_vertex)
{
int mask = new_light->GetLightMask();
mask &= ~MidLevelRenderer::MLRState::VertexLightingMode;
new_light->SetLightMask(mask);
}
}
gos_PopCurrentHeap();
return (gosFX::Light *)new_light;
}
void CPPLightManager::ChangeLight(gosFX::Light *light,Info *info)
{
MidLevelRenderer::MLRLight *mlght=(MidLevelRenderer::MLRLight *)light;
switch(mlght->GetLightType())
{
case MidLevelRenderer::MLRLight::AmbientLight:
{
MidLevelRenderer::MLRAmbientLight *tlght=(MidLevelRenderer::MLRAmbientLight *)light;
}
break;
case MidLevelRenderer::MLRLight::InfiniteLight:
{
MidLevelRenderer::MLRInfiniteLight *tlght=(MidLevelRenderer::MLRInfiniteLight *)light;
}
break;
case MidLevelRenderer::MLRLight::InfiniteLightWithFallOff:
{
MidLevelRenderer::MLRInfiniteLightWithFalloff *tlght=(MidLevelRenderer::MLRInfiniteLightWithFalloff *)light;
tlght->SetFalloffDistance(info->m_inner,info->m_outer);
}
break;
case MidLevelRenderer::MLRLight::PointLight:
{
MidLevelRenderer::MLRPointLight *tlght=(MidLevelRenderer::MLRPointLight *)light;
tlght->SetFalloffDistance(info->m_inner,info->m_outer);
tlght->SetLightToWorldMatrix(info->m_origin);
}
break;
case MidLevelRenderer::MLRLight::SpotLight:
{
MidLevelRenderer::MLRSpotLight *tlght=(MidLevelRenderer::MLRSpotLight *)light;
tlght->SetSpreadAngle(info->m_spread);
tlght->SetFalloffDistance(info->m_inner,info->m_outer);
tlght->SetLightToWorldMatrix(info->m_origin);
}
break;
case MidLevelRenderer::MLRLight::LookUpLight:
{
MidLevelRenderer::MLRLookUpLight *tlght=(MidLevelRenderer::MLRLookUpLight *)light;
}
break;
}
mlght->SetColor(info->m_color);
mlght->SetIntensity(info->m_intensity);
}
void CPPLightManager::DeleteLight(gosFX::Light *light)
{
MidLevelRenderer::MLRLight *mlght=(MidLevelRenderer::MLRLight *)light;
int lidx,i;
for(lidx=0;
theApp.LightState->m_lights[lidx]!=mlght && lidx<MidLevelRenderer::Limits::Max_Number_Of_Lights_Per_Primitive;
lidx++)
{
}
if(lidx<MidLevelRenderer::Limits::Max_Number_Of_Lights_Per_Primitive)
{
for(i=lidx;i<MidLevelRenderer::Limits::Max_Number_Of_Lights_Per_Primitive-1;i++)
{
theApp.LightState->m_lights[i]=theApp.LightState->m_lights[i+1];
}
theApp.LightState->m_lights[MidLevelRenderer::Limits::Max_Number_Of_Lights_Per_Primitive-1]=NULL;
}
gos_PushCurrentHeap(MidLevelRenderer::LightsHeap);
delete mlght;
gos_PopCurrentHeap();
}
@@ -0,0 +1,23 @@
// PPLightManager.h: interface for the CPPLightManager class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_PPLIGHTMANAGER_H__EC0D0461_AEEB_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_PPLIGHTMANAGER_H__EC0D0461_AEEB_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <GosFx\GosFx.hpp>
class CPPLightManager : public gosFX::LightManager
{
public:
CPPLightManager();
virtual ~CPPLightManager();
gosFX::Light *MakePointLight(const char* light_map=NULL,bool light_vertex=true);
void ChangeLight(gosFX::Light *light,Info *info);
void DeleteLight(gosFX::Light *light);
};
#endif // !defined(AFX_PPLIGHTMANAGER_H__EC0D0461_AEEB_11D3_8B36_00902712C9AE__INCLUDED_)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,657 @@
# Microsoft Developer Studio Project File - Name="PixelWhipPro" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=PixelWhipPro - Win32 Armor
!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 "PixelWhipPro.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 "PixelWhipPro.mak" CFG="PixelWhipPro - Win32 Armor"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "PixelWhipPro - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "PixelWhipPro - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "PixelWhipPro - Win32 Profile" (based on "Win32 (x86) Application")
!MESSAGE "PixelWhipPro - Win32 Armor" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "PixelWhipPro - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../rel.bin"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /Zi /Ox /Ot /Oa /Og /Oi /Gy /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 Ws2_32.lib /nologo /subsystem:windows /debug /machine:I386
!ELSEIF "$(CFG)" == "PixelWhipPro - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../dbg.bin"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /G6 /Zp4 /MDd /W3 /GR /GX /Zi /Od /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "_ARMOR" /D "LAB_ONLY" /D "USE_PROTOTYPES" /D "STRICT" /FR /FD /GZ /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 Ws2_32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ELSEIF "$(CFG)" == "PixelWhipPro - Win32 Profile"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "PixelWhipPro___Win32_Profile"
# PROP BASE Intermediate_Dir "PixelWhipPro___Win32_Profile"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../pro.bin"
# PROP Intermediate_Dir "Profile"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /Zp4 /MD /W3 /Zi /Ox /Ot /Oa /Og /Oi /Gy /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /Zi /Ox /Ot /Oa /Og /Oi /Gy /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "LAB_ONLY" /D "NOMINMAX" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 Ws2_32.lib /nologo /subsystem:windows /debug /machine:I386
!ELSEIF "$(CFG)" == "PixelWhipPro - Win32 Armor"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "PixelWhipPro___Win32_Armor"
# PROP BASE Intermediate_Dir "PixelWhipPro___Win32_Armor"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../arm.bin"
# PROP Intermediate_Dir "Armor"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /Zp4 /MDd /W3 /GR /ZI /Od /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "_ARMOR" /D "LAB_ONLY" /FR /FD /GZ /c
# SUBTRACT BASE CPP /YX /Yc /Yu
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /GR /Zi /Ox /Ot /Oa /Og /Oi /Gy /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "_ARMOR" /D "LAB_ONLY" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 Ws2_32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "PixelWhipPro - Win32 Release"
# Name "PixelWhipPro - Win32 Debug"
# Name "PixelWhipPro - Win32 Profile"
# Name "PixelWhipPro - Win32 Armor"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\BlankPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\ChildFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\ChildView.cpp
# End Source File
# Begin Source File
SOURCE=.\CurveEditor.cpp
# End Source File
# Begin Source File
SOURCE=.\CurveEditorFrame.cpp
# End Source File
# Begin Source File
SOURCE=.\CurveSet.cpp
# End Source File
# Begin Source File
SOURCE=.\DataParamView.cpp
# End Source File
# Begin Source File
SOURCE=.\DVPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\DynaPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\EBFPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\EditMLRStateDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\EditMLRStatePanel.cpp
# End Source File
# Begin Source File
SOURCE=.\EffectEditWin.cpp
# End Source File
# Begin Source File
SOURCE=.\EffectListTreeCtrl.cpp
# End Source File
# Begin Source File
SOURCE=.\EffectListWin.cpp
# End Source File
# Begin Source File
SOURCE=.\EventProps.cpp
# End Source File
# Begin Source File
SOURCE=.\export.cpp
# End Source File
# Begin Source File
SOURCE=.\FloatPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\MainFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\MoveProps.cpp
# End Source File
# Begin Source File
SOURCE=.\NumPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\PixelWhipPro.cpp
# End Source File
# Begin Source File
SOURCE=.\PixelWhipPro.rc
# End Source File
# Begin Source File
SOURCE=.\Point3DPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\PP2KEffectLibrary.cpp
# End Source File
# Begin Source File
SOURCE=.\PP2KTexturePool.cpp
# End Source File
# Begin Source File
SOURCE=.\PPLightManager.cpp
# End Source File
# Begin Source File
SOURCE=.\ProfilePanel.cpp
# End Source File
# Begin Source File
SOURCE=.\ScaleOpt.cpp
# End Source File
# Begin Source File
SOURCE=.\ShapeCloudPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\ShapePanel.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# Begin Source File
SOURCE=.\TextPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\TextureBrowser.cpp
# End Source File
# Begin Source File
SOURCE=.\TexturePanel.cpp
# End Source File
# Begin Source File
SOURCE=.\TexturePanel2.cpp
# End Source File
# Begin Source File
SOURCE=.\TFPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\TFResetPanel.cpp
# End Source File
# Begin Source File
SOURCE=.\TreeCtrlPro.cpp
# End Source File
# Begin Source File
SOURCE=.\TreeParamView.cpp
# End Source File
# Begin Source File
SOURCE=.\View3DChildWindow.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\BlankPanel.h
# End Source File
# Begin Source File
SOURCE=.\ChildFrm.h
# End Source File
# Begin Source File
SOURCE=.\ChildView.h
# End Source File
# Begin Source File
SOURCE=.\CurveEditor.h
# End Source File
# Begin Source File
SOURCE=.\CurveEditorFrame.h
# End Source File
# Begin Source File
SOURCE=.\CurveSet.h
# End Source File
# Begin Source File
SOURCE=.\DataParamView.h
# End Source File
# Begin Source File
SOURCE=.\DVPanel.h
# End Source File
# Begin Source File
SOURCE=.\DynaPanel.h
# End Source File
# Begin Source File
SOURCE=.\EBFPanel.h
# End Source File
# Begin Source File
SOURCE=.\EditMLRStateDlg.h
# End Source File
# Begin Source File
SOURCE=.\EditMLRStatePanel.h
# End Source File
# Begin Source File
SOURCE=.\EffectEditWin.h
# End Source File
# Begin Source File
SOURCE=.\EffectListTreeCtrl.h
# End Source File
# Begin Source File
SOURCE=.\EffectListWin.h
# End Source File
# Begin Source File
SOURCE=.\EventProps.h
# End Source File
# Begin Source File
SOURCE=.\Export.h
# End Source File
# Begin Source File
SOURCE=.\FloatPanel.h
# End Source File
# Begin Source File
SOURCE=.\MainFrm.h
# End Source File
# Begin Source File
SOURCE=.\MoveProps.h
# End Source File
# Begin Source File
SOURCE=.\NumPanel.h
# End Source File
# Begin Source File
SOURCE=.\PixelWhipPro.h
# End Source File
# Begin Source File
SOURCE=.\Point3DPanel.h
# End Source File
# Begin Source File
SOURCE=.\PP2KEffectLibrary.hpp
# End Source File
# Begin Source File
SOURCE=.\PP2KTexturePool.h
# End Source File
# Begin Source File
SOURCE=.\PPLightManager.h
# End Source File
# Begin Source File
SOURCE=.\ProfilePanel.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\ScaleOpt.h
# End Source File
# Begin Source File
SOURCE=.\ShapeCloudPanel.h
# End Source File
# Begin Source File
SOURCE=.\ShapePanel.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\TextPanel.h
# End Source File
# Begin Source File
SOURCE=.\TextureBrowser.h
# End Source File
# Begin Source File
SOURCE=.\TexturePanel.h
# End Source File
# Begin Source File
SOURCE=.\TexturePanel2.h
# End Source File
# Begin Source File
SOURCE=.\TFPanel.h
# End Source File
# Begin Source File
SOURCE=.\TFResetPanel.h
# End Source File
# Begin Source File
SOURCE=.\TreeCtrlPro.h
# End Source File
# Begin Source File
SOURCE=.\TreeParamView.h
# End Source File
# Begin Source File
SOURCE=.\View3DChildWindow.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\bmp00001.bmp
# End Source File
# Begin Source File
SOURCE=.\res\bmp00002.bmp
# End Source File
# Begin Source File
SOURCE=.\res\card.ico
# End Source File
# Begin Source File
SOURCE=.\res\card1.ico
# End Source File
# Begin Source File
SOURCE=.\res\cardclou.ico
# End Source File
# Begin Source File
SOURCE=.\res\debriscl.ico
# End Source File
# Begin Source File
SOURCE=.\res\flare1.ico
# End Source File
# Begin Source File
SOURCE=.\res\ico00001.ico
# End Source File
# Begin Source File
SOURCE=.\res\ico00002.ico
# End Source File
# Begin Source File
SOURCE=.\res\ico00003.ico
# End Source File
# Begin Source File
SOURCE=.\res\ico00004.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon1.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon10.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon11.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon13.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon2.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon4.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon5.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon6.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon7.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon8.ico
# End Source File
# Begin Source File
SOURCE=.\res\icon9.ico
# End Source File
# Begin Source File
SOURCE=.\res\laser1.ico
# End Source File
# Begin Source File
SOURCE=.\res\lights.ico
# End Source File
# Begin Source File
SOURCE=.\res\null.ico
# End Source File
# Begin Source File
SOURCE=.\res\null1.ico
# End Source File
# Begin Source File
SOURCE=.\res\pertclou.ico
# End Source File
# Begin Source File
SOURCE=.\res\PixelWhipPro.ico
# End Source File
# Begin Source File
SOURCE=.\res\PixelWhipPro.rc2
# End Source File
# Begin Source File
SOURCE=.\res\play.ico
# End Source File
# Begin Source File
SOURCE=.\res\play1.ico
# End Source File
# Begin Source File
SOURCE=.\res\pointclo.ico
# End Source File
# Begin Source File
SOURCE=.\res\PPro2K_8.bmp
# End Source File
# Begin Source File
SOURCE=.\res\shape1.ico
# End Source File
# Begin Source File
SOURCE=.\res\shape2.ico
# End Source File
# Begin Source File
SOURCE=.\res\shapeclo.ico
# End Source File
# Begin Source File
SOURCE=.\res\shardclo.ico
# End Source File
# Begin Source File
SOURCE=.\res\Toolbar.bmp
# End Source File
# Begin Source File
SOURCE=.\res\toolbar1.bmp
# End Source File
# Begin Source File
SOURCE=.\res\tube1.ico
# End Source File
# Begin Source File
SOURCE=.\res\tube2.ico
# End Source File
# End Group
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project
@@ -0,0 +1,155 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "DLLPlatform"=..\..\..\CORETECH\Libraries\DLLPlatform\DLLPlatform.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "ElementRenderer"=..\..\Libraries\ElementRenderer\ElementRenderer.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name stlport
End Project Dependency
}}}
###############################################################################
Project: "GameOS"=..\..\..\CORETECH\Libraries\GameOS\GameOS.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "MFCPlatform"=..\..\..\CORETECH\Libraries\MFCPlatform\MFCPlatform.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "MLR"=..\..\Libraries\MLR\MLR.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "PixelWhipPro"=.\PixelWhipPro.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name ElementRenderer
End Project Dependency
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name gosFX
End Project Dependency
Begin Project Dependency
Project_Dep_Name MFCPlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name MLR
End Project Dependency
Begin Project Dependency
Project_Dep_Name Stuff
End Project Dependency
Begin Project Dependency
Project_Dep_Name stlport
End Project Dependency
}}}
###############################################################################
Project: "Stuff"=..\..\Libraries\Stuff\Stuff.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name stlport
End Project Dependency
}}}
###############################################################################
Project: "gosFX"=..\..\Libraries\gosfx\gosFX.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name stlport
End Project Dependency
}}}
###############################################################################
Project: "stlport"=..\..\Libraries\stlport\stlport.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,142 @@
// PixelWhipPro.h : main header file for the PIXELWHIPPRO application
//
#if !defined(AFX_PIXELWHIPPRO_H__9AA88D96_64FF_4069_9FC5_BC4B067F97C7__INCLUDED_)
#define AFX_PIXELWHIPPRO_H__9AA88D96_64FF_4069_9FC5_BC4B067F97C7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
//#include <Adept\Zone.hpp>
using namespace ElementRenderer;
using namespace Stuff;
/////////////////////////////////////////////////////////////////////////////
// CPixelWhipProApp:
// See PixelWhipPro.cpp for the implementation of this class
//
#define BADINDEX 9999
class CView3DChildWindow;
class CEffectListWin;
class CEffectEditWin;
class CCurveEditorFrame;
class CPixelWhipProApp : public CWinApp
{
public:
CPixelWhipProApp();
~CPixelWhipProApp();
CView3DChildWindow *Window3D;
CEffectListWin *EListWin;
CEffectEditWin *ParamWin;
CCurveEditorFrame *CurveWin;
CString DocTitle,DocPath;
//Adept::Zone *TerrainZone;
ElementRenderer::GroupElement *TerrainGrid;
ElementRenderer::Element *SceneBackground;
ElementRenderer::StateChange *LightState;
Point3D TargetLoc;
Stuff::FileStream *fx_stream;
MidLevelRenderer::MLRState FireState,SmokeState;
bool GOSActive;
bool AllowDraw;
bool Modified;
bool RegNoWrite;
bool Looping;
unsigned long int SpaceFlag;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPixelWhipProApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
virtual BOOL OnIdle(LONG lCount);
//}}AFX_VIRTUAL
// Implementation
protected:
// HMENU m_hMDIMenu;
HACCEL m_hMDIAccel;
public:
void Set3DWindowTitle();
CString LightFilePath,TerrainFilePath,BackGroundFilePath;
void LoadLights(CString light_file_name);
void LoadTerrain(CString terrain_file_name);
void LoadBackground(CString background_file_name);
void SaveWorkSpaceInfo();
void FixEffectNameTable();
void VerifyEffectLib();
bool CurrentFXIsValid();
void TranslateTextureNames();
Stuff::Scalar GetEffectDistance();
void ClearEffects();
void StartEffects();
void StopEffects();
void LoadWindowStates();
void SaveWindowStates();
void RefreshAllWins();
void NewTexturePath();
CString TexturePath;
void GetTexturePath();
void GOSCleanUp();
//{{AFX_MSG(CPixelWhipProApp)
afx_msg void OnAppAbout();
afx_msg void OnFileLoadscenebackground();
afx_msg void OnFileClearscenebackground();
afx_msg void OnFileExport();
afx_msg void OnOptionsSettexturepath();
afx_msg void OnWindowsCurveeditor();
afx_msg void OnWindowsEffectlistwindow();
afx_msg void OnWindowsEffectparameterwindow();
afx_msg void OnUpdateWindowsCurveeditor(CCmdUI* pCmdUI);
afx_msg void OnUpdateWindowsEffectlistwindow(CCmdUI* pCmdUI);
afx_msg void OnUpdateWindowsEffectparameterwindow(CCmdUI* pCmdUI);
afx_msg void OnViewRestartplayback();
afx_msg void OnViewLooping();
afx_msg void OnViewDynamicworldspace();
afx_msg void OnViewLocalspace();
afx_msg void OnViewStaticworldspace();
afx_msg void OnUpdateViewStaticworldspace(CCmdUI* pCmdUI);
afx_msg void OnUpdateViewLooping(CCmdUI* pCmdUI);
afx_msg void OnUpdateViewLocalspace(CCmdUI* pCmdUI);
afx_msg void OnUpdateViewDynamicworldspace(CCmdUI* pCmdUI);
afx_msg void OnViewMovementoptions();
afx_msg void OnViewMoveeffect();
afx_msg void OnUpdateViewMoveeffect(CCmdUI* pCmdUI);
afx_msg void OnOptionsClearregistry();
afx_msg void OnViewResetcamera();
afx_msg void OnOptionsSettofire();
afx_msg void OnOptionsSettosmoke();
afx_msg void OnOptionsEditfirequickset();
afx_msg void OnOptionsEditsmokequickset();
afx_msg void OnFileLoadterrain();
afx_msg void OnFileClearterrain();
afx_msg void OnFileLoadlights();
afx_msg void OnFileClearlights();
afx_msg void OnFileLoadlastworkspace();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
bool TranslateName(CString &str,NotationFile &hint_file);
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PIXELWHIPPRO_H__9AA88D96_64FF_4069_9FC5_BC4B067F97C7__INCLUDED_)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,84 @@
// Point3DPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "Point3DPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CPoint3DPanel dialog
CPoint3DPanel::CPoint3DPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CPoint3DPanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CPoint3DPanel)
m_xp = 0.0f;
m_yp = 0.0f;
m_zp = 0.0f;
//}}AFX_DATA_INIT
}
void CPoint3DPanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPoint3DPanel)
DDX_Text(pDX, IDC_XNUM, m_xp);
DDX_Text(pDX, IDC_YNUM, m_yp);
DDX_Text(pDX, IDC_ZNUM, m_zp);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPoint3DPanel, CDynaPanel)
//{{AFX_MSG_MAP(CPoint3DPanel)
ON_EN_CHANGE(IDC_XNUM, OnChangeXnum)
ON_EN_CHANGE(IDC_YNUM, OnChangeYnum)
ON_EN_CHANGE(IDC_ZNUM, OnChangeZnum)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPoint3DPanel message handlers
void CPoint3DPanel::UpdateControl()
{
m_xp=Pnt->x;
m_yp=Pnt->y;
m_zp=Pnt->z;
UpdateData(FALSE);
}
void CPoint3DPanel::Set(void *pt)
{
Pnt=(Stuff::Point3D *)pt;
}
void CPoint3DPanel::OnChangeXnum()
{
UpdateData(TRUE);
Pnt->x=m_xp;
}
void CPoint3DPanel::OnChangeYnum()
{
UpdateData(TRUE);
Pnt->y=m_yp;
}
void CPoint3DPanel::OnChangeZnum()
{
UpdateData(TRUE);
Pnt->z=m_zp;
}
@@ -0,0 +1,58 @@
#if !defined(AFX_POINT3DPANEL_H__E0DB7F42_7593_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_POINT3DPANEL_H__E0DB7F42_7593_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Point3DPanel.h : header file
//
#include <Stuff\Stuff.hpp>
#include "DynaPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CPoint3DPanel dialog
class CPoint3DPanel : public CDynaPanel
{
// Construction
public:
CPoint3DPanel(CWnd* pParent = NULL); // standard constructor
virtual void UpdateControl();
virtual void Set(void *pt);
virtual void OnCancel() {}
virtual void OnOK() {}
Stuff::Point3D *Pnt;
// Dialog Data
//{{AFX_DATA(CPoint3DPanel)
enum { IDD = IDD_POINT3DPANEL };
float m_xp;
float m_yp;
float m_zp;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPoint3DPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPoint3DPanel)
afx_msg void OnChangeXnum();
afx_msg void OnChangeYnum();
afx_msg void OnChangeZnum();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_POINT3DPANEL_H__E0DB7F42_7593_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,129 @@
// ProfilePanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "ProfilePanel.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CProfilePanel dialog
CProfilePanel::CProfilePanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CProfilePanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CProfilePanel)
m_PrfPan = -1;
//}}AFX_DATA_INIT
}
void CProfilePanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProfilePanel)
DDX_CBIndex(pDX, IDC_PRF, m_PrfPan);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CProfilePanel, CDynaPanel)
//{{AFX_MSG_MAP(CProfilePanel)
ON_CBN_SELCHANGE(IDC_PRF, OnSelchangePrf)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProfilePanel message handlers
void CProfilePanel::Set(void *dat)
{
gosFX::Effect::Specification *espec=(gosFX::Effect::Specification *)dat;
tspec=NULL;
bspec=NULL;
switch(espec->GetClassID())
{
case gosFX::TubeClassID:
tspec=(gosFX::Tube__Specification *)dat;
break;
case gosFX::BeamClassID:
bspec=(gosFX::Beam__Specification *)dat;
break;
}
if(tspec)
switch(tspec->m_profileType)
{
case gosFX::Tube__Specification::e_Ribbon : m_PrfPan=0; break;
case gosFX::Tube__Specification::e_VerticalRibbon : m_PrfPan=1; break;
case gosFX::Tube__Specification::e_Triangle: m_PrfPan=2; break;
case gosFX::Tube__Specification::e_Square: m_PrfPan=3; break;
case gosFX::Tube__Specification::e_Cross: m_PrfPan=4; break;
case gosFX::Tube__Specification::e_Pentagon: m_PrfPan=5; break;
case gosFX::Tube__Specification::e_Hexagon: m_PrfPan=6; break;
case gosFX::Tube__Specification::e_AlignedRibbon: m_PrfPan=7; break;
}
if(bspec)
switch(bspec->m_profileType)
{
case gosFX::Beam__Specification::e_Ribbon : m_PrfPan=0; break;
case gosFX::Beam__Specification::e_VerticalRibbon : m_PrfPan=1; break;
case gosFX::Beam__Specification::e_Triangle: m_PrfPan=2; break;
case gosFX::Beam__Specification::e_Square: m_PrfPan=3; break;
case gosFX::Beam__Specification::e_Cross: m_PrfPan=4; break;
case gosFX::Beam__Specification::e_Pentagon: m_PrfPan=5; break;
case gosFX::Beam__Specification::e_Hexagon: m_PrfPan=6; break;
case gosFX::Beam__Specification::e_AlignedRibbon: m_PrfPan=7; break;
}
}
void CProfilePanel::OnSelchangePrf()
{
UpdateData(TRUE);
theApp.StopEffects();
if(tspec)
{
switch(m_PrfPan)
{
case 0: tspec->m_profileType=gosFX::Tube__Specification::e_Ribbon ; break;
case 1: tspec->m_profileType=gosFX::Tube__Specification::e_VerticalRibbon ; break;
case 2: tspec->m_profileType=gosFX::Tube__Specification::e_Triangle; break;
case 3: tspec->m_profileType=gosFX::Tube__Specification::e_Square; break;
case 4: tspec->m_profileType=gosFX::Tube__Specification::e_Cross; break;
case 5: tspec->m_profileType=gosFX::Tube__Specification::e_Pentagon; break;
case 6: tspec->m_profileType=gosFX::Tube__Specification::e_Hexagon; break;
case 7: tspec->m_profileType=gosFX::Tube__Specification::e_AlignedRibbon; break;
}
tspec->BuildTemplate();
}
if(bspec)
{
switch(m_PrfPan)
{
case 0: bspec->m_profileType=gosFX::Beam__Specification::e_Ribbon ; break;
case 1: bspec->m_profileType=gosFX::Beam__Specification::e_VerticalRibbon ; break;
case 2: bspec->m_profileType=gosFX::Beam__Specification::e_Triangle; break;
case 3: bspec->m_profileType=gosFX::Beam__Specification::e_Square; break;
case 4: bspec->m_profileType=gosFX::Beam__Specification::e_Cross; break;
case 5: bspec->m_profileType=gosFX::Beam__Specification::e_Pentagon; break;
case 6: bspec->m_profileType=gosFX::Beam__Specification::e_Hexagon; break;
case 7: bspec->m_profileType=gosFX::Beam__Specification::e_AlignedRibbon; break;
}
bspec->BuildTemplate();
}
theApp.StartEffects();
}
@@ -0,0 +1,57 @@
#if !defined(AFX_PROFILEPANEL_H__6B479001_6D11_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_PROFILEPANEL_H__6B479001_6D11_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ProfilePanel.h : header file
//
#include "DynaPanel.h"
#include <GosFx\GosFx.hpp>
#include <GosFx\Tube.hpp>
#include <GosFx\Beam.hpp>
#include <GosFx\CardCloud.hpp>
/////////////////////////////////////////////////////////////////////////////
// CProfilePanel dialog
class CProfilePanel : public CDynaPanel
{
// Construction
public:
virtual void Set(void *dat);
CProfilePanel(CWnd* pParent = NULL); // standard constructor
virtual void OnCancel() {}
virtual void OnOK() {}
gosFX::Tube__Specification *tspec;
gosFX::Beam__Specification *bspec;
// Dialog Data
//{{AFX_DATA(CProfilePanel)
enum { IDD = IDD_PROFILEPANEL };
int m_PrfPan;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProfilePanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CProfilePanel)
afx_msg void OnSelchangePrf();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PROFILEPANEL_H__6B479001_6D11_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,102 @@
========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : PixelWhipPro
========================================================================
AppWizard has created this PixelWhipPro application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.
This file contains a summary of what you will find in each of the files that
make up your PixelWhipPro application.
PixelWhipPro.dsp
This file (the project file) contains information at the project level and
is used to build a single project or subproject. Other users can share the
project (.dsp) file, but they should export the makefiles locally.
PixelWhipPro.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CPixelWhipProApp application class.
PixelWhipPro.cpp
This is the main application source file that contains the application
class CPixelWhipProApp.
PixelWhipPro.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
PixelWhipPro.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.
res\PixelWhipPro.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file PixelWhipPro.rc.
res\PixelWhipPro.rc2
This file contains resources that are not edited by Microsoft
Visual C++. You should place all resources not editable by
the resource editor in this file.
/////////////////////////////////////////////////////////////////////////////
For the main frame window:
MainFrm.h, MainFrm.cpp
These files contain the frame class CMainFrame, which is derived from
CMDIFrameWnd and controls all MDI frame features.
res\Toolbar.bmp
This bitmap file is used to create tiled images for the toolbar.
The initial toolbar and status bar are constructed in the CMainFrame
class. Edit this toolbar bitmap using the resource editor, and
update the IDR_MAINFRAME TOOLBAR array in PixelWhipPro.rc to add
toolbar buttons.
/////////////////////////////////////////////////////////////////////////////
For the child frame window:
ChildFrm.h, ChildFrm.cpp
These files define and implement the CChildFrame class, which
supports the child windows in an MDI application.
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named PixelWhipPro.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC42XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC42DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system.
/////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,119 @@
// ScaleOpt.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "ScaleOpt.h"
/////////////////////////////////////////////////////////////////////////////
// CScaleOpt dialog
CScaleOpt::CScaleOpt(CWnd* pParent /*=NULL*/)
: CDialog(CScaleOpt::IDD, pParent)
{
//{{AFX_DATA_INIT(CScaleOpt)
m_Recurse = FALSE;
m_SFact = 1.0f;
//}}AFX_DATA_INIT
ScaleAll=false;
LastFact=m_SFact;
}
void CScaleOpt::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CScaleOpt)
DDX_Control(pDX, IDC_RECURSE, m_RBut);
DDX_Control(pDX, IDC_SCOPE, m_ScopeBut);
DDX_Control(pDX, IDC_SCALESPIN, m_ScaleSpin);
DDX_Check(pDX, IDC_RECURSE, m_Recurse);
DDX_Text(pDX, IDC_SFACT, m_SFact);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CScaleOpt, CDialog)
//{{AFX_MSG_MAP(CScaleOpt)
ON_NOTIFY(UDN_DELTAPOS, IDC_SCALESPIN, OnDeltaposScalespin)
ON_EN_CHANGE(IDC_SFACT, OnChangeSfact)
ON_BN_CLICKED(IDC_SCOPE, OnScope)
ON_BN_CLICKED(IDC_SELEFFECT, OnSeleffect)
ON_BN_CLICKED(IDC_ALLEFF, OnAlleff)
ON_EN_KILLFOCUS(IDC_SFACT, OnKillfocusSfact)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScaleOpt message handlers
void CScaleOpt::OnDeltaposScalespin(NMHDR* pNMHDR, LRESULT* pResult)
{
UpdateData(TRUE);
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
// TODO: Add your control notification handler code here
m_SFact*=(float)pow(2,-pNMUpDown->iDelta);
if(m_SFact<=0.0f)
{
m_SFact=0.001f;
}
UpdateData(FALSE);
*pResult = 0;
}
void CScaleOpt::OnChangeSfact()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
BOOL CScaleOpt::OnInitDialog()
{
CDialog::OnInitDialog();
CheckDlgButton(IDC_SELEFFECT,1);
CheckDlgButton(IDC_TYPE_SIZE,1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CScaleOpt::OnScope()
{
}
void CScaleOpt::OnSeleffect()
{
ScaleAll=false;
CheckDlgButton(IDC_SELEFFECT,1);
m_RBut.EnableWindow(TRUE);
}
void CScaleOpt::OnAlleff()
{
ScaleAll=true;
m_RBut.EnableWindow(FALSE);
}
void CScaleOpt::OnKillfocusSfact()
{
UpdateData(TRUE);
if(m_SFact<=0.0f)
{
m_SFact=LastFact;
UpdateData(FALSE);
}
LastFact=m_SFact;
}
void CScaleOpt::OnOK()
{
Brightness=IsDlgButtonChecked(IDC_BRIGHTNESS)?true:false;
CDialog::OnOK();
}
@@ -0,0 +1,59 @@
#if !defined(AFX_SCALEOPT_H__2809D6BA_2198_428A_BA11_EC83F6C0BBFA__INCLUDED_)
#define AFX_SCALEOPT_H__2809D6BA_2198_428A_BA11_EC83F6C0BBFA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ScaleOpt.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CScaleOpt dialog
class CScaleOpt : public CDialog
{
// Construction
public:
CScaleOpt(CWnd* pParent = NULL); // standard constructor
bool ScaleAll;
bool Brightness;
float LastFact;
// Dialog Data
//{{AFX_DATA(CScaleOpt)
enum { IDD = IDD_SCALEOPTIONS };
CButton m_RBut;
CButton m_ScopeBut;
CSpinButtonCtrl m_ScaleSpin;
BOOL m_Recurse;
float m_SFact;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CScaleOpt)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CScaleOpt)
afx_msg void OnDeltaposScalespin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnChangeSfact();
virtual BOOL OnInitDialog();
afx_msg void OnScope();
afx_msg void OnSeleffect();
afx_msg void OnAlleff();
afx_msg void OnKillfocusSfact();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCALEOPT_H__2809D6BA_2198_428A_BA11_EC83F6C0BBFA__INCLUDED_)
@@ -0,0 +1,73 @@
// ShapeCloudPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "ShapeCloudPanel.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CShapeCloudPanel dialog
CShapeCloudPanel::CShapeCloudPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CShapeCloudPanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CShapeCloudPanel)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CShapeCloudPanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CShapeCloudPanel)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CShapeCloudPanel, CDynaPanel)
//{{AFX_MSG_MAP(CShapeCloudPanel)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CShapeCloudPanel message handlers
void CShapeCloudPanel::Set(void *dat)
{
ShapeSpec=(gosFX::ShapeCloud__Specification *)dat;
}
void CShapeCloudPanel::OnBrowse()
{
CString doc_path=theApp.DocPath.Left(theApp.DocPath.ReverseFind('\\')),shape_path;
// if(doc_path.GetLength()==0) GetCurrentDirectory(doc_path);
SetCurrentDirectory(doc_path);
CFileDialog dlg1(TRUE,"mlr",NULL,OFN_NOCHANGEDIR,"MLR Geometry(*.mlr)|*.mlr||",this);
if(dlg1.DoModal()==IDOK)
{
shape_path=dlg1.GetPathName();
if(doc_path.GetLength()>shape_path.GetLength() ||
shape_path.Left(doc_path.GetLength()).CompareNoCase(doc_path)
)
{
MessageBox("Shape Path Error");
}
else
{
shape_path=shape_path.Mid(doc_path.GetLength()+1);
ShapeSpec->SetShape(MString(shape_path));
MidLevelRenderer::MLRTexturePool::Instance->LoadImages();
}
}
}
@@ -0,0 +1,54 @@
#if !defined(AFX_SHAPECLOUDPANEL_H__6FA1E0C7_1CBE_4649_A8FA_BB2EFA2BEB7B__INCLUDED_)
#define AFX_SHAPECLOUDPANEL_H__6FA1E0C7_1CBE_4649_A8FA_BB2EFA2BEB7B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ShapeCloudPanel.h : header file
//
#include "DynaPanel.h"
#include <MLR\MLR.hpp>
#include <GosFx\GosFx.hpp>
#include <GosFx\ShapeCloud.hpp>
/////////////////////////////////////////////////////////////////////////////
// CShapeCloudPanel dialog
class CShapeCloudPanel : public CDynaPanel
{
// Construction
public:
CShapeCloudPanel(CWnd* pParent = NULL); // standard constructor
virtual void Set(void *dat);
gosFX::ShapeCloud__Specification *ShapeSpec;
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CShapeCloudPanel)
enum { IDD = IDD_SHAPECLOUDPANEL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CShapeCloudPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CShapeCloudPanel)
afx_msg void OnBrowse();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SHAPECLOUDPANEL_H__6FA1E0C7_1CBE_4649_A8FA_BB2EFA2BEB7B__INCLUDED_)
@@ -0,0 +1,73 @@
// ShapePanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "ShapePanel.h"
#include <ElementRenderer\ElementRenderer.hpp>
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CShapePanel dialog
CShapePanel::CShapePanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CShapePanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CShapePanel)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CShapePanel::Set(void *dat)
{
ShapeSpec=(gosFX::Shape__Specification *)dat;
}
void CShapePanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CShapePanel)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CShapePanel, CDynaPanel)
//{{AFX_MSG_MAP(CShapePanel)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CShapePanel message handlers
void CShapePanel::OnBrowse()
{
CString doc_path=theApp.DocPath.Left(theApp.DocPath.ReverseFind('\\')),shape_path;
// if(doc_path.GetLength()==0) GetCurrentDirectory(doc_path);
SetCurrentDirectory(doc_path);
CFileDialog dlg1(TRUE,"mlr",NULL,OFN_NOCHANGEDIR,"MLR Geometry(*.mlr)|*.mlr||",this);
if(dlg1.DoModal()==IDOK)
{
shape_path=dlg1.GetPathName();
if(doc_path.GetLength()>shape_path.GetLength() ||
shape_path.Left(doc_path.GetLength()).CompareNoCase(doc_path)
)
{
MessageBox("Shape Path Error");
}
else
{
shape_path=shape_path.Mid(doc_path.GetLength()+1);
ShapeSpec->SetShape(MString(shape_path));
MidLevelRenderer::MLRTexturePool::Instance->LoadImages();
}
}
}
@@ -0,0 +1,55 @@
#if !defined(AFX_SHAPEPANEL_H__AD3A8504_006D_4CAF_94B5_754C35009E99__INCLUDED_)
#define AFX_SHAPEPANEL_H__AD3A8504_006D_4CAF_94B5_754C35009E99__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ShapePanel.h : header file
//
#include "DynaPanel.h"
#include <MLR\MLR.hpp>
#include <GosFx\GosFx.hpp>
#include <GosFx\Shape.hpp>
/////////////////////////////////////////////////////////////////////////////
// CShapePanel dialog
class CShapePanel : public CDynaPanel
{
// Construction
public:
CShapePanel(CWnd* pParent = NULL); // standard constructor
virtual void Set(void *dat);
gosFX::Shape__Specification *ShapeSpec;
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CShapePanel)
enum { IDD = IDD_SHAPEPANEL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CShapePanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CShapePanel)
afx_msg void OnBrowse();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SHAPEPANEL_H__AD3A8504_006D_4CAF_94B5_754C35009E99__INCLUDED_)
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// PixelWhipPro.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
@@ -0,0 +1,72 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__59C63849_0FB2_4393_A39A_DFBD718EEF1D__INCLUDED_)
#define AFX_STDAFX_H__59C63849_0FB2_4393_A39A_DFBD718EEF1D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <GameOS\ToolOS.hpp>
#include <Stuff\Stuff.hpp>
using namespace Stuff;
#include <MLR\MLR.hpp>
#include <MLR\MLRState.hpp>
#include <MLR\MLRTexturePool.hpp>
#include <MLR\MLRTexture.hpp>
#include <MLR\MLRPointLight.hpp>
#include <MLR\MLRLightMap.hpp>
#include <MLR\MLRAmbientLight.hpp>
#include <MLR\MLRInfiniteLight.hpp>
#include <MLR\MLRSpotLight.hpp>
#include <MLR\MLRLookUpLight.hpp>
using namespace MidLevelRenderer;
#include <GosFx\GosFx.hpp>
#include <GosFx\Effect.hpp>
#include <GosFx\EffectCloud.hpp>
#include <GosFx\CardCloud.hpp>
#include <GosFx\PertCloud.hpp>
#include <GosFx\PointCloud.hpp>
#include <GosFx\PointLight.hpp>
#include <GosFx\Tube.hpp>
#include <GosFx\Card.hpp>
#include <GosFx\Shape.hpp>
#include <GosFx\Beam.hpp>
#include <GosFx\Flare.hpp>
#include <GosFx\ShapeCloud.hpp>
#include <GosFx\ShardCloud.hpp>
#include <GosFx\SpriteCloud.hpp>
#include <GosFx\ShardCloud.hpp>
#include <GosFx\DebrisCloud.hpp>
#include <GosFx\EffectLibrary.hpp>
using namespace gosFX;
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\GosFxElement.hpp>
#include <ElementRenderer\CameraElement.hpp>
#include <ElementRenderer\StateChange.hpp>
#include <ElementRenderer\GroupElement.hpp>
using namespace ElementRenderer;
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__59C63849_0FB2_4393_A39A_DFBD718EEF1D__INCLUDED_)
@@ -0,0 +1,57 @@
// TFPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "TFPanel.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CTFPanel dialog
CTFPanel::CTFPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CTFPanel::IDD, pParent)
{
ActDat=NULL;
//{{AFX_DATA_INIT(CTFPanel)
m_tfcheck = FALSE;
//}}AFX_DATA_INIT
}
void CTFPanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTFPanel)
DDX_Check(pDX, IDC_TFCHECK, m_tfcheck);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTFPanel, CDynaPanel)
//{{AFX_MSG_MAP(CTFPanel)
ON_BN_CLICKED(IDC_TFCHECK, OnTfcheck)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTFPanel message handlers
void CTFPanel::Set(void *dat)
{
ActDat=(bool *)dat;
m_tfcheck=*ActDat;
}
void CTFPanel::OnTfcheck()
{
theApp.Modified=true;
if(ActDat==NULL) return;
UpdateData(TRUE);
*ActDat=m_tfcheck!=0;
}
@@ -0,0 +1,51 @@
#if !defined(AFX_TFPANEL_H__5B87CF43_B09D_4600_BB43_8E2A7FFDDC7C__INCLUDED_)
#define AFX_TFPANEL_H__5B87CF43_B09D_4600_BB43_8E2A7FFDDC7C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TFPanel.h : header file
//
#include "DynaPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CTFPanel dialog
class CTFPanel : public CDynaPanel
{
// Construction
public:
bool *ActDat;
virtual void Set(void *dat);
CTFPanel(CWnd* pParent = NULL); // standard constructor
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CTFPanel)
enum { IDD = IDD_TFPANEL };
BOOL m_tfcheck;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTFPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTFPanel)
afx_msg void OnTfcheck();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TFPANEL_H__5B87CF43_B09D_4600_BB43_8E2A7FFDDC7C__INCLUDED_)
@@ -0,0 +1,57 @@
// TFResetPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "TFResetPanel.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CTFResetPanel dialog
CTFResetPanel::CTFResetPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CTFResetPanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CTFResetPanel)
m_tfcheck = FALSE;
//}}AFX_DATA_INIT
}
void CTFResetPanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTFResetPanel)
DDX_Check(pDX, IDC_TFCHECK, m_tfcheck);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTFResetPanel, CDynaPanel)
//{{AFX_MSG_MAP(CTFResetPanel)
ON_BN_CLICKED(IDC_TFCHECK, OnTfcheck)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTFResetPanel message handlers
void CTFResetPanel::Set(void *dat)
{
ActDat=(bool *)dat;
m_tfcheck=*ActDat;
}
void CTFResetPanel::OnTfcheck()
{
theApp.StopEffects();
theApp.Modified=true;
if(ActDat==NULL) return;
UpdateData(TRUE);
*ActDat=m_tfcheck!=0;
theApp.StartEffects();
}
@@ -0,0 +1,51 @@
#if !defined(AFX_TFRESETPANEL_H__6B479002_6D11_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_TFRESETPANEL_H__6B479002_6D11_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TFResetPanel.h : header file
//
#include "DynaPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CTFResetPanel dialog
class CTFResetPanel : public CDynaPanel
{
// Construction
public:
bool *ActDat;
virtual void Set(void *dat);
CTFResetPanel(CWnd* pParent = NULL); // standard constructor
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CTFResetPanel)
enum { IDD = IDD_TFRESETPANEL };
BOOL m_tfcheck;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTFResetPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTFResetPanel)
afx_msg void OnTfcheck();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TFRESETPANEL_H__6B479002_6D11_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,51 @@
// TextPanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "TextPanel.h"
/////////////////////////////////////////////////////////////////////////////
// CTextPanel dialog
CTextPanel::CTextPanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CTextPanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CTextPanel)
m_Text = _T("");
//}}AFX_DATA_INIT
}
void CTextPanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTextPanel)
DDX_Text(pDX, IDC_TEXT, m_Text);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTextPanel, CDynaPanel)
//{{AFX_MSG_MAP(CTextPanel)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTextPanel message handlers
void CTextPanel::OnCancel()
{
}
void CTextPanel::OnOK()
{
}
void CTextPanel::Set(void *dat)
{
m_Text=CString((char *)dat);
}
@@ -0,0 +1,50 @@
#if !defined(AFX_TEXTPANEL_H__493AF3A3_6B97_4CF8_A304_41C5201BA2E6__INCLUDED_)
#define AFX_TEXTPANEL_H__493AF3A3_6B97_4CF8_A304_41C5201BA2E6__INCLUDED_
#include "DynaPanel.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TextPanel.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTextPanel dialog
class CTextPanel : public CDynaPanel
{
// Construction
public:
virtual void Set(void *dat);
CTextPanel(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTextPanel)
enum { IDD = IDD_TEXTHDR };
CString m_Text;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTextPanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTextPanel)
virtual void OnCancel();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEXTPANEL_H__493AF3A3_6B97_4CF8_A304_41C5201BA2E6__INCLUDED_)
@@ -0,0 +1,92 @@
// TextureBrowser.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "TextureBrowser.h"
/////////////////////////////////////////////////////////////////////////////
// CTextureBrowser dialog
extern CPixelWhipProApp theApp;
CTextureBrowser::CTextureBrowser(CWnd* pParent /*=NULL*/)
: CDialog(CTextureBrowser::IDD, pParent)
{
//{{AFX_DATA_INIT(CTextureBrowser)
m_TextureName = _T("");
//}}AFX_DATA_INIT
}
void CTextureBrowser::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTextureBrowser)
DDX_Control(pDX, IDC_TEXTURELIST, m_TListCtrl);
DDX_LBString(pDX, IDC_TEXTURELIST, m_TextureName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTextureBrowser, CDialog)
//{{AFX_MSG_MAP(CTextureBrowser)
ON_BN_CLICKED(IDC_NOTEXT, OnNotext)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTextureBrowser message handlers
BOOL CTextureBrowser::OnInitDialog()
{
CDialog::OnInitDialog();
CString InitalPath(theApp.TexturePath);
WIN32_FIND_DATA ffdat;
HANDLE fhnd;
fhnd=FindFirstFile(InitalPath+"\\*.png",&ffdat);
do
{
CString tnme;
tnme=ffdat.cFileName;
tnme=tnme.Left(tnme.GetLength()-4);
m_TListCtrl.AddString(tnme);
}
while(FindNextFile(fhnd,&ffdat)!=0);
fhnd=FindFirstFile(InitalPath+"\\*.tga",&ffdat);
do
{
CString tnme;
tnme=ffdat.cFileName;
tnme=tnme.Left(tnme.GetLength()-4);
if(LB_ERR==m_TListCtrl.FindString(-1,tnme))
m_TListCtrl.AddString(tnme);
}
while(FindNextFile(fhnd,&ffdat)!=0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CTextureBrowser::OnOK()
{
CDialog::OnOK();
}
void CTextureBrowser::OnNotext()
{
m_TextureName="";
CDialog::OnOK();
}
@@ -0,0 +1,49 @@
#if !defined(AFX_TEXTUREBROWSER_H__2596D8FA_6913_4643_AFE5_9201D0E0CFCB__INCLUDED_)
#define AFX_TEXTUREBROWSER_H__2596D8FA_6913_4643_AFE5_9201D0E0CFCB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TextureBrowser.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTextureBrowser dialog
class CTextureBrowser : public CDialog
{
// Construction
public:
CTextureBrowser(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTextureBrowser)
enum { IDD = IDD_TEXTUREBROWSE };
CListBox m_TListCtrl;
CString m_TextureName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTextureBrowser)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTextureBrowser)
virtual BOOL OnInitDialog();
virtual void OnOK();
afx_msg void OnNotext();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEXTUREBROWSER_H__2596D8FA_6913_4643_AFE5_9201D0E0CFCB__INCLUDED_)
@@ -0,0 +1,91 @@
// TexturePanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "TexturePanel.h"
#include "TextureBrowser.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CTexturePanel dialog
CTexturePanel::CTexturePanel(CWnd* pParent /*=NULL*/)
: CDynaPanel(CTexturePanel::IDD, pParent)
{
//{{AFX_DATA_INIT(CTexturePanel)
m_TextureName = _T("");
//}}AFX_DATA_INIT
}
void CTexturePanel::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTexturePanel)
DDX_Text(pDX, IDC_TEXTURENAME, m_TextureName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTexturePanel, CDynaPanel)
//{{AFX_MSG_MAP(CTexturePanel)
ON_BN_CLICKED(IDC_TEXTUREBROWSE, OnTexturebrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTexturePanel message handlers
void CTexturePanel::Set(void *dat)
{
CurrentEffect=(gosFX::Effect *)dat;
if(CurrentEffect)
{
gosFX::Effect::Specification *spec=CurrentEffect->GetSpecification();
Check_Object(spec);
if(spec->m_state.GetTextureHandle()!=0)
{
m_TextureName=((*MidLevelRenderer::MLRTexturePool::Instance)[&spec->m_state])->GetTextureName();
}
else
{
m_TextureName="No Texture";
}
}
}
void CTexturePanel::OnTexturebrowse()
{
CTextureBrowser dlg;
if(dlg.DoModal()==IDOK)
{
m_TextureName=dlg.m_TextureName;
theApp.Modified=true;
if(CurrentEffect)
{
gosFX::Effect::Specification *spec=CurrentEffect->GetSpecification();
Check_Object(spec);
/*
int PState=spec->m_state.GetRenderPermissionMask();
PState=PState&(~(MidLevelRenderer::MLRState::TextureMask));
spec->m_state.SetRenderPermissionMask(PState);
*/
MidLevelRenderer::MLRTexture *tex=MidLevelRenderer::MLRTexturePool::Instance->Add((LPCSTR)m_TextureName);
spec->m_state.SetTextureHandle(tex->GetTextureHandle());
MidLevelRenderer::MLRTexturePool::Instance->LoadImages();
}
UpdateData(FALSE);
}
}
@@ -0,0 +1,52 @@
#if !defined(AFX_TEXTUREPANEL_H__08C8EFB8_5CCB_4555_8A82_BBB0B7645C97__INCLUDED_)
#define AFX_TEXTUREPANEL_H__08C8EFB8_5CCB_4555_8A82_BBB0B7645C97__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TexturePanel.h : header file
//
#include "DynaPanel.h"
#include <GosFx\GosFx.hpp>
/////////////////////////////////////////////////////////////////////////////
// CTexturePanel dialog
class CTexturePanel : public CDynaPanel
{
// Construction
public:
virtual void Set(void *dat);
CTexturePanel(CWnd* pParent = NULL); // standard constructor
gosFX::Effect *CurrentEffect;
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CTexturePanel)
enum { IDD = IDD_TEXTUREPANEL };
CString m_TextureName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTexturePanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTexturePanel)
afx_msg void OnTexturebrowse();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEXTUREPANEL_H__08C8EFB8_5CCB_4555_8A82_BBB0B7645C97__INCLUDED_)
@@ -0,0 +1,63 @@
// TexturePanel.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "TexturePanel2.h"
#include "TextureBrowser.h"
extern CPixelWhipProApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CTexturePanel2 dialog
CTexturePanel2::CTexturePanel2(CWnd* pParent /*=NULL*/)
: CDynaPanel(CTexturePanel2::IDD, pParent)
{
//{{AFX_DATA_INIT(CTexturePanel2)
m_TextureName = _T("");
//}}AFX_DATA_INIT
}
void CTexturePanel2::DoDataExchange(CDataExchange* pDX)
{
CDynaPanel::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTexturePanel2)
DDX_Text(pDX, IDC_TEXTURENAME, m_TextureName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTexturePanel2, CDynaPanel)
//{{AFX_MSG_MAP(CTexturePanel2)
ON_BN_CLICKED(IDC_TEXTUREBROWSE, OnTexturebrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTexturePanel2 message handlers
void CTexturePanel2::Set(void *dat)
{
Str=(Stuff::MString *)dat;
m_TextureName=(char *)*Str;
}
void CTexturePanel2::OnTexturebrowse()
{
CTextureBrowser dlg;
if(dlg.DoModal()==IDOK)
{
m_TextureName=dlg.m_TextureName;
theApp.Modified=true;
*Str=(char *)(LPCSTR)m_TextureName;
UpdateData(FALSE);
}
}
@@ -0,0 +1,52 @@
// TexturePanel2.h: interface for the CTexturePanel2 class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TEXTUREPANEL2_H__6AC89241_8A2C_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_TEXTUREPANEL2_H__6AC89241_8A2C_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DynaPanel.h"
#include <GosFx\GosFx.hpp>
/////////////////////////////////////////////////////////////////////////////
// CTexturePanel dialog
class CTexturePanel2 : public CDynaPanel
{
// Construction
public:
virtual void Set(void *dat);
CTexturePanel2(CWnd* pParent = NULL); // standard constructor
Stuff::MString *Str;
virtual void OnCancel() {}
virtual void OnOK() {}
// Dialog Data
//{{AFX_DATA(CTexturePanel)
enum { IDD = IDD_TEXTUREPANEL };
CString m_TextureName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTexturePanel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTexturePanel)
afx_msg void OnTexturebrowse();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif // !defined(AFX_TEXTUREPANEL2_H__6AC89241_8A2C_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,123 @@
// TreeCtrlPro.cpp : implementation file
//
#include "stdafx.h"
#include "pixelwhippro.h"
#include "TreeCtrlPro.h"
/////////////////////////////////////////////////////////////////////////////
// CTreeCtrlPro
CTreeCtrlPro::CTreeCtrlPro()
{
NeedUpdate=false;
}
CTreeCtrlPro::~CTreeCtrlPro()
{
}
BEGIN_MESSAGE_MAP(CTreeCtrlPro, CTreeCtrl)
//{{AFX_MSG_MAP(CTreeCtrlPro)
ON_WM_LBUTTONUP()
ON_WM_LBUTTONDOWN()
ON_NOTIFY_REFLECT(TVN_SELCHANGING, OnSelchanging)
ON_WM_MOUSEMOVE()
ON_WM_HSCROLL()
ON_WM_VSCROLL()
ON_WM_MOUSEWHEEL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTreeCtrlPro message handlers
void CTreeCtrlPro::OnLButtonUp(UINT nFlags, CPoint point)
{
CTreeCtrl::OnLButtonUp(nFlags, point);
}
void CTreeCtrlPro::OnLButtonDown(UINT nFlags, CPoint point)
{
UINT pFlags;
HTREEITEM itm;
itm=HitTest(point,&pFlags);
if(pFlags==TVHT_ONITEMSTATEICON)
{
SetCheck(itm,!GetCheck(itm));
NMHDR nmhdr;
nmhdr.hwndFrom=m_hWnd;
nmhdr.idFrom=GetDlgCtrlID();
nmhdr.code=NM_CLICK;
GetParent()->SendMessage(WM_NOTIFY,GetDlgCtrlID(),(DWORD)&nmhdr);
}
else
CTreeCtrl::OnLButtonDown(nFlags, point);
}
LRESULT CTreeCtrlPro::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_LBUTTONUP:
break;
}
return CTreeCtrl::WindowProc(message, wParam, lParam);
}
void CTreeCtrlPro::OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
*pResult = 0;
}
void CTreeCtrlPro::OnMouseMove(UINT nFlags, CPoint point)
{
CTreeCtrl::OnMouseMove(nFlags, point);
}
void CTreeCtrlPro::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CTreeCtrl::OnHScroll(nSBCode, nPos, pScrollBar);
GetParent()->SendMessage(WM_HSCROLL,nSBCode|(nPos<<16),(DWORD)m_hWnd);
}
void CTreeCtrlPro::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CTreeCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
GetParent()->SendMessage(WM_VSCROLL,nSBCode|(nPos<<16),(DWORD)m_hWnd);
}
BOOL CTreeCtrlPro::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
BOOL res;
res=CTreeCtrl::OnMouseWheel(nFlags, zDelta, pt);
GetParent()->SendMessage(WM_VSCROLL,0,(DWORD)m_hWnd);
return res;
}
void CTreeCtrlPro::ExpandBranch(HTREEITEM nde)
{
if(nde==NULL) return;
Expand(nde,TVE_EXPAND);
HTREEITEM itm;
itm=GetChildItem(nde);
while(itm!=NULL)
{
ExpandBranch(itm);
itm=GetNextSiblingItem(itm);
}
}
@@ -0,0 +1,57 @@
#if !defined(AFX_TREECTRLPRO_H__05D26024_24F4_418F_9AC4_3F99CA3E57F4__INCLUDED_)
#define AFX_TREECTRLPRO_H__05D26024_24F4_418F_9AC4_3F99CA3E57F4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TreeCtrlPro.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTreeCtrlPro window
class CTreeCtrlPro : public CTreeCtrl
{
// Construction
public:
CTreeCtrlPro();
bool NeedUpdate;
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTreeCtrlPro)
protected:
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CTreeCtrlPro();
void ExpandBranch(HTREEITEM nde);
// Generated message map functions
protected:
//{{AFX_MSG(CTreeCtrlPro)
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TREECTRLPRO_H__05D26024_24F4_418F_9AC4_3F99CA3E57F4__INCLUDED_)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,67 @@
#if !defined(AFX_TREEPARAMVIEW_H__7DF2EA35_E52A_4FCF_A773_9CD8E13A36F3__INCLUDED_)
#define AFX_TREEPARAMVIEW_H__7DF2EA35_E52A_4FCF_A773_9CD8E13A36F3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TreeParamView.h : header file
//
#include "TreeCtrlPro.h"
#include "CurveSet.h"
#define MAXCSETS 128
/////////////////////////////////////////////////////////////////////////////
// CTreeParamView view
class CTreeParamView : public CView
{
protected:
CTreeParamView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CTreeParamView)
// Attributes
public:
CTreeCtrlPro m_PTree;
CurveSet CSet[MAXCSETS];
// Operations
public:
void Reset();
bool DoUpdate;
bool Initalized;
void Refresh();
HTREEITEM FirstItem;
int NoRedraw;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTreeParamView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CTreeParamView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CTreeParamView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TREEPARAMVIEW_H__7DF2EA35_E52A_4FCF_A773_9CD8E13A36F3__INCLUDED_)
@@ -0,0 +1,78 @@
// View3DChildWindow.cpp : implementation file
//
#include "stdafx.h"
#include "PixelWhipPro.h"
#include "View3DChildWindow.h"
#include <MFCPlatform\MFCPlatform.hpp>
extern bool gActive;
extern bool gGotFocus;
/////////////////////////////////////////////////////////////////////////////
// CView3DChildWindow
//IMPLEMENT_DYNCREATE(CView3DChildWindow, CFrameWnd)
CView3DChildWindow::CView3DChildWindow()
{
GOSActive=false;
}
CView3DChildWindow::~CView3DChildWindow()
{
}
BEGIN_MESSAGE_MAP(CView3DChildWindow, CFrameWnd)
//{{AFX_MSG_MAP(CView3DChildWindow)
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CView3DChildWindow message handlers
LRESULT CView3DChildWindow::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(GOSActive==true)
{
switch(message)
{
case WM_ACTIVATE:
gActive = true;
gGotFocus= true;
break;
case WM_CLOSE:
return CFrameWnd::WindowProc(message, wParam, lParam);
break;
}
return GameOSWinProc(m_hWnd, message, wParam, lParam);
}
return CFrameWnd::WindowProc(message, wParam, lParam);
}
void CView3DChildWindow::Fix3DView()
{
gActive = true;
gGotFocus= true;
GameOSWinProc(m_hWnd, WM_MOVE, NULL, NULL);
}
void CView3DChildWindow::PostGosInit()
{
//SetCursor(NULL);
}
void CView3DChildWindow::OnClose()
{
ShowWindow(SW_HIDE);
}
@@ -0,0 +1,51 @@
#if !defined(AFX_VIEW3DCHILDWINDOW_H__5291EA12_420E_4B35_A0B2_6D59F1FBB232__INCLUDED_)
#define AFX_VIEW3DCHILDWINDOW_H__5291EA12_420E_4B35_A0B2_6D59F1FBB232__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// View3DChildWindow.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CView3DChildWindow frame
class CView3DChildWindow : public CFrameWnd
{
// DECLARE_DYNCREATE(CView3DChildWindow)
protected:
// Attributes
public:
// Operations
public:
void PostGosInit();
void Fix3DView();
bool GOSActive;
CView3DChildWindow(); // protected constructor used by dynamic creation
virtual ~CView3DChildWindow();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CView3DChildWindow)
protected:
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CView3DChildWindow)
afx_msg void OnClose();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VIEW3DCHILDWINDOW_H__5291EA12_420E_4B35_A0B2_6D59F1FBB232__INCLUDED_)
@@ -0,0 +1,483 @@
#include "stdafx.h"
#include"Export.h"
#include"pixelwhippro.h"
using namespace gosFX;
#define INDENT "\t"
void ExportCurve(FILE *fl,gosFX::Curve *Curve,char *CurveName,CString prefix)
{
CString CType;
switch(Curve->m_type)
{
case gosFX::Curve::e_ConstantType: CType="Constant"; break;
case gosFX::Curve::e_LinearType: CType="Linear"; break;
case gosFX::Curve::e_SplineType: CType="Spline"; break;
case gosFX::Curve::e_ComplexType:CType="Complex"; break;
case gosFX::Curve::e_ComplexComplexType: CType="ComplexComplex"; break;
case gosFX::Curve::e_ComplexLinearType: CType="ComplexLinear"; break;
case gosFX::Curve::e_ComplexSplineType: CType="ComplexSpline"; break;
case gosFX::Curve::e_ConstantComplexType: CType="ConstantComplex"; break;
case gosFX::Curve::e_ConstantLinearType: CType="ConstantLinear"; break;
case gosFX::Curve::e_ConstantSplineType:CType="ConstantSpline"; break;
case gosFX::Curve::e_SplineLinearType: CType="SplineLinear"; break;
}
fprintf(fl,"\n%sStartCurve[%s,%s]\n",(LPCSTR)prefix,CType,CurveName);
CString newprefix=prefix+INDENT;
LPCSTR npx=(LPCSTR)newprefix;
// fprintf(fl,"%sCurveType=%s\n",npx,(LPCSTR)CType);
switch(Curve->m_type)
{
case gosFX::Curve::e_ConstantType:
{
gosFX::ConstantCurve *LCurve=(gosFX::ConstantCurve *)Curve;
fprintf(fl,"%sValue=%f\n",npx,LCurve->m_value);
}
break;
case gosFX::Curve::e_LinearType:
{
gosFX::LinearCurve *LCurve=(gosFX::LinearCurve *)Curve;
fprintf(fl,"%sStartValue=%f\n",npx,LCurve->m_value);
fprintf(fl,"%sSlope=%f\n",npx,LCurve->m_slope);
}
break;
case gosFX::Curve::e_SplineType:
{
gosFX::SplineCurve *LCurve=(gosFX::SplineCurve *)Curve;
fprintf(fl,"%sStartValue=%f\n",npx,LCurve->ComputeValue(0.0f,0.0f));
fprintf(fl,"%sStartSlope=%f\n",npx,LCurve->ComputeSlope(0.0f));
fprintf(fl,"%sEndValue=%f\n",npx,LCurve->ComputeValue(1.0f,0.0f));
fprintf(fl,"%sEndSlope=%f\n",npx,LCurve->ComputeSlope(1.0f));
}
break;
case gosFX::Curve::e_ComplexType:
{
gosFX::ComplexCurve *LCurve=(gosFX::ComplexCurve *)Curve;
fprintf(fl,"%sNumberOfKeys=%i\n",npx,LCurve->GetKeyCount());
CString lprefix=newprefix+INDENT;
LPCSTR lpx=(LPCSTR)lprefix;
for(int i=0;i<LCurve->GetKeyCount();i++)
{
fprintf(fl,"%sStartCurveKey\n",npx);
fprintf(fl,"%sTime=%f\n",lpx,(*LCurve)[i].m_time);
fprintf(fl,"%sSlope=%f\n",lpx,(*LCurve)[i].m_slope);
fprintf(fl,"%sValue=%f\n",lpx,(*LCurve)[i].m_value);
fprintf(fl,"%sEndCurveKey\n",npx);
}
}
break;
case gosFX::Curve::e_ComplexComplexType:
{
gosFX::SeededCurveOf<gosFX::ComplexCurve, gosFX::ComplexCurve,gosFX::Curve::e_ComplexComplexType> *LCurve=
(gosFX::SeededCurveOf<gosFX::ComplexCurve, gosFX::ComplexCurve,gosFX::Curve::e_ComplexComplexType> *)Curve;
fprintf(fl,"%sSeeded=%s\n",npx,LCurve->m_seeded?"TRUE":"FALSE");
ExportCurve(fl,&(LCurve->m_ageCurve),"AgeCurve",newprefix);
ExportCurve(fl,&(LCurve->m_seedCurve),"SeedCurve",newprefix);
}
break;
case gosFX::Curve::e_ComplexLinearType:
{
gosFX::SeededCurveOf<gosFX::ComplexCurve, gosFX::LinearCurve,gosFX::Curve::e_ComplexLinearType> *LCurve=
(gosFX::SeededCurveOf<gosFX::ComplexCurve, gosFX::LinearCurve,gosFX::Curve::e_ComplexLinearType> *)Curve;
fprintf(fl,"%sSeeded=%s\n",npx,LCurve->m_seeded?"TRUE":"FALSE");
ExportCurve(fl,&(LCurve->m_ageCurve),"AgeCurve",newprefix);
ExportCurve(fl,&(LCurve->m_seedCurve),"SeedCurve",newprefix);
}
break;
case gosFX::Curve::e_ComplexSplineType:
{
gosFX::SeededCurveOf<gosFX::ComplexCurve, gosFX::SplineCurve,gosFX::Curve::e_ComplexSplineType> *LCurve=
(gosFX::SeededCurveOf<gosFX::ComplexCurve, gosFX::SplineCurve,gosFX::Curve::e_ComplexSplineType> *)Curve;
fprintf(fl,"%sSeeded=%s\n",npx,LCurve->m_seeded?"TRUE":"FALSE");
ExportCurve(fl,&(LCurve->m_ageCurve),"AgeCurve",newprefix);
ExportCurve(fl,&(LCurve->m_seedCurve),"SeedCurve",newprefix);
}
break;
case gosFX::Curve::e_ConstantComplexType:
{
gosFX::SeededCurveOf<gosFX::ConstantCurve, gosFX::ComplexCurve,gosFX::Curve::e_ConstantComplexType> *LCurve=
(gosFX::SeededCurveOf<gosFX::ConstantCurve, gosFX::ComplexCurve,gosFX::Curve::e_ConstantComplexType> *)Curve;
fprintf(fl,"%sSeeded=%s\n",npx,LCurve->m_seeded?"TRUE":"FALSE");
ExportCurve(fl,&(LCurve->m_ageCurve),"AgeCurve",newprefix);
ExportCurve(fl,&(LCurve->m_seedCurve),"SeedCurve",newprefix);
}
break;
case gosFX::Curve::e_ConstantLinearType:
{
gosFX::SeededCurveOf<gosFX::ConstantCurve, gosFX::LinearCurve,gosFX::Curve::e_ConstantLinearType> *LCurve=
(gosFX::SeededCurveOf<gosFX::ConstantCurve, gosFX::LinearCurve,gosFX::Curve::e_ConstantLinearType> *)Curve;
fprintf(fl,"%sSeeded=%s\n",npx,LCurve->m_seeded?"TRUE":"FALSE");
ExportCurve(fl,&(LCurve->m_ageCurve),"AgeCurve",newprefix);
ExportCurve(fl,&(LCurve->m_seedCurve),"SeedCurve",newprefix);
}
break;
case gosFX::Curve::e_ConstantSplineType:
{
gosFX::SeededCurveOf<gosFX::ConstantCurve, gosFX::SplineCurve,gosFX::Curve::e_ConstantSplineType> *LCurve=
(gosFX::SeededCurveOf<gosFX::ConstantCurve, gosFX::SplineCurve,gosFX::Curve::e_ConstantSplineType> *)Curve;
fprintf(fl,"%sSeeded=%s\n",npx,LCurve->m_seeded?"TRUE":"FALSE");
ExportCurve(fl,&(LCurve->m_ageCurve),"AgeCurve",newprefix);
ExportCurve(fl,&(LCurve->m_seedCurve),"SeedCurve",newprefix);
}
break;
case gosFX::Curve::e_SplineLinearType:
{
gosFX::SeededCurveOf<gosFX::SplineCurve, gosFX::LinearCurve,gosFX::Curve::e_SplineLinearType> *LCurve=
(gosFX::SeededCurveOf<gosFX::SplineCurve, gosFX::LinearCurve,gosFX::Curve::e_SplineLinearType> *)Curve;
fprintf(fl,"%sSeeded=%s\n",npx,LCurve->m_seeded?"TRUE":"FALSE");
ExportCurve(fl,&(LCurve->m_ageCurve),"AgeCurve",newprefix);
ExportCurve(fl,&(LCurve->m_seedCurve),"SeedCurve",newprefix);
}
break;
}
fprintf(fl,"%sEndCurve[%s]\n\n",(LPCSTR)prefix,(LPCSTR)CurveName);
}
void ExportState(FILE *fl,MidLevelRenderer::MLRState *State,char *Name,CString prefix)
{
fprintf(fl,"\n%sStart State[%s]\n",(LPCSTR)prefix,Name);
CString newprefix=prefix+INDENT;
LPCSTR npx=(LPCSTR)newprefix;
int AStyle;
if(State->GetWireFrameMode()==MidLevelRenderer::MLRState::WireFrameOnlyMode)
{
AStyle=3;
}
else
{
if(State->GetZBufferWriteMode()==MidLevelRenderer::MLRState::ZBufferWriteOnMode)
if(State->GetAlphaMode()==MidLevelRenderer::MLRState::OneInvAlphaMode)
AStyle=1;
else
if(State->GetAlphaMode()==MidLevelRenderer::MLRState::AlphaInvAlphaMode)
AStyle=2;
else
AStyle=0;
else
if(State->GetAlphaMode()==MidLevelRenderer::MLRState::OneInvAlphaMode)
AStyle=4;
else
if(State->GetAlphaMode()==MidLevelRenderer::MLRState::AlphaInvAlphaMode)
AStyle=5;
else
AStyle=0;
}
switch(AStyle)
{
case 0:
fprintf(fl,"%sAlphaMode=%s\n",npx,"Default");
break;
case 1:
fprintf(fl,"%sAlphaMode=%s\n",npx,"OneInvAlphaZWriteOn");
break;
case 2:
fprintf(fl,"%sAlphaMode=%s\n",npx,"AlphaInvAlphaZWriteOn");
break;
case 3:
fprintf(fl,"%sAlphaMode=%s\n",npx,"WireFrame");
break;
case 4:
fprintf(fl,"%sAlphaMode=%s\n",npx,"OneInvAlphaZWriteOff");
break;
case 5:
fprintf(fl,"%sAlphaMode=%s\n",npx,"AlphaInvAlphaZWriteOff");
break;
}
CString TextureName;
if(State->GetTextureHandle()!=0)
{
TextureName=((*MidLevelRenderer::MLRTexturePool::Instance)[State])->GetTextureName();
}
else
{
TextureName="None";
}
fprintf(fl,"%sTexture=%s\n",npx,(LPCSTR)TextureName);
fprintf(fl,"%sEndState[%s]\n\n",(LPCSTR)prefix,Name);
}
void ExportEffect(FILE *fl,gosFX::Effect::Specification *spec,CString px)
{
CString etype;
switch (spec->GetClassID())
{
case gosFX::EffectClassID: etype="EffectClass"; break;
case gosFX::ParticleCloudClassID: etype="ParticleCloud"; break;
case gosFX::PointCloudClassID: etype="PointCloud"; break;
case gosFX::SpinningCloudClassID: etype="SpinningCloud"; break;
case gosFX::ShardCloudClassID: etype="ShardCloud"; break;
case gosFX::PertCloudClassID: etype="PertCloud"; break;
case gosFX::CardCloudClassID: etype="CardCloud"; break;
case gosFX::ShapeCloudClassID: etype="ShapeCloud"; break;
case gosFX::EffectCloudClassID: etype="EffectCloud"; break;
case gosFX::SingletonClassID: etype="Singleton"; break;
case gosFX::CardClassID: etype="Card"; break;
case gosFX::ShapeClassID: etype="Shape"; break;
}
fprintf(fl,"\n%sStartEffect[%s,%s]\n",(LPCSTR)px,(LPCSTR)etype,(char *)spec->m_name);
CString prefix=px+INDENT;
LPCSTR prx=(LPCSTR)prefix;
// fprintf(fl,"%sEffectType=%s\n",prx,(LPCSTR)etype);
if(spec->GetClassID()!=gosFX::EffectClassID)
{
if(spec->GetClassID()==gosFX::CardClassID || spec->GetClassID()==gosFX::ShapeClassID)
{
gosFX::Singleton__Specification *tspec;
tspec=Cast_Pointer(gosFX::Singleton__Specification *,spec);
Check_Object(tspec);
fprintf(fl,"%sAlignZUsingX=%s\n",prx,tspec->m_alignZUsingX?"TRUE":"FALSE");
fprintf(fl,"%sAlignZUsingY=%s\n",prx,tspec->m_alignZUsingY?"TRUE":"FALSE");
ExportCurve(fl,&tspec->m_scale,"Scale",prefix);
ExportCurve(fl,&tspec->m_red,"Singleton Color Red",prefix);
ExportCurve(fl,&tspec->m_green,"Singleton Color Green",prefix);
ExportCurve(fl,&tspec->m_blue,"Singleton Color Blue",prefix);
ExportCurve(fl,&tspec->m_alpha,"Singleton Color Alpha",prefix);
}
// Particle Cloud
switch (spec->GetClassID())
{
case gosFX::CardClassID:
{
gosFX::Card__Specification *tspec;
tspec=Cast_Pointer(gosFX::Card__Specification *,spec);
Check_Object(tspec);
ExportCurve(fl,&tspec->m_halfHeight,"HalfHeight",prefix);
ExportCurve(fl,&tspec->m_aspectRatio,"AspectRatio",prefix);
ExportCurve(fl,&tspec->m_UOffset,"UOffset",prefix);
ExportCurve(fl,&tspec->m_VOffset,"VOffset",prefix);
ExportCurve(fl,&tspec->m_USize,"USize",prefix);
ExportCurve(fl,&tspec->m_VSize,"VSize",prefix);
}
break;
case gosFX::ShapeClassID:
{
gosFX::Shape__Specification *tspec;
tspec=Cast_Pointer(gosFX::Shape__Specification *,spec);
Check_Object(tspec);
//!!!!!!!!!!! No Access to Shape what to put here?!
/*
*/
}
break;
default:
{
gosFX::ParticleCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::ParticleCloud__Specification *,spec);
fprintf(fl,"%sMaxParticleCount=%i\n",prx,tspec->m_maxParticleCount);
ExportCurve(fl,&tspec->m_pDrag,"ParticleDrag",prefix);
ExportCurve(fl,&tspec->m_particlesPerSecond,"ParticlesPerSecond",prefix);
ExportCurve(fl,&tspec->m_startingSpeed,"StartingSpeed",prefix);
ExportCurve(fl,&tspec->m_minimumDeviation,"MinimumDeviation",prefix);
ExportCurve(fl,&tspec->m_maximumDeviation,"MaximumDeviation",prefix);
ExportCurve(fl,&tspec->m_pLifeSpan,"ParticleLifeSpan",prefix);
ExportCurve(fl,&tspec->m_startingPopulation,"StartingPopulation",prefix);
ExportCurve(fl,&tspec->m_emitterSizeX,"EmmiterSizeX",prefix);
ExportCurve(fl,&tspec->m_emitterSizeY,"EmmiterSizeY",prefix);
ExportCurve(fl,&tspec->m_emitterSizeZ,"EmmiterSizeZ",prefix);
ExportCurve(fl,&tspec->m_pEtherVelocityX,"EtherVelocityX",prefix);
ExportCurve(fl,&tspec->m_pEtherVelocityY,"EtherVelocityY",prefix);
ExportCurve(fl,&tspec->m_pEtherVelocityZ,"EtherVelocityZ",prefix);
ExportCurve(fl,&tspec->m_pAccelerationX,"ParticleAccelerationX",prefix);
ExportCurve(fl,&tspec->m_pAccelerationY,"ParticleAccelerationY",prefix);
ExportCurve(fl,&tspec->m_pAccelerationZ,"ParticleAccelerationZ",prefix);
ExportCurve(fl,&tspec->m_pRed,"ParticleColorRed",prefix);
ExportCurve(fl,&tspec->m_pGreen,"ParticleColorGreen",prefix);
ExportCurve(fl,&tspec->m_pBlue,"ParticleColorBlue",prefix);
ExportCurve(fl,&tspec->m_pAlpha,"ParticleColorAlpha",prefix);
}
// Spinning CLoud
if(spec->GetClassID()!=gosFX::PointCloudClassID)
{
gosFX::SpinningCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::SpinningCloud__Specification *,spec);
Check_Object(tspec);
fprintf(fl,"%sRandomStartingPosition=%s\n",prx,tspec->m_randomStartingRotation?"TRUE":"FALSE");
fprintf(fl,"%sAlignZUsingX=%s\n",prx,tspec->m_alignZUsingX?"TRUE":"FALSE");
fprintf(fl,"%sAlignZUsingY=%s\n",prx,tspec->m_alignZUsingY?"TRUE":"FALSE");
ExportCurve(fl,&tspec->m_pSpin,"Spin",prefix);
ExportCurve(fl,&tspec->m_pScale,"Scale",prefix);
}
} //end of CS 1
switch (spec->GetClassID())
{
case gosFX::EffectCloudClassID:
{
gosFX::EffectCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::EffectCloud__Specification *,spec);
Check_Object(tspec);
}
break;
case gosFX::PointCloudClassID:
{
gosFX::PointCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::PointCloud__Specification *,spec);
Check_Object(tspec);
}
break;
case gosFX::ShardCloudClassID:
{
gosFX::ShardCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::ShardCloud__Specification *,spec);
Check_Object(tspec);
ExportCurve(fl,&tspec->m_size,"Size",prefix);
ExportCurve(fl,&tspec->m_angularity,"Angularity",prefix);
}
break;
case gosFX::ShapeCloudClassID:
{
gosFX::ShapeCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::ShapeCloud__Specification *,spec);
Check_Object(tspec);
/* !!!!!!!!!!!!! More Shape Problems
LastItem=m_PTree.InsertItem("Shape",0,0,ParItem,LastItem);
CSet[cnt].SetType(CurveSet::SHAPECLOUDPANEL,&tspec);
m_PTree.SetItemData(LastItem,(DWORD)&CSet[cnt]);
cnt++;
*/
}
break;
case gosFX::PertCloudClassID:
{
gosFX::PertCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::PertCloud__Specification *,spec);
Check_Object(tspec);
ExportCurve(fl,&tspec->m_pCenterRed,"CenterColorRed",prefix);
ExportCurve(fl,&tspec->m_pCenterGreen,"CenterColorGreen",prefix);
ExportCurve(fl,&tspec->m_pCenterBlue,"CenterColorBlue",prefix);
ExportCurve(fl,&tspec->m_pCenterAlpha,"CenterColorAlpha",prefix);
ExportCurve(fl,&tspec->m_size,"Size",prefix);
ExportCurve(fl,&tspec->m_perturbation,"Perturbation",prefix);
}
break;
case gosFX::CardCloudClassID:
{
gosFX::CardCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::CardCloud__Specification *,spec);
Check_Object(tspec);
ExportCurve(fl,&tspec->m_halfHeight,"HalfHeight",prefix);
ExportCurve(fl,&tspec->m_aspectRatio,"AspectRatio",prefix);
ExportCurve(fl,&tspec->m_UOffset,"UOffset",prefix);
ExportCurve(fl,&tspec->m_VOffset,"VOffset",prefix);
ExportCurve(fl,&tspec->m_USize,"USize",prefix);
ExportCurve(fl,&tspec->m_VSize,"VSize",prefix);
}
break;
}
}
if(spec->GetClassID()==gosFX::EffectCloudClassID)
{
gosFX::EffectCloud__Specification *tspec;
tspec=Cast_Pointer(gosFX::EffectCloud__Specification *,spec);
Check_Object(tspec);
if(tspec->m_particleEffectID!=BADINDEX)
{
CString lprefix=prefix+INDENT;
LPCSTR lpx=(LPCSTR)lprefix;
fprintf(fl,"\n%sStartChildEffect\n",(LPCSTR)px);
ExportEffect(fl,gosFX::EffectLibrary::Instance->m_effects[tspec->m_particleEffectID],lprefix);
fprintf(fl,"%sEndChildEffect\n\n",(LPCSTR)px);
}
}
else
{
gosFX::Event *event;
Stuff::ChainIteratorOf<gosFX::Event*> eitr(&(spec->m_events));
eitr.First();
while(NULL!=(event=eitr.ReadAndNext()))
{
CString lprefix=prefix+INDENT;
LPCSTR lpx=(LPCSTR)lprefix;
fprintf(fl,"\n%sStartChildEffect\n",(LPCSTR)px);
Stuff::Point3D pnt(0,0,0);
pnt*=event->m_localToParent;
fprintf(fl,"%sLocationX=%f\n",(LPCSTR)lpx,pnt.x);
fprintf(fl,"%sLocationY=%f\n",(LPCSTR)lpx,pnt.y);
fprintf(fl,"%sLocationZ=%f\n",(LPCSTR)lpx,pnt.z);
gosFX::Effect::Specification *tspec=gosFX::EffectLibrary::Instance->m_effects[event->m_effectID];
ExportEffect(fl,tspec,lprefix);
fprintf(fl,"%sEndChildEffect\n\n",(LPCSTR)px);
}
}
fprintf(fl,"%sEndEffect[%s]\n\n",(LPCSTR)px,(char *)spec->m_name);
}
bool IsRootEffect(gosFX::Effect::Specification *ospec)
{
int effnum;
for(effnum=0;effnum<gosFX::EffectLibrary::Instance->m_effects.GetLength();effnum++)
{
gosFX::Effect::Specification *spec=gosFX::EffectLibrary::Instance->m_effects[effnum];
gosFX::Event *event;
Stuff::ChainIteratorOf<gosFX::Event*> eitr(&(spec->m_events));
eitr.First();
while(NULL!=(event=eitr.ReadAndNext()))
{
if(event->m_effectID==ospec->m_effectID) return false;
}
}
return true;
}
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More