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,61 @@
// AmbientLightProperties.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "AmbientLightProperties.h"
/////////////////////////////////////////////////////////////////////////////
// CAmbientLightProperties dialog
CAmbientLightProperties::CAmbientLightProperties(CWnd* pParent /*=NULL*/)
: CDialog(CAmbientLightProperties::IDD, pParent)
{
//{{AFX_DATA_INIT(CAmbientLightProperties)
m_Alpha = 0.0f;
m_Blue = 0.0f;
m_Green = 0.0f;
m_Intensity = 0.0f;
m_Red = 0.0f;
//}}AFX_DATA_INIT
}
void CAmbientLightProperties::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAmbientLightProperties)
DDX_Text(pDX, IDC_ALPHA, m_Alpha);
DDX_Text(pDX, IDC_BLUE, m_Blue);
DDX_Text(pDX, IDC_GREEN, m_Green);
DDX_Text(pDX, IDC_INTENSITY, m_Intensity);
DDX_Text(pDX, IDC_RED, m_Red);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAmbientLightProperties, CDialog)
//{{AFX_MSG_MAP(CAmbientLightProperties)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAmbientLightProperties message handlers
void CAmbientLightProperties::SetData(MLRAmbientLight *light)
{
Light=*light;
m_Intensity=Light.GetIntensity();
Light.GetColor(m_Red,m_Green,m_Blue);
}
MLRAmbientLight &CAmbientLightProperties::GetData()
{
Light.SetIntensity(m_Intensity);
Light.SetColor(m_Red,m_Green,m_Blue);
return Light;
}
@@ -0,0 +1,54 @@
#if !defined(AFX_AMBIENTLIGHTPROPERTIES_H__D2F3D4A2_8325_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_AMBIENTLIGHTPROPERTIES_H__D2F3D4A2_8325_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// AmbientLightProperties.h : header file
//
#include <MLR\MLRHeaders.hpp>
/////////////////////////////////////////////////////////////////////////////
// CAmbientLightProperties dialog
class CAmbientLightProperties : public CDialog
{
// Construction
public:
MLRAmbientLight Light;
MLRAmbientLight &GetData();
void SetData(MLRAmbientLight *light);
CAmbientLightProperties(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CAmbientLightProperties)
enum { IDD = IDD_AMBIENTLIGHTPROPS };
float m_Alpha;
float m_Blue;
float m_Green;
float m_Intensity;
float m_Red;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAmbientLightProperties)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CAmbientLightProperties)
// 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_AMBIENTLIGHTPROPERTIES_H__D2F3D4A2_8325_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,229 @@
// BumpMapDlg.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "BumpMapDlg.h"
#include <GameOS\ToolOS.hpp>
extern Stuff::MString *erf_texture_path;
/////////////////////////////////////////////////////////////////////////////
// CBumpMapDlg dialog
CBumpMapDlg::CBumpMapDlg(CWnd* pParent /*=NULL*/)
: CDialog(CBumpMapDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CBumpMapDlg)
m_BumpTxt = _T("");
m_DetailTxt = _T("");
m_EnvTxt = _T("");
m_TerrainTxt = _T("");
m_WaterTxt = _T("");
m_BumpRep = 1.0f;
m_DetailRep = 4.0f;
m_EvnRep = 1.0f;
m_TerrainRep = 1.0f;
m_WaterRep = 1.0f;
m_NormTxt = _T("");
m_NormRep = 1.0f;
m_BScrollU = 0.0f;
m_NScrollU = 0.0f;
m_NScrollV = 0.0f;
m_WScrollU = 0.0f;
m_WScrollV = 0.0f;
m_BScrollV = 0.0f;
//}}AFX_DATA_INIT
}
void CBumpMapDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBumpMapDlg)
DDX_Text(pDX, IDC_BUMPTXT, m_BumpTxt);
DDX_Text(pDX, IDC_DETAILTXT, m_DetailTxt);
DDX_Text(pDX, IDC_ENVTXT, m_EnvTxt);
DDX_Text(pDX, IDC_TERRAINTXT, m_TerrainTxt);
DDX_Text(pDX, IDC_WATERTXT, m_WaterTxt);
DDX_Text(pDX, IDC_BUMPREP, m_BumpRep);
DDV_MinMaxFloat(pDX, m_BumpRep, 0.5f, 8.f);
DDX_Text(pDX, IDC_DETAILREP, m_DetailRep);
DDV_MinMaxFloat(pDX, m_DetailRep, 0.5f, 8.f);
DDX_Text(pDX, IDC_EVNREP, m_EvnRep);
DDV_MinMaxFloat(pDX, m_EvnRep, 0.5f, 8.f);
DDX_Text(pDX, IDC_TERRAINREP, m_TerrainRep);
DDV_MinMaxFloat(pDX, m_TerrainRep, 0.5f, 8.f);
DDX_Text(pDX, IDC_WATERREP, m_WaterRep);
DDV_MinMaxFloat(pDX, m_WaterRep, 0.5f, 8.f);
DDX_Text(pDX, IDC_NORMTXT, m_NormTxt);
DDX_Text(pDX, IDC_NORMREP, m_NormRep);
DDV_MinMaxFloat(pDX, m_NormRep, 0.5f, 8.f);
DDX_Text(pDX, IDC_BSCROLLU, m_BScrollU);
DDV_MinMaxFloat(pDX, m_BScrollU, -1.f, 1.f);
DDX_Text(pDX, IDC_NSCROLLU, m_NScrollU);
DDV_MinMaxFloat(pDX, m_NScrollU, -1.f, 1.f);
DDX_Text(pDX, IDC_NSCROLLV, m_NScrollV);
DDV_MinMaxFloat(pDX, m_NScrollV, -1.f, 1.f);
DDX_Text(pDX, IDC_WSCROLLU, m_WScrollU);
DDV_MinMaxFloat(pDX, m_WScrollU, -1.f, 1.f);
DDX_Text(pDX, IDC_WSCROLLV, m_WScrollV);
DDV_MinMaxFloat(pDX, m_WScrollV, -1.f, 1.f);
DDX_Text(pDX, IDC_BSCROLLV, m_BScrollV);
DDV_MinMaxFloat(pDX, m_BScrollV, -1.f, 1.f);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBumpMapDlg, CDialog)
//{{AFX_MSG_MAP(CBumpMapDlg)
ON_BN_CLICKED(IDC_WATERBRW, OnWaterbrw)
ON_BN_CLICKED(IDC_ENVBRW, OnEnvbrw)
ON_BN_CLICKED(IDC_DETAILBRW, OnDetailbrw)
ON_BN_CLICKED(IDC_BUMPBRW, OnBumpbrw)
ON_BN_CLICKED(IDC_TERRAINBROWSE, OnTerrainbrowse)
ON_BN_CLICKED(IDC_NRMBRW, OnNrmbrw)
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBumpMapDlg message handlers
void CBumpMapDlg::OnWaterbrw()
{
BrowseForTexture(&m_WaterTxt);
}
void CBumpMapDlg::OnEnvbrw()
{
BrowseForTexture(&m_EnvTxt);
}
void CBumpMapDlg::OnDetailbrw()
{
BrowseForTexture(&m_DetailTxt);
}
void CBumpMapDlg::OnBumpbrw()
{
BrowseForTexture(&m_BumpTxt);
}
void CBumpMapDlg::OnTerrainbrowse()
{
BrowseForTexture(&m_TerrainTxt);
}
void CBumpMapDlg::OnNrmbrw()
{
BrowseForTexture(&m_NormTxt);
}
void CBumpMapDlg::BrowseForTexture(CString *str)
{
UpdateData(TRUE);
CString texname,tpath=*erf_texture_path;
texname=tpath+*str;
CString pngname = texname+".png";
if (::gos_DoesFileExist(pngname))
{
texname = pngname;
}
else
texname+=".tga";
CFileDialog dlg(true,"*.png",texname,OFN_HIDEREADONLY,"Texture Files (*.png;*.tga)|*.png;*.tga||");
if (IDOK==dlg.DoModal())
{
CString rpath;
rpath=dlg.GetPathName();
rpath=rpath.Mid(tpath.GetLength());
rpath=rpath.Left(rpath.ReverseFind('.'));
*str=rpath;
}
UpdateData(FALSE);
}
void CBumpMapDlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
CDialog::OnClose();
}
BOOL CBumpMapDlg::OnInitDialog()
{
CDialog::OnInitDialog();
char TmpStr[512];
DWORD dsize;
dsize = 512;
gos_LoadDataFromRegistry("TerrainTexture",TmpStr,&dsize);
if(dsize>0) m_TerrainTxt = TmpStr;
dsize = 512;
gos_LoadDataFromRegistry("BumpTexture",TmpStr,&dsize);
if(dsize>0) m_BumpTxt = TmpStr;
dsize = 512;
gos_LoadDataFromRegistry("DetailTexture",TmpStr,&dsize);
if(dsize>0) m_DetailTxt = TmpStr;
dsize = 512;
gos_LoadDataFromRegistry("WaterTexture",TmpStr,&dsize);
if(dsize>0) m_WaterTxt = TmpStr;
dsize = 512;
gos_LoadDataFromRegistry("EnvTexture",TmpStr,&dsize);
if(dsize>0) m_EnvTxt = TmpStr;
dsize = 512;
gos_LoadDataFromRegistry("NormalTexture",TmpStr,&dsize);
if(dsize>0) m_NormTxt =TmpStr;
gos_LoadDataFromRegistry("TerrainRep",&m_TerrainRep,&dsize);
gos_LoadDataFromRegistry("BumpRep",&m_BumpRep,&dsize);
gos_LoadDataFromRegistry("DetailRep",&m_DetailRep,&dsize);
gos_LoadDataFromRegistry("WaterRep",&m_WaterRep,&dsize);
gos_LoadDataFromRegistry("EnvRep",&m_EvnRep,&dsize);
gos_LoadDataFromRegistry("NormalRep",&m_NormRep,&dsize);
gos_LoadDataFromRegistry("WaterScrollU", &m_WScrollU, &dsize);
gos_LoadDataFromRegistry("WaterScrollV", &m_WScrollV, &dsize);
gos_LoadDataFromRegistry("BumpScrollU", &m_BScrollU, &dsize);
gos_LoadDataFromRegistry("BumpScrollV", &m_BScrollV, &dsize);
gos_LoadDataFromRegistry("NormalScrollU", &m_NScrollU, &dsize);
gos_LoadDataFromRegistry("NormalScrollV", &m_NScrollV, &dsize);
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CBumpMapDlg::OnOK()
{
UpdateData(TRUE);
gos_SaveDataToRegistry("TerrainTexture",(char *)(LPCSTR)m_TerrainTxt, m_TerrainTxt.GetLength()+1);
gos_SaveDataToRegistry("BumpTexture",(char *)(LPCSTR)m_BumpTxt, m_BumpTxt.GetLength()+1);
gos_SaveDataToRegistry("DetailTexture",(char *)(LPCSTR)m_DetailTxt, m_DetailTxt.GetLength()+1);
gos_SaveDataToRegistry("WaterTexture",(char *)(LPCSTR)m_WaterTxt, m_WaterTxt.GetLength()+1);
gos_SaveDataToRegistry("EnvTexture",(char *)(LPCSTR)m_EnvTxt, m_EnvTxt.GetLength()+1);
gos_SaveDataToRegistry("NormalTexture",(char *)(LPCSTR)m_NormTxt, m_NormTxt.GetLength()+1);
gos_SaveDataToRegistry("TerrainRep",&m_TerrainRep,sizeof(m_TerrainRep));
gos_SaveDataToRegistry("BumpRep",&m_BumpRep,sizeof(m_BumpRep));
gos_SaveDataToRegistry("DetailRep",&m_DetailRep,sizeof(m_DetailRep));
gos_SaveDataToRegistry("WaterRep",&m_WaterRep,sizeof(m_WaterRep));
gos_SaveDataToRegistry("EnvRep",&m_EvnRep,sizeof(m_EvnRep));
gos_SaveDataToRegistry("NormalRep",&m_NormRep,sizeof(m_NormRep));
gos_SaveDataToRegistry("WaterScrollU", &m_WScrollU,sizeof(m_WScrollU));
gos_SaveDataToRegistry("WaterScrollV", &m_WScrollV,sizeof(m_WScrollV));
gos_SaveDataToRegistry("BumpScrollU", &m_BScrollU,sizeof(m_BScrollU));
gos_SaveDataToRegistry("BumpScrollV", &m_BScrollV,sizeof(m_BScrollV));
gos_SaveDataToRegistry("NormalScrollU", &m_NScrollU,sizeof(m_NScrollU));
gos_SaveDataToRegistry("NormalScrollV", &m_NScrollV,sizeof(m_NScrollV));
CDialog::OnOK();
}
@@ -0,0 +1,71 @@
#if !defined(AFX_BUMPMAPDLG_H__0CE6F582_9014_4734_8B9F_340131468CBA__INCLUDED_)
#define AFX_BUMPMAPDLG_H__0CE6F582_9014_4734_8B9F_340131468CBA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BumpMapDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CBumpMapDlg dialog
class CBumpMapDlg : public CDialog
{
// Construction
public:
CBumpMapDlg(CWnd* pParent = NULL); // standard constructor
void BrowseForTexture(CString *str);
// Dialog Data
//{{AFX_DATA(CBumpMapDlg)
enum { IDD = IDD_BMPMAPDLG };
CString m_BumpTxt;
CString m_DetailTxt;
CString m_EnvTxt;
CString m_TerrainTxt;
CString m_WaterTxt;
float m_BumpRep;
float m_DetailRep;
float m_EvnRep;
float m_TerrainRep;
float m_WaterRep;
CString m_NormTxt;
float m_NormRep;
float m_BScrollU;
float m_NScrollU;
float m_NScrollV;
float m_WScrollU;
float m_WScrollV;
float m_BScrollV;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CBumpMapDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CBumpMapDlg)
afx_msg void OnWaterbrw();
afx_msg void OnEnvbrw();
afx_msg void OnDetailbrw();
afx_msg void OnBumpbrw();
afx_msg void OnTerrainbrowse();
afx_msg void OnNrmbrw();
afx_msg void OnClose();
virtual BOOL OnInitDialog();
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_BUMPMAPDLG_H__0CE6F582_9014_4734_8B9F_340131468CBA__INCLUDED_)
@@ -0,0 +1,341 @@
# Microsoft Developer Studio Project File - Name="ERF Deluxe" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=ERF Deluxe - Win32 Debug
!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 "ERF Deluxe.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 "ERF Deluxe.mak" CFG="ERF Deluxe - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ERF Deluxe - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "ERF Deluxe - Win32 Profile" (based on "Win32 (x86) Application")
!MESSAGE "ERF Deluxe - Win32 Armor" (based on "Win32 (x86) Application")
!MESSAGE "ERF Deluxe - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "ERF Deluxe - 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 /Gd /Zp4 /MD /W3 /GR /Zi /O2 /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "MFC" /Yu"stdafx.h" /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
# SUBTRACT LINK32 /incremental:yes
!ELSEIF "$(CFG)" == "ERF Deluxe - Win32 Profile"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Profile"
# PROP BASE Intermediate_Dir "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 /GX /O2 /I "..\..\..\Libraries" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "MFC" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /Gd /Zp4 /MD /W3 /GR /Zi /O2 /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "LAB_ONLY" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "MFC" /Yu"stdafx.h" /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
# SUBTRACT LINK32 /incremental:yes
!ELSEIF "$(CFG)" == "ERF Deluxe - Win32 Armor"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Armor"
# PROP BASE Intermediate_Dir "Armor"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../arm.bin"
# PROP Intermediate_Dir "Armor"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /Zp4 /MD /W3 /GX /O2 /I "..\..\..\Libraries" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "MFC" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /Gd /Zp4 /MD /W3 /GR /Zi /O2 /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "MFC" /D "_ARMOR" /D "LAB_ONLY" /Yu"stdafx.h" /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
# SUBTRACT LINK32 /incremental:yes
!ELSEIF "$(CFG)" == "ERF Deluxe - 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 /Gd /Zp4 /MDd /W3 /Gm /GR /Zi /Od /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /I "..\..\Libraries\stlport" /D "LAB_ONLY" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "MFC" /D "_ARMOR" /D "WIN32" /D "_DEBUG" /Yu"stdafx.h" /FD /GZ /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 /incremental:no /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "ERF Deluxe - Win32 Release"
# Name "ERF Deluxe - Win32 Profile"
# Name "ERF Deluxe - Win32 Armor"
# Name "ERF Deluxe - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\AmbientLightProperties.cpp
# End Source File
# Begin Source File
SOURCE=.\BumpMapDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\EditMLRStateDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\ErfDataTree.cpp
# End Source File
# Begin Source File
SOURCE=.\ErfElemInfoView.cpp
# End Source File
# Begin Source File
SOURCE=.\ErfListBox.cpp
# End Source File
# Begin Source File
SOURCE=.\InfiniteLightProps.cpp
# End Source File
# Begin Source File
SOURCE=.\LightListDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\LodRangeDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\MainFrm.cpp
# End Source File
# Begin Source File
SOURCE=".\MFC Gos.cpp"
# End Source File
# Begin Source File
SOURCE=".\MFC Gos.rc"
# End Source File
# Begin Source File
SOURCE=".\MFC GosDoc.cpp"
# End Source File
# Begin Source File
SOURCE=".\MFC GosView.cpp"
# End Source File
# Begin Source File
SOURCE=.\PointLightProps.cpp
# End Source File
# Begin Source File
SOURCE=.\SlideDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\SpotLightProps.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# Begin Source File
SOURCE=.\ViewWnd3D.cpp
# End Source File
# Begin Source File
SOURCE=.\WaterDlg1.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\AmbientLightProperties.h
# End Source File
# Begin Source File
SOURCE=.\BumpMapDlg.h
# End Source File
# Begin Source File
SOURCE=.\EditMLRStateDlg.h
# End Source File
# Begin Source File
SOURCE=.\ErfDataTree.h
# End Source File
# Begin Source File
SOURCE=.\ErfElemInfoView.h
# End Source File
# Begin Source File
SOURCE=.\ErfListBox.h
# End Source File
# Begin Source File
SOURCE=.\InfiniteLightProps.h
# End Source File
# Begin Source File
SOURCE=.\LightListDlg.h
# End Source File
# Begin Source File
SOURCE=.\LodRangeDlg.h
# End Source File
# Begin Source File
SOURCE=.\MainFrm.h
# End Source File
# Begin Source File
SOURCE=".\MFC Gos.h"
# End Source File
# Begin Source File
SOURCE=".\MFC GosDoc.h"
# End Source File
# Begin Source File
SOURCE=".\MFC GosView.h"
# End Source File
# Begin Source File
SOURCE=.\PointLightProps.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\SlideDlg.h
# End Source File
# Begin Source File
SOURCE=.\SpotLightProps.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\ViewWnd3D.h
# End Source File
# Begin Source File
SOURCE=.\WaterDlg1.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\icon1.ico
# End Source File
# Begin Source File
SOURCE=".\res\MFC Gos.ico"
# End Source File
# Begin Source File
SOURCE=".\res\MFC Gos.rc2"
# End Source File
# Begin Source File
SOURCE=".\res\MFC GosDoc.ico"
# End Source File
# Begin Source File
SOURCE=.\res\Toolbar.bmp
# End Source File
# End Group
# End Target
# End Project
@@ -0,0 +1,179 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Adept"="..\..\Libraries\Adept\Adept.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
}}}
###############################################################################
Project: "Compost"="..\..\Libraries\Compost\Compost.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
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 MLR
End Project Dependency
Begin Project Dependency
Project_Dep_Name Stuff
End Project Dependency
}}}
###############################################################################
Project: "ERF Deluxe"=".\ERF Deluxe\ERF Deluxe.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name MFCPlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name Stuff
End Project Dependency
Begin Project Dependency
Project_Dep_Name MLR
End Project Dependency
Begin Project Dependency
Project_Dep_Name gosFX
End Project Dependency
Begin Project Dependency
Project_Dep_Name ElementRenderer
End Project Dependency
Begin Project Dependency
Project_Dep_Name Compost
End Project Dependency
Begin Project Dependency
Project_Dep_Name Adept
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "ElementRenderer"="..\..\Libraries\ElementRenderer\ElementRenderer.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "GOSScript"="..\..\..\CORETECH\Libraries\GOSScript\GOSScript.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
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: "Stuff"="..\..\Libraries\Stuff\Stuff.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "gosFX"="..\..\Libraries\gosfx\gosFX.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,710 @@
// EditMLRStateDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MFC Gos.h"
#include "EditMLRStateDlg.h"
#include <GameOS\ToolOS.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_ZBufList = -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_PZBuf = 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_ZBUFLIST, m_ZBufList);
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_ZBUF, m_PZBuf);
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)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
//}}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_ZBufList=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;
case MidLevelRenderer::MLRState::KeyedAlphaMode:
m_AlphaList=7;
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|
MidLevelRenderer::MLRState::ZBufferWriteMask) )
{
m_ZBufList=0;
if(rstate.GetZBufferWriteMode()==MidLevelRenderer::MLRState::ZBufferWriteOnMode)
{
if(rstate.GetZBufferCompareMode()==MidLevelRenderer::MLRState::ZBufferCompareOnMode)
{
m_ZBufList=1;
}
else
{
m_ZBufList=2;
}
}
else
{
if(rstate.GetZBufferCompareMode()==MidLevelRenderer::MLRState::ZBufferCompareOnMode)
{
m_ZBufList=3;
}
else
{
m_ZBufList=4;
}
}
}
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_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;
if((PerMask&MidLevelRenderer::MLRState::ZBufferCompareMask) &&
(PerMask&MidLevelRenderer::MLRState::ZBufferWriteMask))
m_PZBuf=TRUE;
else
m_PZBuf=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;
CString texname;
m_TextureText.GetWindowText(texname);
MidLevelRenderer::MLRTexture *tex = NULL;
if(rstate.GetTextureHandle() && ((tex = (*MidLevelRenderer::MLRTexturePool::Instance)[&rstate]) != NULL))
{
tex = MidLevelRenderer::MLRTexturePool::Instance->Add(texname);
rstate.SetTextureHandle(tex->GetTextureHandle());
}
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;
case 7:
rstate.SetAlphaMode(MidLevelRenderer::MLRState::KeyedAlphaMode);
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_ZBufList)
{
case 0:
RDMask=RDMask&~MidLevelRenderer::MLRState::ZBufferCompareMask;
RDMask=RDMask&~MidLevelRenderer::MLRState::ZBufferWriteMask;
break;
case 1:
rstate.SetZBufferCompareOn();
rstate.SetZBufferWriteOn();
RDMask|=MidLevelRenderer::MLRState::ZBufferCompareMask;
RDMask|=MidLevelRenderer::MLRState::ZBufferWriteMask;
break;
case 2:
rstate.SetZBufferCompareOn();
rstate.SetZBufferWriteOff();
RDMask|=MidLevelRenderer::MLRState::ZBufferCompareMask;
RDMask|=MidLevelRenderer::MLRState::ZBufferWriteMask;
break;
case 3:
rstate.SetZBufferCompareOff();
rstate.SetZBufferWriteOn();
RDMask|=MidLevelRenderer::MLRState::ZBufferCompareMask;
RDMask|=MidLevelRenderer::MLRState::ZBufferWriteMask;
break;
case 4:
rstate.SetZBufferCompareOff();
rstate.SetZBufferWriteOff();
RDMask|=MidLevelRenderer::MLRState::ZBufferCompareMask;
RDMask|=MidLevelRenderer::MLRState::ZBufferWriteMask;
break;
}
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_PZBuf?MidLevelRenderer::MLRState::ZBufferCompareMask:0;
RDMask|=m_PZBuf?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());
}
extern Stuff::MString *erf_texture_path;
void CEditMLRStateDlg::OnBrowse()
{
CString texname;
m_TextureText.GetWindowText(texname);
char *path = *erf_texture_path;
texname=CString(path)+texname;
CString pngname = texname+".png";
if (::gos_DoesFileExist(pngname))
{
texname = pngname;
}
else
texname+=".tga";
CFileDialog dlg(true,"*.png",texname,OFN_HIDEREADONLY,"Texture Files (*.png;*.tga)|*.png;*.tga||");
if (IDOK==dlg.DoModal())
{
texname = dlg.GetFileTitle();
m_TextureText.SetWindowText(texname);
}
}
@@ -0,0 +1,92 @@
#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_ZBufList;
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_PZBuf;
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 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_EDITMLRSTATEDLG_H__13CCAF64_6905_11D2_8409_00A0C933BCAC__INCLUDED_)
@@ -0,0 +1,144 @@
// ErfDataTree.cpp : implementation file
//
#include "stdafx.h"
#include "MFC Gos.h"
#include "ErfDataTree.h"
#include <GameOS\GameOS.hpp>
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\Element.hpp>
#include <ElementRenderer\StateChange.hpp>
#include <ElementRenderer\ShapeLODElement.hpp>
#include <ElementRenderer\TreeElement.hpp>
#include <MLR\MLR.hpp>
#include <MLR\MLR_I_C_PMesh.hpp>
#include <MLR\MLR_I_DT_PMesh.hpp>
#include <MLR\MLR_I_C_DT_PMesh.hpp>
/////////////////////////////////////////////////////////////////////////////
// CErfDataTree
CErfDataTree::CErfDataTree()
{
}
void CErfDataTree::SetLodValue(int level,float min,float max,HTREEITEM itm)
{
if(itm!=NULL && itm !=TVI_ROOT)
{
Stuff::RegisteredClass *rcls;
rcls=(Stuff::RegisteredClass *)GetItemData(itm);
if(rcls != 0)
{
if(rcls->IsDerivedFrom(ElementRenderer::ElementClassID))
{
ElementRenderer::Element *elmt=Cast_Pointer(ElementRenderer::Element *, rcls);
if (elmt->IsDerivedFrom(ElementRenderer::ShapeLODElementClassID))
{
ElementRenderer::ShapeLODElement *shape = Cast_Pointer(ElementRenderer::ShapeLODElement *,elmt);
ElementRenderer::LODElement::Entry new_entry;
new_entry.m_nearSquared=min*min;
new_entry.m_farSquared=max*max;
if(shape->GetSize()>level)
shape->SetLOD(level,new_entry);
}
}
}
}
HTREEITEM child=GetChildItem(itm);
while(child!=NULL)
{
SetLodValue(level,min,max,child);
child=GetNextSiblingItem(child);
}
}
void CErfDataTree::SetLodValue(int level,float min,float fadeIn,float fadeOut,float max,HTREEITEM itm)
{
if(itm!=NULL && itm !=TVI_ROOT)
{
Stuff::RegisteredClass *rcls;
rcls=(Stuff::RegisteredClass *)GetItemData(itm);
if(rcls != 0)
{
if(rcls->IsDerivedFrom(ElementRenderer::ElementClassID))
{
ElementRenderer::Element *elmt=Cast_Pointer(ElementRenderer::Element *, rcls);
if (elmt->IsDerivedFrom(ElementRenderer::TreeElementClassID))
{
ElementRenderer::TreeElement *shape = Cast_Pointer(ElementRenderer::TreeElement *,elmt);
ElementRenderer::TreeElement::Entry new_entry;
new_entry.m_nearSquared=min*min;
new_entry.m_fadeInSquared=fadeIn*fadeIn;
new_entry.m_fadeOutSquared=fadeOut*fadeOut;;
new_entry.m_farSquared=max*max;
if(shape->GetSize()>level)
shape->SetLOD(level,new_entry);
}
}
}
}
HTREEITEM child=GetChildItem(itm);
while(child!=NULL)
{
SetLodValue(level,min,fadeIn,fadeOut,max,child);
child=GetNextSiblingItem(child);
}
}
void CErfDataTree::SetAlign(int startAt,int alignType,HTREEITEM itm)
{
if(itm!=NULL && itm !=TVI_ROOT)
{
Stuff::RegisteredClass *rcls;
rcls=(Stuff::RegisteredClass *)GetItemData(itm);
if(rcls != 0)
{
if(rcls->IsDerivedFrom(ElementRenderer::ElementClassID))
{
ElementRenderer::Element *elmt=Cast_Pointer(ElementRenderer::Element *, rcls);
if (elmt->IsDerivedFrom(ElementRenderer::TreeElementClassID))
{
ElementRenderer::TreeElement *shape = Cast_Pointer(ElementRenderer::TreeElement *,elmt);
shape->m_startAligningAt = startAt;
shape->m_alignType = alignType;
}
}
}
}
HTREEITEM child=GetChildItem(itm);
while(child!=NULL)
{
SetAlign(startAt,alignType,child);
child=GetNextSiblingItem(child);
}
}
CErfDataTree::~CErfDataTree()
{
}
BEGIN_MESSAGE_MAP(CErfDataTree, CTreeCtrl)
//{{AFX_MSG_MAP(CErfDataTree)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CErfDataTree message handlers
@@ -0,0 +1,51 @@
#if !defined(AFX_ERFDATATREE_H__13CCAF62_6905_11D2_8409_00A0C933BCAC__INCLUDED_)
#define AFX_ERFDATATREE_H__13CCAF62_6905_11D2_8409_00A0C933BCAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ErfDataTree.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CErfDataTree window
class CErfDataTree : public CTreeCtrl
{
// Construction
public:
CErfDataTree();
// Attributes
public:
void SetLodValue(int level,float min,float max,HTREEITEM itm=TVI_ROOT);
void SetLodValue(int level,float min,float fadeIn,float fadeOut,float max,HTREEITEM itm=TVI_ROOT);
void SetAlign(int startAt,int alignType,HTREEITEM itm=TVI_ROOT);
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CErfDataTree)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CErfDataTree();
// Generated message map functions
protected:
//{{AFX_MSG(CErfDataTree)
// NOTE - the ClassWizard will add and remove 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_ERFDATATREE_H__13CCAF62_6905_11D2_8409_00A0C933BCAC__INCLUDED_)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,75 @@
#if !defined(AFX_ERFELEMINFOVIEW_H__CE5EB241_5F84_11D2_8408_00A0C933BCAC__INCLUDED_)
#define AFX_ERFELEMINFOVIEW_H__CE5EB241_5F84_11D2_8408_00A0C933BCAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ErfElemInfoView.h : header file
//
#include <GameOS\GameOS.hpp>
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\Element.hpp>
#include <MLR\MLR.hpp>
#include "ErfListBox.h"
/////////////////////////////////////////////////////////////////////////////
// CErfElemInfoView view
class CErfElemInfoView : public CView
{
protected:
CErfElemInfoView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CErfElemInfoView)
// Attributes
public:
CErfListBox *InfoCtrl;
// Operations
public:
void RefreshData(bool leaveempty=false);
void SetLodValue(int level,float min,float max);
void SetLodValue(int level,float min,float fadeIn,float fadeOut,float max);
void SetAlign(int startAt,int alignType);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CErfElemInfoView)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
void UpdateInfo(ElementRenderer::Element *elmt);
void UpdateInfo(MidLevelRenderer::MLRPrimitiveBase *prim);
void UpdateInfo(ElementRenderer::StateChange*);
void UpdateInfo(const MidLevelRenderer::MLRState*);
void UpdateInfo(const MidLevelRenderer::MLRStateBase*);
// Implementation
protected:
virtual ~CErfElemInfoView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CErfElemInfoView)
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_ERFELEMINFOVIEW_H__CE5EB241_5F84_11D2_8408_00A0C933BCAC__INCLUDED_)
@@ -0,0 +1,130 @@
// ErfListBox.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "ErfListBox.h"
#include "LODRangeDlg.h"
#include "ErfElemInfoView.h"
#include <GameOS\GameOS.hpp>
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\Element.hpp>
#include <ElementRenderer\StateChange.hpp>
#include <ElementRenderer\ShapeLODElement.hpp>
#include <ElementRenderer\TreeElement.hpp>
#include <MLR\MLR.hpp>
#include <MLR\MLR_I_C_PMesh.hpp>
#include <MLR\MLR_I_DT_PMesh.hpp>
#include <MLR\MLR_I_C_DT_PMesh.hpp>
/////////////////////////////////////////////////////////////////////////////
// CErfListBox
CErfListBox::CErfListBox()
{
}
CErfListBox::~CErfListBox()
{
}
BEGIN_MESSAGE_MAP(CErfListBox, CListBox)
//{{AFX_MSG_MAP(CErfListBox)
ON_CONTROL_REFLECT(LBN_DBLCLK, OnDblclk)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CErfListBox message handlers
void CErfListBox::OnDblclk()
{
int sel=GetCurSel();
if(sel>=0)
{
CEditMessage *em=(CEditMessage *)GetItemDataPtr(sel);
if(em)
switch(em->EType)
{
case CEditMessage::EM_BILLBOARD:
{
ElementRenderer::Element *elmt=(ElementRenderer::Element *)em->Data;
Check_Object(elmt);
Verify(elmt->IsDerivedFrom(ElementRenderer::TreeElementClassID) );
ElementRenderer::TreeElement *shape = Cast_Pointer(ElementRenderer::TreeElement *,elmt);
CLodRangeDlg dlg;
dlg.m_EditType = CLodRangeDlg::Billboard;
dlg.m_AlignStartAt = shape->m_startAligningAt;
dlg.m_AlignType = shape->m_alignType;
dlg.m_NumLODs = shape->GetSize();
if (elmt->IsDerivedFrom(ElementRenderer::TreeElementClassID)) {
if(dlg.DoModal()==IDOK)
{
MyView->SetAlign(dlg.m_AlignStartAt, dlg.m_AlignType);
MyView->RefreshData();
}
}
}
break;
case CEditMessage::EM_LOD:
{
ElementRenderer::Element *elmt=(ElementRenderer::Element *)em->Data;
Check_Object(elmt);
Verify(elmt->IsDerivedFrom(ElementRenderer::ShapeLODElementClassID) ||
elmt->IsDerivedFrom(ElementRenderer::TreeElementClassID) );
CLodRangeDlg dlg;
if (elmt->IsDerivedFrom(ElementRenderer::ShapeLODElementClassID)) {
ElementRenderer::ShapeLODElement *shape = Cast_Pointer(ElementRenderer::ShapeLODElement *,elmt);
Verify(shape->GetSize()>em->Index);
const ElementRenderer::LODElement::Entry *entry;
MidLevelRenderer::MLRShape *mlrshape;
shape->GetLOD(em->Index,&mlrshape,&entry);
dlg.m_Start=(float)sqrt(entry->m_nearSquared);
dlg.m_End=(float)sqrt(entry->m_farSquared);
dlg.m_EditType = CLodRangeDlg::Range;
dlg.m_NumLODs = shape->GetSize();
if(dlg.DoModal()==IDOK)
{
MyView->SetLodValue(em->Index,dlg.m_Start,dlg.m_End);
MyView->RefreshData();
}
}
if (elmt->IsDerivedFrom(ElementRenderer::TreeElementClassID)) {
ElementRenderer::TreeElement *shape = Cast_Pointer(ElementRenderer::TreeElement *,elmt);
Verify(shape->GetSize()>em->Index);
const ElementRenderer::TreeElement::Entry *entry;
MidLevelRenderer::MLRShape *mlrshape;
shape->GetLOD(em->Index,&mlrshape,&entry);
dlg.m_Start=(float)sqrt(entry->m_nearSquared);
dlg.m_FadeIn=(float)sqrt(entry->m_fadeInSquared);
dlg.m_FadeOut=(float)sqrt(entry->m_fadeOutSquared);
dlg.m_End=(float)sqrt(entry->m_farSquared);
dlg.m_EditType = CLodRangeDlg::CrossFade;
dlg.m_NumLODs = shape->GetSize();
if(dlg.DoModal()==IDOK)
{
MyView->SetLodValue(em->Index,dlg.m_Start,dlg.m_FadeIn,dlg.m_FadeOut,dlg.m_End);
MyView->RefreshData();
}
}
}
break;
}
}
}
@@ -0,0 +1,58 @@
#if !defined(AFX_ERFLISTBOX_H__505F04D5_9F6A_4B73_AA24_2A6BB55B3B77__INCLUDED_)
#define AFX_ERFLISTBOX_H__505F04D5_9F6A_4B73_AA24_2A6BB55B3B77__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ErfListBox.h : header file
//
class CErfElemInfoView;
/////////////////////////////////////////////////////////////////////////////
// CErfListBox window
class CEditMessage
{
public:
enum EDTYPE {EM_LOD,EM_BILLBOARD} ;
EDTYPE EType;
int Index;
void *Data;
};
class CErfListBox : public CListBox
{
// Construction
public:
CErfListBox();
CErfElemInfoView *MyView;
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CErfListBox)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CErfListBox();
// Generated message map functions
protected:
//{{AFX_MSG(CErfListBox)
afx_msg void OnDblclk();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ERFLISTBOX_H__505F04D5_9F6A_4B73_AA24_2A6BB55B3B77__INCLUDED_)
@@ -0,0 +1,78 @@
// InfiniteLightProps.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "InfiniteLightProps.h"
/////////////////////////////////////////////////////////////////////////////
// CInfiniteLightProps dialog
CInfiniteLightProps::CInfiniteLightProps(CWnd* pParent /*=NULL*/)
: CDialog(CInfiniteLightProps::IDD, pParent)
{
//{{AFX_DATA_INIT(CInfiniteLightProps)
m_Alpha = 0.0f;
m_Blue = 0.0f;
m_Green = 0.0f;
m_Intensity = 0.0f;
m_LocX = 0.0f;
m_LocY = 0.0f;
m_LocZ = 0.0f;
m_Red = 0.0f;
//}}AFX_DATA_INIT
}
void CInfiniteLightProps::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CInfiniteLightProps)
DDX_Text(pDX, IDC_ALPHA, m_Alpha);
DDX_Text(pDX, IDC_BLUE, m_Blue);
DDX_Text(pDX, IDC_GREEN, m_Green);
DDX_Text(pDX, IDC_INTENSITY, m_Intensity);
DDX_Text(pDX, IDC_LOCX, m_LocX);
DDX_Text(pDX, IDC_LOCY, m_LocY);
DDX_Text(pDX, IDC_LOCZ, m_LocZ);
DDX_Text(pDX, IDC_RED, m_Red);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CInfiniteLightProps, CDialog)
//{{AFX_MSG_MAP(CInfiniteLightProps)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CInfiniteLightProps message handlers
void CInfiniteLightProps::SetData(MLRInfiniteLight *light)
{
Light=*light;
m_Intensity=Light.GetIntensity();
Light.GetColor(m_Red,m_Green,m_Blue);
UnitVector3D loc;
Light.GetInWorldDirection(loc);
m_LocX=loc.x;
m_LocY=loc.y;
m_LocZ=loc.z;
}
MLRInfiniteLight &CInfiniteLightProps::GetData()
{
Light.SetIntensity(m_Intensity);
Light.SetColor(m_Red,m_Green,m_Blue);
Vector3D dir(m_LocX,m_LocY,m_LocZ);
Stuff::LinearMatrix4D mat(true);
mat.AlignLocalAxisToWorldVector(dir,Stuff::Z_Axis,Stuff::Y_Axis,Stuff::X_Axis);
Light.SetLightToWorldMatrix(mat);
return Light;
}
@@ -0,0 +1,58 @@
#if !defined(AFX_INFINITELIGHTPROPS_H__54019341_832E_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_INFINITELIGHTPROPS_H__54019341_832E_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// InfiniteLightProps.h : header file
//
#include <MLR\MLRHeaders.hpp>
/////////////////////////////////////////////////////////////////////////////
// CInfiniteLightProps dialog
class CInfiniteLightProps : public CDialog
{
// Construction
public:
MLRInfiniteLight Light;
MLRInfiniteLight &GetData();
void SetData(MLRInfiniteLight *light);
CInfiniteLightProps(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CInfiniteLightProps)
enum { IDD = IDD_INFINITELIGHT };
float m_Alpha;
float m_Blue;
float m_Green;
float m_Intensity;
float m_LocX;
float m_LocY;
float m_LocZ;
float m_Red;
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CInfiniteLightProps)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CInfiniteLightProps)
// 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_INFINITELIGHTPROPS_H__54019341_832E_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,132 @@
// LightListDlg.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "LightListDlg.h"
#include "AmbientLightProperties.h"
#include "PointLightProps.h"
#include "SpotLightProps.h"
#include "InfiniteLightProps.h"
#include <MLR\MLRHeaders.hpp>
/////////////////////////////////////////////////////////////////////////////
// CLightListDlg dialog
CLightListDlg::CLightListDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLightListDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLightListDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CLightListDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLightListDlg)
DDX_Control(pDX, IDC_LIGHTLIST, m_LightList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLightListDlg, CDialog)
//{{AFX_MSG_MAP(CLightListDlg)
ON_WM_CLOSE()
ON_LBN_DBLCLK(IDC_LIGHTLIST, OnDblclkLightlist)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLightListDlg message handlers
void CLightListDlg::OnCancel()
{
// CDialog::OnCancel();
}
void CLightListDlg::OnOK()
{
// CDialog::OnOK();
}
void CLightListDlg::OnClose()
{
ShowWindow(SW_HIDE);
// CDialog::OnClose();
}
void CLightListDlg::OnDblclkLightlist()
{
MLRLight *SelLight;
SelLight=(MLRLight *)m_LightList.GetItemDataPtr(m_LightList.GetCurSel());
gos_PushCurrentHeap(MidLevelRenderer::LightsHeap);
switch(SelLight->GetLightType())
{
case MidLevelRenderer::MLRLight::AmbientLight:
{
MLRAmbientLight *light=(MLRAmbientLight *)SelLight;
CAmbientLightProperties PropDlg;
PropDlg.SetData(light);
if(PropDlg.DoModal()==IDOK)
{
*light=PropDlg.GetData();
}
}
break;
case MidLevelRenderer::MLRLight::InfiniteLight:
{
MLRInfiniteLight *light=(MLRInfiniteLight *)SelLight;
CInfiniteLightProps PropDlg;
PropDlg.SetData(light);
if(PropDlg.DoModal()==IDOK)
{
*light=PropDlg.GetData();
}
}
break;
case MidLevelRenderer::MLRLight::PointLight:
{
MLRPointLight *light=(MLRPointLight *)SelLight;
CPointLightProps PropDlg;
PropDlg.SetData(light);
if(PropDlg.DoModal()==IDOK)
{
*light=PropDlg.GetData();
}
}
break;
case MidLevelRenderer::MLRLight::SpotLight:
{
MLRSpotLight *light=(MLRSpotLight *)SelLight;
CSpotLightProps PropDlg;
PropDlg.SetData(light);
if(PropDlg.DoModal()==IDOK)
{
PropDlg.GetData(light);
}
}
break;
case MidLevelRenderer::MLRLight::ProjectLight:
{
MLRProjectLight *light=(MLRProjectLight *)SelLight;
CSpotLightProps PropDlg;
PropDlg.SetData(light);
if(PropDlg.DoModal()==IDOK)
{
PropDlg.GetData(light);
}
}
break;
}
gos_PopCurrentHeap();
}
@@ -0,0 +1,49 @@
#if !defined(AFX_LIGHTLISTDLG_H__AA928C61_82EC_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_LIGHTLISTDLG_H__AA928C61_82EC_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// LightListDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CLightListDlg dialog
class CLightListDlg : public CDialog
{
// Construction
public:
CLightListDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CLightListDlg)
enum { IDD = IDD_LIGHTLISTDLG };
CListBox m_LightList;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLightListDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CLightListDlg)
virtual void OnCancel();
virtual void OnOK();
afx_msg void OnClose();
afx_msg void OnDblclkLightlist();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_LIGHTLISTDLG_H__AA928C61_82EC_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,131 @@
// LodRangeDlg.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "LodRangeDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLodRangeDlg dialog
CLodRangeDlg::CLodRangeDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLodRangeDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLodRangeDlg)
m_Start = 0.0f;
m_FadeIn = 0.0f;
m_FadeOut = 0.0f;
m_End = 0.0f;
m_AlignStartAt = -1;
m_AlignType = 0;
m_NumLODs = 5;
//}}AFX_DATA_INIT
}
void CLodRangeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLodRangeDlg)
DDX_Text(pDX, IDC_START, m_Start);
DDX_Text(pDX, IDC_FADEIN, m_FadeIn);
DDX_Text(pDX, IDC_FADEOUT, m_FadeOut);
DDX_Text(pDX, IDC_END, m_End);
DDX_Control(pDX, IDC_ALIGN_X, m_checkAlignX);
DDX_Control(pDX, IDC_ALIGN_Y, m_checkAlignY);
DDX_Control(pDX, IDC_ALIGN_STARTLOD, m_comboStartLOD);
//}}AFX_DATA_MAP
}
BOOL CLodRangeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Initialize the controls
// Load billboarding stuff
m_comboStartLOD.ResetContent();
for (int i=0; i<m_NumLODs; i++) {
CString str;
str.Format("LOD%d", i);
m_comboStartLOD.AddString(str);
}
m_comboStartLOD.AddString("None");
if (m_AlignStartAt<0 || m_AlignStartAt>m_NumLODs)
m_AlignStartAt = m_NumLODs;
m_comboStartLOD.SetCurSel(m_AlignStartAt);
m_checkAlignX.SetCheck(m_AlignType&ElementRenderer::Element::AlignXFlag);
m_checkAlignY.SetCheck(m_AlignType&ElementRenderer::Element::AlignYFlag);
OnSelectStartLOD();
GetDlgItem(IDC_STATICALIGN)->ShowWindow(m_EditType==Billboard?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_ALIGN_STARTLOD)->ShowWindow(m_EditType==Billboard?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_ALIGN_X)->ShowWindow(m_EditType==Billboard?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_ALIGN_Y)->ShowWindow(m_EditType==Billboard?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_FADEIN)->ShowWindow(m_EditType==CrossFade?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_FADEOUT)->ShowWindow(m_EditType==CrossFade?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_STATICFADEIN)->ShowWindow(m_EditType==CrossFade?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_STATICFADEOUT)->ShowWindow(m_EditType==CrossFade?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_START)->ShowWindow(m_EditType!=Billboard?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_END)->ShowWindow(m_EditType!=Billboard?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_STATICSTART)->ShowWindow(m_EditType!=Billboard?SW_SHOW:SW_HIDE);
GetDlgItem(IDC_STATICEND)->ShowWindow(m_EditType!=Billboard?SW_SHOW:SW_HIDE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CLodRangeDlg::OnOK()
{
// Save billboarding stuff
CString str;
this->m_comboStartLOD.GetWindowText(str);
if (str != "None") {
bool bAlignX = this->m_checkAlignX.GetCheck() != 0;
bool bAlignY = this->m_checkAlignY.GetCheck() != 0;
m_AlignStartAt = atoi(str.Right(1));
m_AlignType = 0;
if (bAlignX || bAlignY)
{
if (bAlignX && bAlignY)
m_AlignType = ElementRenderer::Element::AlignXFlag|ElementRenderer::Element::AlignYFlag;
else if (bAlignX)
m_AlignType = ElementRenderer::Element::AlignXFlag;
else if (bAlignY)
m_AlignType = ElementRenderer::Element::AlignYFlag;
}
}
else {
m_AlignStartAt = m_NumLODs;
m_AlignType = 0;
}
CDialog::OnOK();
}
void CLodRangeDlg::OnSelectStartLOD()
{
CString startLOD;
m_comboStartLOD.GetLBText(m_comboStartLOD.GetCurSel(), startLOD);
m_checkAlignX.EnableWindow(startLOD!="None" && m_comboStartLOD.IsWindowEnabled());
m_checkAlignY.EnableWindow(startLOD!="None" && m_comboStartLOD.IsWindowEnabled());
}
BEGIN_MESSAGE_MAP(CLodRangeDlg, CDialog)
//{{AFX_MSG_MAP(CLodRangeDlg)
// NOTE: the ClassWizard will add message map macros here
ON_CBN_SELCHANGE(IDC_ALIGN_STARTLOD, OnSelectStartLOD)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLodRangeDlg message handlers
@@ -0,0 +1,61 @@
#if !defined(AFX_LODRANGEDLG_H__960218EE_9FC3_4FDF_ABB3_948F9520FB52__INCLUDED_)
#define AFX_LODRANGEDLG_H__960218EE_9FC3_4FDF_ABB3_948F9520FB52__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// LodRangeDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CLodRangeDlg dialog
class CLodRangeDlg : public CDialog
{
// Construction
public:
CLodRangeDlg(CWnd* pParent = NULL); // standard constructor
typedef enum {Range, CrossFade, Billboard} EditType;
EditType m_EditType;
// Dialog Data
//{{AFX_DATA(CLodRangeDlg)
enum { IDD = IDD_LODRANGE };
float m_Start;
float m_FadeIn;
float m_FadeOut;
float m_End;
CButton m_checkAlignX;
CButton m_checkAlignY;
CComboBox m_comboStartLOD;
int m_AlignStartAt;
int m_AlignType;
int m_NumLODs;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLodRangeDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
virtual BOOL OnInitDialog();
virtual void OnOK();
// Generated message map functions
//{{AFX_MSG(CLodRangeDlg)
// NOTE: the ClassWizard will add member functions here
afx_msg void OnSelectStartLOD();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_LODRANGEDLG_H__960218EE_9FC3_4FDF_ABB3_948F9520FB52__INCLUDED_)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,109 @@
// MFC Gos.h : main header file for the MFC GOS application
//
#if !defined(AFX_MFCGOS_H__931C70E4_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
#define AFX_MFCGOS_H__931C70E4_5D05_11D2_8408_00A0C933BCAC__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"ViewWnd3D.h"
void _stdcall DoGameLogic();
/////////////////////////////////////////////////////////////////////////////
// CMFCGosApp:
// See MFC Gos.cpp for the implementation of this class
//
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\GroupElement.hpp>
#include <ElementRenderer\CameraElement.hpp>
#include <ElementRenderer\StateChange.hpp>
#include <ElementRenderer\PointCloudElement.hpp>
#include <gosFX\gosFX.hpp>
#include <MLR\MLR.hpp>
#include <GameOS\GameOS.hpp>
#include <MLR\MLRHeaders.hpp>
#include <stuff\stuff.hpp>
#define _INC_NEW
#include <AFXTEMPL.H>
struct BumpAnime {
BumpAnime() { water = 0; bump = 0; normal = 0; wu = 0.0f; wv = 0.0f; bu = 0.0f; bv = 0.0f; nu = 0.0f; nv = 0.0f; }
DWORD water;
DWORD bump;
DWORD normal;
Scalar wu, wv;
Scalar bu, bv;
Scalar nu, nv;
};
extern BumpAnime bumpAnime;
class CMFCGosApp : public CWinApp
{
public:
void UpdateLightList();
void DrawScreen();
void UpdateCameraFromKeyMessage(UINT message, WPARAM wParam, LPARAM lParam);
bool GOSActive;
void GosShutDown();
BOOL ProcessShellCommandOnlyLoad(CCommandLineInfo& rCmdInfo);
BOOL ProcessShellCommandNoLoad(CCommandLineInfo& rCmdInfo);
void NewTexturePath();
void GetTexturePath();
void NewEffectsPath();
void GetEffectsPath();
CMFCGosApp();
ViewWnd3D *Window3D;
CString TexturePath,EffectsPath;
bool DrawOnIdle;
void OnFileNewExternal() {CWinApp::OnFileNew();}
// Stuff::FileStream * m_perf_file;
CList<Stuff::FileStream*, Stuff::FileStream*> m_pFileSet_List;
HashOf<Stuff::PlugOf<Stuff::MString*>*, DWORD>*m_phashErfNameMapping;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMFCGosApp)
public:
virtual BOOL InitInstance();
virtual BOOL OnIdle(LONG lCount);
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CMFCGosApp)
afx_msg void OnAppAbout();
afx_msg void OnOptionsTexturepath();
afx_msg void OnView3dviewwindow();
afx_msg void OnUpdateView3dviewwindow(CCmdUI* pCmdUI);
afx_msg void OnViewUpdateonidle();
afx_msg void OnUpdateViewUpdateonidle(CCmdUI* pCmdUI);
afx_msg void OnWindowsLightlist();
afx_msg void OnUpdateWindowsLightlist(CCmdUI* pCmdUI);
//}}AFX_MSG
afx_msg void OnExpandAll();
afx_msg void OnCollapseAll();
void OnFileOpen();
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MFCGOS_H__931C70E4_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,97 @@
// MFC GosDoc.h : interface of the CMFCGosDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MFCGOSDOC_H__931C70EA_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
#define AFX_MFCGOSDOC_H__931C70EA_5D05_11D2_8408_00A0C933BCAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <GameOS\GameOS.hpp>
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\Element.hpp>
#include <MLR\MLR.hpp>
class CMFCGosDoc;
CMFCGosDoc * GetActiveErfDocument();
class SIMPLEHEIRARCHY
{
public:
CList<SIMPLEHEIRARCHY *, SIMPLEHEIRARCHY *> listChildren;
Stuff::LinearMatrix4D lmLocalToWorld;
CString strPageName;
static SIMPLEHEIRARCHY * BuildHeirarchy(LPCSTR lpszChildToMake, Stuff::LinearMatrix4D lmParentLocalToWorld,
Stuff::NotationFile * pNoteFile);
static void DeleteHeirarchy(SIMPLEHEIRARCHY * pNode);
SIMPLEHEIRARCHY * FindInHeirarchy(LPCSTR lpszChildToFind);
} ;
class CMFCGosDoc : public CDocument
{
protected: // create from serialization only
CMFCGosDoc();
DECLARE_DYNCREATE(CMFCGosDoc)
// Attributes
public:
ElementRenderer::Element *cele;
MidLevelRenderer::MLRPrimitiveBase *cmlr;
bool UnStable;
Stuff::Sphere sphereCamera;
SIMPLEHEIRARCHY * m_sHeirarchy;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMFCGosDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
BOOL OnOpenMultipleDocumentsInit();
BOOL OnOpenMultipleDocumentsAddFile(LPCTSTR lpszPathName);
BOOL OnOpenMultipleDocumentsEnd();
void AdjustMeshToArmatureIfAvailable(LPCSTR lpszPathName, Stuff::LinearMatrix4D *pltwObjectArmaturePlacement);
// Implementation
public:
virtual ~CMFCGosDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CMFCGosDoc)
afx_msg void OnFileReload();
afx_msg void OnEditAddlightAmbientlight();
afx_msg void OnEditAddlightInfinitelight();
afx_msg void OnEditAddlightPointlight();
afx_msg void OnEditAddlightSpotlight();
afx_msg void OnEditAddlightProjectlight();
afx_msg void OnViewBumpmaptest();
afx_msg void OnViewWatertest();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MFCGOSDOC_H__931C70EA_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
@@ -0,0 +1,827 @@
// MFC GosView.cpp : implementation of the CMFCGosView class
//
#include "stdafx.h"
#include "MFC Gos.h"
#include "MFC GosDoc.h"
#include "MFC GosView.h"
#include <GameOS\GameOS.hpp>
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\GroupElement.hpp>
#include <ElementRenderer\StateChange.hpp>
#include <ElementRenderer\CameraElement.hpp>
#include <ElementRenderer\ShapeElement.hpp>
#include <ElementRenderer\ListElement.hpp>
#include <ElementRenderer\GridElement.hpp>
#include <ElementRenderer\SwitchElement.hpp>
#include <ElementRenderer\LODElement.hpp>
#include <ElementRenderer\MultiLODElement.hpp>
#include <ElementRenderer\ShapeLODElement.hpp>
#include <ElementRenderer\TreeElement.hpp>
#include <MLR\MLR_I_L_TMesh.hpp>
#include "EditMLRStateDlg.h"
extern CMFCGosApp theApp;
extern ElementRenderer::GroupElement *Scene;
extern MidLevelRenderer::DrawEffectInformation *drawEffectInfo[2];
extern Stuff::RGBAColor Color_Data[2][2*MidLevelRenderer::Limits::Max_Number_Vertices_Per_Mesh];
extern bool drawPointsYes, drawNormalsYes;
extern CList<Stuff::MString*, Stuff::MString*> m_pErf_Name_List;
Stuff::Point3D Normal_Data[2*MidLevelRenderer::Limits::Max_Number_Vertices_Per_Mesh];
/////////////////////////////////////////////////////////////////////////////
// CMFCGosView
IMPLEMENT_DYNCREATE(CMFCGosView, CView)
BEGIN_MESSAGE_MAP(CMFCGosView, CView)
//{{AFX_MSG_MAP(CMFCGosView)
ON_WM_SIZE()
ON_COMMAND(ID_FILE_IMPORT, OnFileImport)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMFCGosView construction/destruction
CMFCGosView *CMFCGosView::Instance;
CMFCGosView::CMFCGosView()
{
erftree=NULL;
imlist=NULL;
CMFCGosView::Instance=this;
}
CMFCGosView::~CMFCGosView()
{
if(imlist)
{
delete imlist;
imlist=NULL;
}
if(erftree)
{
delete erftree;
erftree=NULL;
}
}
BOOL CMFCGosView::PreCreateWindow(CREATESTRUCT& cs)
{
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CMFCGosView drawing
void CMFCGosView::OnDraw(CDC* pDC)
{
CMFCGosDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
}
/////////////////////////////////////////////////////////////////////////////
// CMFCGosView diagnostics
#ifdef _DEBUG
void CMFCGosView::AssertValid() const
{
CView::AssertValid();
}
void CMFCGosView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CMFCGosDoc* CMFCGosView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMFCGosDoc)));
return (CMFCGosDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMFCGosView message handlers
LRESULT CMFCGosView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
return CView::WindowProc(message, wParam, lParam);
}
void CMFCGosView::OnInitialUpdate()
{
CView::OnInitialUpdate();
if(!imlist)
{
imlist=new CImageList;
imlist->Create(16,16,ILC_COLOR24|ILC_MASK,4,0);
imlist->Add(ExtractIcon(theApp.m_hInstance,"shell32.dll",12));
imlist->Add(ExtractIcon(theApp.m_hInstance,"shell32.dll",24));
imlist->Add(::LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON3D)));
imlist->Add(::LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME)));
}
if(!erftree)
{
CRect rct;
GetClientRect(&rct);
erftree=new CErfDataTree;
erftree->Create(TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_EDITLABELS,
rct,this,NULL);
erftree->SetImageList(imlist,TVSIL_NORMAL);
}
erftree->DeleteAllItems();
if(Scene!=NULL)
{
AddErfBranch(TVI_ROOT, Scene);
}
else
{
HTREEITEM tmpitm;
tmpitm=erftree->InsertItem("empty",0,1,TVI_ROOT,TVI_LAST);
erftree->SetItemData(tmpitm,0);
}
erftree->ShowWindow(SW_SHOW);
}
BOOL CMFCGosView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
BOOL ret;
ret=CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
return ret;
}
BOOL CMFCGosView::DestroyWindow()
{
// TODO: Add your specialized code here and/or call the base class
delete imlist;
delete erftree;
return CView::DestroyWindow();
}
void CMFCGosView::AddErfBranch(HTREEITEM node, ElementRenderer::Element *elmt)
{
if(elmt->GetClassID()== ElementRenderer::CameraElementClassID)
{
return;
}
HTREEITEM tmpitm;
CString strTemp;
Stuff::MString * pTempMString=NULL;
PlugOf<MString *>* pTemp = ((*(theApp.m_phashErfNameMapping))
.Find( (DWORD)(void*)elmt ));
if (pTemp && (pTempMString = (pTemp->GetItem()) )!=NULL)
{
strTemp.Format("%s : %s", (LPCSTR)(*pTempMString), (LPCSTR)(elmt->GetClassString()));
}
else
{
strTemp.Format("%s", (LPCSTR)(elmt->GetClassString()));
}
tmpitm = erftree->InsertItem((LPCSTR)strTemp, 0, 1, node, TVI_LAST);
erftree->SetItemData(tmpitm,(DWORD) elmt);
//tmpitm=erftree->InsertItem("Root",0,1,node,TVI_LAST);
switch(elmt->GetClassID())
{
/*
case ElementRenderer::FXElementClassID:
{
}
break;
*/
case ElementRenderer::GroupElementClassID:
{
ElementRenderer::GroupElement *group = Cast_Pointer(ElementRenderer::GroupElement *, elmt);
Stuff::ChainIteratorOf<ElementRenderer::Element*> *children = group->MakeIterator();
Register_Object(children);
ElementRenderer::Element *child = NULL;
while ((child = children->ReadAndNext()) != NULL)
{
AddErfBranch(tmpitm, child);
}
Unregister_Object(children);
delete children;
}
break;
case ElementRenderer::ListElementClassID:
{
ElementRenderer::ListElement *group = Cast_Pointer(ElementRenderer::ListElement *, elmt);
for(int i=0;i<group->GetActiveCount();i++)
{
AddErfBranch(tmpitm,group->GetIndexedElement(i));
}
}
break;
case ElementRenderer::GridElementClassID:
{
ElementRenderer::GridElement *group = Cast_Pointer(ElementRenderer::GridElement *, elmt);
unsigned char xSize, zSize;
group->GetSize(&xSize, &zSize);
for(int i=0;i<zSize;i++)
for(int j=0;j<xSize;j++)
{
AddErfBranch(tmpitm, group->GetIndexedElement(i, j));
}
}
break;
case ElementRenderer::LODElementClassID:
{
ElementRenderer::ListElement *group = Cast_Pointer(ElementRenderer::ListElement *, elmt);
for(int i=0;i<group->GetActiveCount();i++)
{
AddErfBranch(tmpitm,group->GetIndexedElement(i));
}
}
break;
case ElementRenderer::PointCloudElementClassID:
{
}
break;
case ElementRenderer::ScalableShapeElementClassID:
{
ElementRenderer::ShapeElement *group = Cast_Pointer(ElementRenderer::ShapeElement *, elmt);
MidLevelRenderer::MLRShape *shape=group->GetMLRShape();
for(int i=0;i<shape->GetNum();i++)
{
AddErfBranch(tmpitm,shape->Find(i));
}
}
break;
case ElementRenderer::ScreenQuadsElementClassID:
{
}
break;
case ElementRenderer::ShapeElementClassID:
{
ElementRenderer::ShapeElement *group = Cast_Pointer(ElementRenderer::ShapeElement *, elmt);
MidLevelRenderer::MLRShape *shape=group->GetMLRShape();
for(int i=0;i<shape->GetNum();i++)
{
AddErfBranch(tmpitm,shape->Find(i));
}
}
break;
case ElementRenderer::SwitchElementClassID:
{
ElementRenderer::ListElement *group = Cast_Pointer(ElementRenderer::ListElement *, elmt);
for(int i=0;i<group->GetActiveCount();i++)
{
AddErfBranch(tmpitm,group->GetIndexedElement(i));
}
}
break;
case ElementRenderer::TriangleCloudElementClassID:
{
}
break;
case ElementRenderer::MultiLODElementClassID:
{
ElementRenderer::MultiLODElement *group = Cast_Pointer(ElementRenderer::MultiLODElement *, elmt);
for(int i=0;i<group->GetActiveCount();i++)
{
AddErfBranch(tmpitm,group->GetIndexedElement(i));
}
}
break;
case ElementRenderer::ShapeLODElementClassID:
{
ElementRenderer::ShapeLODElement *group = Cast_Pointer(ElementRenderer::ShapeLODElement *, elmt);
for(int i=0;i<group->GetSize();i++)
{
MidLevelRenderer::MLRShape *shape;
const ElementRenderer::LODElement::Entry *entry;
group->GetLOD(i,&shape,&entry);
HTREEITEM hChild = erftree->InsertItem((LPCSTR)(shape->GetClassString()), 0, 1, tmpitm, TVI_LAST);
erftree->SetItemData(hChild,(DWORD) shape);
for(int j=0;j<shape->GetNum();j++)
{
AddErfBranch(hChild,shape->Find(j));
}
}
}
break;
case ElementRenderer::TreeElementClassID:
{
ElementRenderer::TreeElement *group = Cast_Pointer(ElementRenderer::TreeElement *, elmt);
for(int i=0;i<group->GetSize();i++)
{
MidLevelRenderer::MLRShape *shape;
const ElementRenderer::TreeElement::Entry *entry;
group->GetLOD(i,&shape,&entry);
HTREEITEM hChild = erftree->InsertItem((LPCSTR)(shape->GetClassString()), 0, 1, tmpitm, TVI_LAST);
erftree->SetItemData(hChild,(DWORD) shape);
for(int j=0;j<shape->GetNum();j++)
{
AddErfBranch(hChild,shape->Find(j));
}
}
}
break;
}
}
void CMFCGosView::AddErfBranch(HTREEITEM node,MidLevelRenderer::MLRPrimitiveBase *prim)
{
HTREEITEM tmpitm;
CString strTemp;
Stuff::MString * pTempMString=NULL;
PlugOf<MString *>* pTemp = ((*(theApp.m_phashErfNameMapping))
.Find( (DWORD)(void*)prim ));
if (pTemp && (pTempMString = (pTemp->GetItem()) )!=NULL)
// if ((pTempMString = (((*(theApp.m_phashErfNameMapping)).Find((DWORD)(void*)prim))->GetItem()))!=NULL)
{
strTemp.Format("%s : %s", (LPCSTR)(*pTempMString), (LPCSTR)(prim->GetClassString()));
}
else
{
strTemp.Format("%s", (LPCSTR)(prim->GetClassString()));
}
tmpitm=erftree->InsertItem((LPCSTR)strTemp,0,1,node,TVI_LAST);
erftree->SetItemData(tmpitm,(DWORD) prim);
switch(prim->GetClassID())
{
case MidLevelRenderer::MLR_I_PMeshClassID:
{
}
break;
case MidLevelRenderer::MLR_I_C_PMeshClassID:
{
}
break;
case MidLevelRenderer::MLR_I_L_PMeshClassID:
{
}
break;
case MidLevelRenderer::MLR_I_DT_PMeshClassID:
{
}
break;
case MidLevelRenderer::MLR_I_C_DT_PMeshClassID:
{
}
break;
case MidLevelRenderer::MLR_I_L_DT_PMeshClassID:
{
}
break;
}
}
BOOL CMFCGosView::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
LPNMHDR msg=(LPNMHDR )lParam;
CDocument* pDoc = GetDocument();
CMFCGosDoc *GDoc=(CMFCGosDoc *)pDoc;
//if(GDoc->UnStable) return ;
switch(msg->code)
{
case NM_DBLCLK :
{
Stuff::RegisteredClass *rcls;
rcls=(Stuff::RegisteredClass *)erftree->GetItemData(erftree->GetSelectedItem( ));
if(rcls != 0)
{
GDoc->cele=NULL;
GDoc->cmlr=NULL;
if(rcls->IsDerivedFrom(ElementRenderer::ElementClassID))
{
CEditMLRStateDlg dlg1;
ElementRenderer::Element *prim;
prim=Cast_Pointer(ElementRenderer::Element *, rcls);
GDoc->cele=prim;
ElementRenderer::StateChange *schange;
schange=prim->GetStateChange();
if(schange==NULL)
{
schange=new ElementRenderer::StateChange;
prim->AdoptStateChange(schange);
Register_Object(schange);
}
Stuff::DynamicArrayOf< MidLevelRenderer::MLRState> States(1);
States[0]=schange->GetMLRState();
dlg1.SetStates(&States);
if(dlg1.DoModal()==IDOK)
{
schange->SetMLRState(States[0]);
GDoc->SetModifiedFlag();
}
}
else
{
CEditMLRStateDlg dlg1;
if(rcls->IsDerivedFrom(MidLevelRenderer::MLRPrimitiveBaseClassID))
{
MidLevelRenderer::MLRPrimitiveBase *prim;
prim=Cast_Pointer(MidLevelRenderer::MLRPrimitiveBase *, rcls);
GDoc->cmlr=prim;
Stuff::DynamicArrayOf< MidLevelRenderer::MLRState> States(prim->GetNumPasses());
for(int i=0;i<prim->GetNumPasses();i++)
{
States[i]=prim->GetReferenceState(i);
}
dlg1.SetStates(&States);
if(dlg1.DoModal()==IDOK)
{
for(i=0;i<prim->GetNumPasses();i++)
{
prim->SetReferenceState(States[i],i);
}
GDoc->SetModifiedFlag();
}
}
else
{
// rcls is a mlrshape
MidLevelRenderer::MLRShape *shape;
shape=Cast_Pointer(MidLevelRenderer::MLRShape *, rcls);
}
}
GDoc->UpdateAllViews(this);
}
}
break;
case TVN_SELCHANGED:
if(!GDoc->UnStable)
{
drawPointsYes = false;
drawNormalsYes = false;
Stuff::RegisteredClass *rcls;
rcls=(Stuff::RegisteredClass *)erftree->GetItemData(erftree->GetSelectedItem( ));
if(rcls != 0)
{
GDoc->cmlr=NULL;
if(rcls->IsDerivedFrom(ElementRenderer::ElementClassID))
{
ElementRenderer::Element *elmt = Cast_Object(ElementRenderer::Element *, rcls);
if(GDoc->cele!=NULL)
{
// GDoc->cele->SetInvisibleBounds();
}
GDoc->cele = elmt;
// GDoc->cele->SetGreenBounds();
}
else
{
if(rcls->IsDerivedFrom(MidLevelRenderer::MLRPrimitiveBaseClassID))
{
if(GDoc->cele!=NULL)
{
// GDoc->cele->SetInvisibleBounds();
GDoc->cele=NULL;
}
MidLevelRenderer::MLRPrimitiveBase *prim;
prim=Cast_Pointer(MidLevelRenderer::MLRPrimitiveBase *, rcls);
GDoc->cmlr=prim;
//Set Point Cloud Here
Stuff::RegisteredClass *pcls;
HTREEITEM selitm=erftree->GetSelectedItem();
do
{
selitm=erftree->GetParentItem(selitm);
pcls=(Stuff::RegisteredClass *)erftree->GetItemData(selitm);
}
while(!pcls || !pcls->IsDerivedFrom(ElementRenderer::ElementClassID));
if(pcls != 0)
{
if(pcls->IsDerivedFrom(ElementRenderer::ElementClassID))
{
ElementRenderer::Element *ParElmt;
ParElmt=Cast_Pointer(ElementRenderer::Element *, pcls);
const Stuff::Point3D *points;
static int point_count;
prim->GetCoordData(&points, &point_count);
drawEffectInfo[0]->effect->SetData(
&point_count,
points,
Color_Data[0]
);
drawEffectInfo[0]->effectToWorld = &ParElmt->GetLocalToWorld();
drawPointsYes = true;
const Stuff::Vector3D *normals;
static int normal_count;
if(rcls->IsDerivedFrom(MidLevelRenderer::MLR_I_L_TMeshClassID))
{
MidLevelRenderer::MLR_I_L_TMesh *nprim=Cast_Pointer(MidLevelRenderer::MLR_I_L_TMesh *, rcls);
nprim->GetNormalData(&normals, &normal_count);
for(int i=0;i<normal_count;i++)
{
Normal_Data[2*i] = points[i];
Normal_Data[2*i+1].AddScaled(points[i], normals[i], 3.0f);
Color_Data[1][2*i+1].red = normals[i].x*0.2f + 0.2f;
Color_Data[1][2*i+1].green = normals[i].y*0.1f + 0.9f;
Color_Data[1][2*i+1].blue = normals[i].y*0.2f + 0.2f;
}
normal_count *= 2;
drawEffectInfo[1]->effect->SetData(
&normal_count,
Normal_Data,
Color_Data[1]
);
drawEffectInfo[1]->effectToWorld = &ParElmt->GetLocalToWorld();
drawNormalsYes = true;
}
}// end else rcls elementclassid
}// end of pcls !=0
}// end of rcls primitiveclassid
else
{
// rcls is an MLRShape?
if(GDoc->cele!=NULL)
{
// GDoc->cele->SetInvisibleBounds();
GDoc->cele=NULL;
}
MidLevelRenderer::MLRShape *shape;
shape=Cast_Pointer(MidLevelRenderer::MLRShape *, rcls);
}
}// end else rcls elementclassid
GDoc->UpdateAllViews(this);
} //end of rcls=!=0
}//end of ! Unstable
break;
}
return CView::OnNotify(wParam, lParam, pResult);
}
void CMFCGosView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
if(erftree)
{
erftree->SetWindowPos(NULL,0,0,cx,cy,SWP_NOZORDER|SWP_NOMOVE|SWP_SHOWWINDOW);
}
// TODO: Add your message handler code here
}
void CMFCGosView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
if(lHint)
{
drawPointsYes = false;
drawNormalsYes = false;
OnInitialUpdate();
}
}
extern ElementRenderer::StateChange *Camera_State;
extern ElementRenderer::CameraElement *Camera;
extern Stuff::Point3D Camera_LookAt;
extern Stuff::YawPitchRange Camera_Direction;
void CMFCGosView::OnFileImport()
{
CFileDialog dlg1(TRUE,"mlr",NULL,NULL,"MLR Geometry(*.mlr)|*.mlr||",this);
if(dlg1.DoModal()==IDOK)
{
CString tstr(dlg1.GetPathName());
Stuff::MString erf_name((LPCSTR)tstr);
Check_Object(Stuff::FileStreamManager::Instance);
gos_PushCurrentHeap(MidLevelRenderer::ShapeHeap);
Stuff::FileStream * erf_file = new Stuff::FileStream(erf_name);
int mlr_version = MidLevelRenderer::ReadMLRVersion(erf_file);
OBB obb;
*erf_file >> obb;
MidLevelRenderer::MLRShape *shape;
if(mlr_version>13)
{
RegisteredClass::ClassID class_id;
*erf_file >> class_id;
switch(class_id)
{
case MidLevelRenderer::MLRShapeClassID:
shape = MLRShape::Make(erf_file, mlr_version);
break;
case MidLevelRenderer::MLRCulturShapeClassID:
shape = MLRCulturShape::Make(erf_file, mlr_version);
break;
}
}
else
{
shape = MidLevelRenderer::MLRShape::Make(
erf_file,
mlr_version
);
}
gos_PopCurrentHeap();
gos_PushCurrentHeap(ElementRenderer::ShapeElement::s_Heap);
ElementRenderer::ShapeElement *eshape = new ElementRenderer::ShapeElement;
gos_PopCurrentHeap();
eshape->SetMLRShape(shape);
// eshape->NeedNewBounds();
// Scene->NeedMatrixSync();
eshape->m_localOBB = obb;
Unregister_Object(Scene);
delete Scene;
Stuff::FileStream * pFile;
POSITION pos = NULL;
while ((pos = theApp.m_pFileSet_List.GetHeadPosition()) != NULL)
{
pFile = theApp.m_pFileSet_List.GetHead();
delete pFile;
theApp.m_pFileSet_List.RemoveHead();
}
theApp.m_pFileSet_List.AddHead(erf_file);
m_pErf_Name_List.AddTail(new Stuff::MString((LPCSTR)erf_name));
(*(theApp.m_phashErfNameMapping)).AddValue(new Stuff::PlugOf<MString *> (m_pErf_Name_List.GetTail()), (DWORD)(void*)eshape);
Register_Object(m_pErf_Name_List.GetTail());
Scene = new ElementRenderer::GroupElement;
Register_Object(Scene);
Scene->LockBounds();
Scene->AttachChild(eshape);
eshape->SetVolumeCullMode();
//---------------
// Build a camera
//---------------
//
Camera_State = new ElementRenderer::StateChange();
Register_Object(Camera_State);
Camera_State->EnableBackfaceCulling();
Camera_State->EnableDithering();
Camera_State->EnablePerspectiveCorrection();
Camera_State->EnableZBufferWrite();
Camera_State->EnableZBufferCompare();
Camera = new ElementRenderer::CameraElement(Camera_State);
Register_Object(Camera);
Scene->AttachChild(Camera);
Camera->SetPerspective(1.0f, 1000.0f, Stuff::Pi_Over_3);
Camera->SetScene(Scene);
Camera->SetScene(Scene);
Scene->Sync();
// Camera_LookAt = eshape->m_localOBB.localToParent;
Camera_Direction.range = (eshape->m_localOBB.sphereRadius>Stuff::SMALL ? eshape->m_localOBB.sphereRadius : 10.0f) * 2.0f;
//
//-----------------------------------------------------
// Sync the matrices of the scene and load the textures
//-----------------------------------------------------
//
MidLevelRenderer::MLRTexturePool::Instance->LoadImages();
GetDocument()->UpdateAllViews(NULL,1);
theApp.DrawScreen();
GetDocument()->UnStable=false;
}
}
void CMFCGosView::OnExpandAll()
{
if (!erftree)
return;
if (!erftree->GetRootItem())
return;
ExpandTreeData(erftree, erftree->GetRootItem(), true);
}
void CMFCGosView::ExpandTreeData(CErfDataTree * tree, HTREEITEM hItem, BOOL expand)
{
HTREEITEM hTempItem = hItem;
if (!hItem)
return;
do
{
HTREEITEM hChildItem = tree->GetNextItem(hTempItem, TVGN_CHILD);
tree->Expand(hTempItem, expand ? TVE_EXPAND : TVE_COLLAPSE );
ExpandTreeData(tree, hChildItem, expand);
} while (hTempItem = erftree->GetNextItem(hTempItem, TVGN_NEXT));
}
void CMFCGosView::OnCollapseAll()
{
if (!erftree)
return;
ExpandTreeData(erftree, erftree->GetRootItem(), false);
}
@@ -0,0 +1,88 @@
// MFC GosView.h : interface of the CMFCGosView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MFCGOSVIEW_H__931C70EC_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
#define AFX_MFCGOSVIEW_H__931C70EC_5D05_11D2_8408_00A0C933BCAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <GameOS\GameOS.hpp>
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\Element.hpp>
#include <MLR\MLR.hpp>
#include"MFC GOSDoc.h"
#include"ErfDataTree.h"
class CMFCGosView : public CView
{
protected: // create from serialization only
CMFCGosView();
DECLARE_DYNCREATE(CMFCGosView)
// Attributes
public:
CMFCGosDoc* GetDocument();
CImageList *imlist;
CErfDataTree *erftree;
static CMFCGosView *Instance;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMFCGosView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
virtual BOOL DestroyWindow();
protected:
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
public:
void AddErfBranch(HTREEITEM node, ElementRenderer::Element *elmt);
void AddErfBranch(HTREEITEM node, MidLevelRenderer::MLRPrimitiveBase *prim);
void OnExpandAll();
void OnCollapseAll();
void ExpandTreeData(CErfDataTree * tree, HTREEITEM hItem, BOOL expand);
virtual ~CMFCGosView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CMFCGosView)
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnFileImport();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in MFC GosView.cpp
inline CMFCGosDoc* CMFCGosView::GetDocument()
{ return (CMFCGosDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MFCGOSVIEW_H__931C70EC_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
@@ -0,0 +1,233 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include <ElementRenderer\ElementRendererHeaders.hpp>
#include "MFC Gos.h"
#include "MainFrm.h"
extern ElementRenderer::StateChange *Camera_State;
extern CMFCGosApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
ON_WM_CREATE()
ON_WM_CLOSE()
ON_WM_DROPFILES()
//}}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()
{
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndDlgBar.Create(this, IDR_MAINFRAME,
CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
{
TRACE0("Failed to create dialogbar\n");
return -1; // fail to create
}
if (!m_wndReBar.Create(this) ||
!m_wndReBar.AddBar(&m_wndToolBar) ||
!m_wndReBar.AddBar(&m_wndDlgBar))
{
TRACE0("Failed to create rebar\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
}
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
return CFrameWnd::WindowProc(message, wParam, lParam);
}
BOOL CMainFrame::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// CG: The following block was added by the Splitter Bar component.
{
/*
if (!m_wndSplitter.Create(this,
1, 2, // TODO: adjust the number of rows, columns
CSize(10, 10), // TODO: adjust the minimum pane size
pContext))
{
TRACE0("Failed to create splitter bar ");
return FALSE; // failed to create
}
*/
if (!m_wndSplitter.CreateStatic(this,1,2))
{
TRACE0("Failed to create split bar ");
return FALSE; // failed to create
}
CRect rct;
GetClientRect(&rct);
m_wndSplitter.CreateView(0,0, RUNTIME_CLASS(CMFCGosView),
CSize((rct.Width()*2)/3,(rct.Height())),pContext);
m_wndSplitter.CreateView(0,1, RUNTIME_CLASS(CErfElemInfoView),
CSize((rct.Width())/3,(rct.Height())),pContext);
InitialUpdateFrame(NULL,TRUE);
/*
CMFCGosView *view;
view=(CMFCGosView *)m_wndSplitter.GetPane(0,0);
view->View=VIEW_TREE;
view=(CMFCGosView *)m_wndSplitter.GetPane(0,1);
view->View=VIEW_INFO;
*/
return TRUE;
}
}
void CMainFrame::BalanceFrames()
{
int rx1,min;
int rx2;
m_wndSplitter.GetColumnInfo(0,rx1,min);
m_wndSplitter.GetColumnInfo(1,rx2,min);
rx1=((rx2-rx1)*2)/3;
m_wndSplitter.SetColumnInfo(0,rx1,10);
m_wndSplitter.RecalcLayout();
//GetClientRect(&OldRect);
}
void CMainFrame::OnClose()
{
// TODO: Add your message handler code here and/or call default
Camera_State=NULL;
// theApp.GosShutDown();
CFrameWnd::OnClose();
}
void CMainFrame::OnDropFiles(HDROP hDropInfo)
{
char szTempStorage[64*1024+1] = "";
char * tmp = szTempStorage;
SetActiveWindow(); // activate us first !
UINT nFiles = ::DragQueryFile(hDropInfo, (UINT)-1, NULL, 0);
if (nFiles >= 64)
{
MessageBox("Too many files. Files > 64.", "Error", MB_OK);
return;
}
CMFCGosApp* pApp = (CMFCGosApp *)AfxGetApp();
ASSERT(pApp != NULL);
for (UINT iFile = 0; iFile < nFiles; iFile++)
{
TCHAR szFileName[_MAX_PATH];
int nLen = ::DragQueryFile(hDropInfo, iFile, szFileName, _MAX_PATH);
lstrcpy(tmp, szFileName);
tmp += nLen;
*(tmp++) = '/'; // put in the separator and null terminate it.
*tmp = 0;
}
CMFCGosDoc * pDoc = GetActiveErfDocument();
if (!pDoc)
return;
pApp->OnFileNewExternal();
pDoc->OnOpenDocument(szTempStorage);
::DragFinish(hDropInfo);
}
@@ -0,0 +1,70 @@
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__931C70E8_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
#define AFX_MAINFRM_H__931C70E8_5D05_11D2_8408_00A0C933BCAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include"MFC GOSView.h"
#include"ErfElemInfoView.h"
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(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);
protected:
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
public:
void BalanceFrames();
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;
CReBar m_wndReBar;
CDialogBar m_wndDlgBar;
// Generated message map functions
protected:
CSplitterWnd m_wndSplitter;
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnClose();
afx_msg void OnDropFiles(HDROP hDropInfo);
//}}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__931C70E8_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
@@ -0,0 +1,81 @@
// PointLightProps.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "PointLightProps.h"
/////////////////////////////////////////////////////////////////////////////
// CPointLightProps dialog
CPointLightProps::CPointLightProps(CWnd* pParent /*=NULL*/)
: CDialog(CPointLightProps::IDD, pParent)
{
//{{AFX_DATA_INIT(CPointLightProps)
m_Alpha = 0.0f;
m_Blue = 0.0f;
m_Green = 0.0f;
m_Intensity = 0.0f;
m_LocX = 0.0f;
m_LocY = 0.0f;
m_LocZ = 0.0f;
m_Red = 0.0f;
m_InnerRange = 0.0f;
m_OuterRange = 0.0f;
//}}AFX_DATA_INIT
}
void CPointLightProps::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPointLightProps)
DDX_Text(pDX, IDC_ALPHA, m_Alpha);
DDX_Text(pDX, IDC_BLUE, m_Blue);
DDX_Text(pDX, IDC_GREEN, m_Green);
DDX_Text(pDX, IDC_INTENSITY, m_Intensity);
DDX_Text(pDX, IDC_LOCX, m_LocX);
DDX_Text(pDX, IDC_LOCY, m_LocY);
DDX_Text(pDX, IDC_LOCZ, m_LocZ);
DDX_Text(pDX, IDC_RED, m_Red);
DDX_Text(pDX, IDC_INNERRANGE, m_InnerRange);
DDX_Text(pDX, IDC_OUTERRANGE, m_OuterRange);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPointLightProps, CDialog)
//{{AFX_MSG_MAP(CPointLightProps)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPointLightProps message handlers
void CPointLightProps::SetData(MLRPointLight *light)
{
Light=*light;
m_Intensity=Light.GetIntensity();
Light.GetColor(m_Red,m_Green,m_Blue);
Point3D loc;
Light.GetInWorldPosition(loc);
m_LocX=loc.x;
m_LocY=loc.y;
m_LocZ=loc.z;
m_InnerRange=Light.GetFalloffNear();
m_OuterRange=Light.GetFalloffFar();
}
MLRPointLight &CPointLightProps::GetData()
{
Light.SetIntensity(m_Intensity);
Light.SetColor(m_Red,m_Green,m_Blue);
Point3D loc(m_LocX,m_LocY,m_LocZ);
Stuff::LinearMatrix4D mat(loc);
Light.SetLightToWorldMatrix(mat);
Light.SetFalloffDistance(m_InnerRange,m_OuterRange);
return Light;
}
@@ -0,0 +1,59 @@
#if !defined(AFX_POINTLIGHTPROPS_H__D2F3D4A3_8325_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_POINTLIGHTPROPS_H__D2F3D4A3_8325_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PointLightProps.h : header file
//
#include <MLR\MLRHeaders.hpp>
/////////////////////////////////////////////////////////////////////////////
// CPointLightProps dialog
class CPointLightProps : public CDialog
{
// Construction
public:
MLRPointLight Light;
MLRPointLight &GetData();
void SetData(MLRPointLight *light);
CPointLightProps(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CPointLightProps)
enum { IDD = IDD_POINTLIGHTPROPS };
float m_Alpha;
float m_Blue;
float m_Green;
float m_Intensity;
float m_LocX;
float m_LocY;
float m_LocZ;
float m_Red;
float m_InnerRange;
float m_OuterRange;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPointLightProps)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPointLightProps)
// 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_POINTLIGHTPROPS_H__D2F3D4A3_8325_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,73 @@
// SlideDlg.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "SlideDlg.h"
#include <MLR\MLRHeaders.hpp>
/////////////////////////////////////////////////////////////////////////////
// CSlideDlg dialog
CSlideDlg::CSlideDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSlideDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSlideDlg)
m_Num2 = 0;
m_Num1 = 0;
m_Num3 = 0;
//}}AFX_DATA_INIT
}
void CSlideDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSlideDlg)
DDX_Control(pDX, IDC_SLIDER3, m_Slide3);
DDX_Control(pDX, IDC_SLIDER2, m_Slide2);
DDX_Control(pDX, IDC_SLIDER1, m_Slide1);
DDX_Text(pDX, IDC_NUM2, m_Num2);
DDX_Text(pDX, IDC_NUM1, m_Num1);
DDX_Text(pDX, IDC_NUM3, m_Num3);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSlideDlg, CDialog)
//{{AFX_MSG_MAP(CSlideDlg)
ON_WM_HSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSlideDlg message handlers
void CSlideDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
MLR_Water::SetSpecularValues(m_Slide2.GetPos(), m_Slide1.GetPos(), m_Slide3.GetPos()/255.0f);
m_Num1=m_Slide1.GetPos();
m_Num2=m_Slide2.GetPos();
m_Num3=m_Slide3.GetPos();
UpdateData(FALSE);
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
BOOL CSlideDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_Slide1.SetRange(0,100);
m_Slide2.SetRange(0,1000);
m_Slide3.SetRange(0,255);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -0,0 +1,52 @@
#if !defined(AFX_SLIDEDLG_H__F3344A8A_FB36_4FC8_BBE4_BD22AAA826F3__INCLUDED_)
#define AFX_SLIDEDLG_H__F3344A8A_FB36_4FC8_BBE4_BD22AAA826F3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SlideDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CSlideDlg dialog
class CSlideDlg : public CDialog
{
// Construction
public:
CSlideDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CSlideDlg)
enum { IDD = IDD_SLIDEDLG };
CSliderCtrl m_Slide3;
CSliderCtrl m_Slide2;
CSliderCtrl m_Slide1;
int m_Num2;
int m_Num1;
int m_Num3;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSlideDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CSlideDlg)
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SLIDEDLG_H__F3344A8A_FB36_4FC8_BBE4_BD22AAA826F3__INCLUDED_)
@@ -0,0 +1,150 @@
// SpotLightProps.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "SpotLightProps.h"
/////////////////////////////////////////////////////////////////////////////
// CSpotLightProps dialog
CSpotLightProps::CSpotLightProps(CWnd* pParent /*=NULL*/)
: CDialog(CSpotLightProps::IDD, pParent)
{
//{{AFX_DATA_INIT(CSpotLightProps)
m_Alpha = 0.0f;
m_Blue = 0.0f;
m_Green = 0.0f;
m_Intensity = 0.0f;
m_PosX = 0.0f;
m_PosY = 0.0f;
m_PosZ = 0.0f;
m_DirX = 0.0f;
m_DirY = 0.0f;
m_DirZ = 0.0f;
m_Spread = 0.0f;
m_Red = 0.0f;
m_InnerRange = 0.0f;
m_OuterRange = 0.0f;
//}}AFX_DATA_INIT
}
void CSpotLightProps::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSpotLightProps)
DDX_Text(pDX, IDC_ALPHA, m_Alpha);
DDX_Text(pDX, IDC_BLUE, m_Blue);
DDX_Text(pDX, IDC_GREEN, m_Green);
DDX_Text(pDX, IDC_INTENSITY, m_Intensity);
DDX_Text(pDX, IDC_POSX, m_PosX);
DDX_Text(pDX, IDC_POSY, m_PosY);
DDX_Text(pDX, IDC_POSZ, m_PosZ);
DDX_Text(pDX, IDC_DIRX, m_DirX);
DDX_Text(pDX, IDC_DIRY, m_DirY);
DDX_Text(pDX, IDC_DIRZ, m_DirZ);
DDX_Text(pDX, IDC_SPREADANGLE, m_Spread);
DDX_Text(pDX, IDC_RED, m_Red);
DDX_Text(pDX, IDC_INNERRANGE2, m_InnerRange);
DDX_Text(pDX, IDC_OUTERRANGE2, m_OuterRange);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSpotLightProps, CDialog)
//{{AFX_MSG_MAP(CSpotLightProps)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSpotLightProps message handlers
void CSpotLightProps::SetData(MLRSpotLight *light)
{
m_Intensity = light->GetIntensity();
light->GetColor(m_Red,m_Green,m_Blue);
Point3D pos;
UnitVector3D dir;
light->GetInWorldDirection(dir);
light->GetInWorldPosition(pos);
m_PosX=pos.x;
m_PosY=pos.y;
m_PosZ=pos.z;
m_DirX=dir.x;
m_DirY=dir.y;
m_DirZ=dir.z;
m_InnerRange=light->GetFalloffNear();
m_OuterRange=light->GetFalloffFar();
Stuff::Radian Angle;
light->GetSpreadAngle(&Angle);
Stuff::Degree deg;
deg=Angle;
m_Spread=deg.angle;
}
void CSpotLightProps::SetData(MLRProjectLight *light)
{
m_Intensity = light->GetIntensity();
light->GetColor(m_Red,m_Green,m_Blue);
Point3D pos;
UnitVector3D dir;
light->GetInWorldDirection(dir);
light->GetInWorldPosition(pos);
m_PosX=pos.x;
m_PosY=pos.y;
m_PosZ=pos.z;
m_DirX=dir.x;
m_DirY=dir.y;
m_DirZ=dir.z;
m_InnerRange=light->GetFalloffNear();
m_OuterRange=light->GetFalloffFar();
Stuff::Radian Angle;
light->GetSpreadAngle(&Angle);
Stuff::Degree deg;
deg=Angle;
m_Spread=deg.angle;
}
void CSpotLightProps::GetData(MLRSpotLight *Light)
{
Light->SetIntensity(m_Intensity);
Light->SetColor(m_Red,m_Green,m_Blue);
Vector3D dir(m_DirX,m_DirY,m_DirZ);
Point3D pos(m_PosX,m_PosY,m_PosZ);
Stuff::LinearMatrix4D mat(pos);
mat.AlignLocalAxisToWorldVector(dir,Stuff::Z_Axis,Stuff::Y_Axis,Stuff::X_Axis);
Light->SetLightToWorldMatrix(mat);
Stuff::Radian Angle;
Stuff::Degree deg;
deg=m_Spread;
Angle=deg;
Light->SetSpreadAngle(Angle);
Light->SetFalloffDistance(m_InnerRange, m_OuterRange);
}
void CSpotLightProps::GetData(MLRProjectLight *pLight)
{
pLight->SetIntensity(m_Intensity);
pLight->SetColor(m_Red,m_Green,m_Blue);
Vector3D dir(m_DirX,m_DirY,m_DirZ);
Point3D pos(m_PosX,m_PosY,m_PosZ);
Stuff::LinearMatrix4D mat(pos);
mat.AlignLocalAxisToWorldVector(dir,Stuff::Z_Axis,Stuff::Y_Axis,Stuff::X_Axis);
pLight->SetLightToWorldMatrix(mat);
Stuff::Radian Angle;
Stuff::Degree deg;
deg=m_Spread;
Angle=deg;
pLight->SetSpreadAngle(Angle);
pLight->SetFalloffDistance(m_InnerRange, m_OuterRange);
}
@@ -0,0 +1,65 @@
#if !defined(AFX_SPOTLIGHTPROPS_H__54019342_832E_11D3_8B36_00902712C9AE__INCLUDED_)
#define AFX_SPOTLIGHTPROPS_H__54019342_832E_11D3_8B36_00902712C9AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SpotLightProps.h : header file
//
#include <MLR\MLRHeaders.hpp>
/////////////////////////////////////////////////////////////////////////////
// CSpotLightProps dialog
class CSpotLightProps : public CDialog
{
// Construction
public:
void GetData(MLRSpotLight*);
void GetData(MLRProjectLight*);
void SetData(MLRSpotLight *light);
void SetData(MLRProjectLight *light);
CSpotLightProps(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CSpotLightProps)
enum { IDD = IDD_SPOTLIGHT };
float m_Alpha;
float m_Blue;
float m_Green;
float m_Intensity;
float m_PosX;
float m_PosY;
float m_PosZ;
float m_DirX;
float m_DirY;
float m_DirZ;
float m_Spread;
float m_Red; // NOTE: the ClassWizard will add data members here
float m_InnerRange;
float m_OuterRange;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSpotLightProps)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CSpotLightProps)
// 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_SPOTLIGHTPROPS_H__54019342_832E_11D3_8B36_00902712C9AE__INCLUDED_)
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// MFC Gos.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
@@ -0,0 +1,29 @@
// 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__931C70E6_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
#define AFX_STDAFX_H__931C70E6_5D05_11D2_8408_00A0C933BCAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define WINDOW3D 0x1010
#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
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__931C70E6_5D05_11D2_8408_00A0C933BCAC__INCLUDED_)
@@ -0,0 +1,420 @@
// ViewWnd3D.cpp : implementation file
//
#include "stdafx.h"
#include "MFC Gos.h"
#include "ViewWnd3D.h"
#include <ElementRenderer\ElementRendererHeaders.hpp>
#include <gosFX\gosFX.hpp>
#include <MLR\MLRHeaders.hpp>
#include <MFCPlatform\MFCPlatform.hpp>
extern ElementRenderer::CameraElement *Camera;
extern ElementRenderer::StateChange *Camera_State;
extern bool Window3DOpen;
extern bool gActive;
extern bool gGotFocus;
extern CMFCGosApp theApp;
/////////////////////////////////////////////////////////////////////////////
// ViewWnd3D
IMPLEMENT_DYNCREATE(ViewWnd3D, CFrameWnd)
ViewWnd3D::ViewWnd3D()
{
GOSActive=GOSInit=false;
}
ViewWnd3D::~ViewWnd3D()
{
}
BEGIN_MESSAGE_MAP(ViewWnd3D, CFrameWnd)
//{{AFX_MSG_MAP(ViewWnd3D)
ON_WM_CLOSE()
ON_WM_CREATE()
ON_WM_MOUSEMOVE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL ViewWnd3D::PreTranslateMessage( MSG* pMsg )
{
if ((pMsg->message == WM_KEYDOWN && pMsg->message == WM_KEYUP) && pMsg->wParam == VK_LMENU)
{
return TRUE;
}
return CFrameWnd::PreTranslateMessage(pMsg);
}
/////////////////////////////////////////////////////////////////////////////
// ViewWnd3D message handlers
LRESULT ViewWnd3D::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(GOSActive)
{
switch(message)
{
case WM_RBUTTONDOWN:
case WM_LBUTTONDOWN:
case WM_MOUSEMOVE:
theApp.DrawScreen();
break;
case WM_KEYDOWN:
{
theApp.UpdateCameraFromKeyMessage(message, wParam, lParam);
theApp.DrawScreen();
}
case WM_KEYUP:
{
if (GetCapture() == this)
{
ReleaseCapture();
}
}
case WM_ACTIVATE:
gActive = true;
gGotFocus= true;
break;
case WM_COMMAND:
{
DWORD ID;
ID=LOWORD(wParam); // menu item or submenu index
switch(ID)
{
case ID_ALPHA_ONEZEROMODE :
{
Camera_State->SetAlphaMode(MidLevelRenderer::MLRState::OneZeroMode);
}
break;
case ID_ALPHA_ONEONEMODE :
{
Camera_State->SetAlphaMode(MidLevelRenderer::MLRState::OneOneMode);
}
break;
case ID_ALPHA_ALPHAONEMODE :
{
Camera_State->SetAlphaMode(MidLevelRenderer::MLRState::AlphaOneMode);
}
break;
case ID_ALPHA_ONEALPHAMODE :
{
Camera_State->SetAlphaMode(MidLevelRenderer::MLRState::OneAlphaMode);
}
break;
case ID_ALPHA_ALPHAINVALPHAMODE :
{
Camera_State->SetAlphaMode(MidLevelRenderer::MLRState::AlphaInvAlphaMode);
}
break;
case ID_ALPHA_KEYEDALPHAMODE :
{
Camera_State->SetAlphaMode(MidLevelRenderer::MLRState::KeyedAlphaMode);
}
break;
case ID_BACKFACE_ON :
{
if (Camera_State->IsBackfaceCullingEnabled())
Camera_State->DisableBackfaceCulling();
else
Camera_State->EnableBackfaceCulling();
}
break;
case ID_ZBUFFER_COMPARE :
{
if (Camera_State->IsZBufferCompareEnabled())
Camera_State->DisableZBufferCompare();
else
Camera_State->EnableZBufferCompare();
}
break;
case ID_DITHERING_ON :
{
if (Camera_State->IsDitheringEnabled())
Camera_State->DisableDithering();
else
Camera_State->EnableDithering();
break;
}
break;
case ID_FILTER_NONE :
{
Camera_State->SetFilterMode(MidLevelRenderer::MLRState::NoFilterMode);
}
break;
case ID_FILTER_BILINEAR :
{
Camera_State->SetFilterMode(MidLevelRenderer::MLRState::BiLinearFilterMode);
}
break;
case ID_FILTER_TRILINEAR :
{
Camera_State->SetFilterMode(MidLevelRenderer::MLRState::TriLinearFilterMode);
}
break;
case ID_PERSPECTIVE_CORRECT :
{
if (Camera_State->IsPerspectiveCorrectionEnabled())
Camera_State->DisablePerspectiveCorrection();
else
Camera_State->EnablePerspectiveCorrection();
}
break;
case ID_TEXTURE_ON :
{
}
break;
case ID_WIREFRAME_ON :
{
Camera_State->SetWireFrameMode(MidLevelRenderer::MLRState::WireFrameOnlyMode);
}
break;
case ID_WIREFRAME_WIREFRAMETEXTURE :
{
Camera_State->SetWireFrameMode(MidLevelRenderer::MLRState::WireFrameAddMode);
}
break;
case ID_WIREFRAME_TEXTURE :
{
Camera_State->SetWireFrameMode(MidLevelRenderer::MLRState::WireFrameOffMode);
}
break;
case ID_ZBUFFER_WRITE :
{
if (Camera_State->IsZBufferWriteEnabled())
Camera_State->DisableZBufferWrite();
else
Camera_State->EnableZBufferWrite();
}
break;
}
case WM_CLOSE:
return CFrameWnd::WindowProc(message, wParam, lParam);
break;
}
}
UpdateMenu();
return GameOSWinProc(m_hWnd, message, wParam, lParam);
}
return CFrameWnd::WindowProc(message, wParam, lParam);
}
/*
if(!GOSActive)
return CFrameWnd::WindowProc(message, wParam, lParam);
while (message!=WM_MOVE && GOSInit==false)
return CFrameWnd::WindowProc(message, wParam, lParam);
if(Camera_State!=NULL)
{
switch(message)
{
case WM_COMMAND:
{
DWORD ID;
ID=LOWORD(wParam); // menu item or submenu index
switch(ID)
{
case ID_ALPHA_ONEZEROMODE :
{
Camera_State->SetAlphaMode(ElementRenderer::StateChange::OneZeroMode);
}
break;
case ID_ALPHA_ONEONEMODE :
{
Camera_State->SetAlphaMode(ElementRenderer::StateChange::OneOneMode);
}
break;
case ID_ALPHA_ALPHAONEMODE :
{
Camera_State->SetAlphaMode(ElementRenderer::StateChange::AlphaOneMode);
}
break;
case ID_ALPHA_ONEALPHAMODE :
{
Camera_State->SetAlphaMode(ElementRenderer::StateChange::OneAlphaMode);
}
break;
case ID_ALPHA_ALPHAINVALPHAMODE :
{
Camera_State->SetAlphaMode(ElementRenderer::StateChange::AlphaInvAlphaMode);
}
break;
case ID_BACKFACE_ON :
{
if (Camera_State->IsBackfaceCullingEnabled())
Camera_State->DisableBackfaceCulling();
else
Camera_State->EnableBackfaceCulling();
}
break;
case ID_ZBUFFER_COMPARE :
{
if (Camera_State->IsZBufferCompareEnabled())
Camera_State->DisableZBufferCompare();
else
Camera_State->EnableZBufferCompare();
}
break;
case ID_DITHERING_ON :
{
if (Camera_State->IsDitheringEnabled())
Camera_State->DisableDithering();
else
Camera_State->EnableDithering();
break;
}
break;
case ID_FILTER_NONE :
{
Camera_State->SetFilterMode(ElementRenderer::StateChange::NoFilterMode);
}
break;
case ID_FILTER_BILINEAR :
{
Camera_State->SetFilterMode(ElementRenderer::StateChange::BiLinearFilterMode);
}
break;
case ID_FILTER_TRILINEAR :
{
Camera_State->SetFilterMode(ElementRenderer::StateChange::TriLinearFilterMode);
}
break;
case ID_PERSPECTIVE_CORRECT :
{
if (Camera_State->IsPerspectiveCorrectionEnabled())
Camera_State->DisablePerspectiveCorrection();
else
Camera_State->EnablePerspectiveCorrection();
}
break;
case ID_TEXTURE_ON :
{
}
break;
case ID_WIREFRAME_ON :
{
Camera_State->SetWireFrameMode(ElementRenderer::StateChange::WireFrameOnlyMode);
}
break;
case ID_WIREFRAME_WIREFRAMETEXTURE :
{
Camera_State->SetWireFrameMode(ElementRenderer::StateChange::WireFrameAddMode);
}
break;
case ID_WIREFRAME_TEXTURE :
{
Camera_State->SetWireFrameMode(ElementRenderer::StateChange::WireFrameOffMode);
}
break;
case ID_ZBUFFER_WRITE :
{
if (Camera_State->IsZBufferWriteEnabled())
Camera_State->DisableZBufferWrite();
else
Camera_State->EnableZBufferWrite();
}
break;
} //end of Menu cs
}
break;
} //end of CS
}// end if camera created
UpdateMenu();
if(message==WM_CLOSE)
{
return CFrameWnd::WindowProc(message, wParam, lParam);
}
else
return GameOSWinProc( m_hWnd,message,wParam,lParam );
}
*/
void ViewWnd3D::UpdateMenu()
{
if(Camera_State==NULL) return;
CMenu *menu=GetMenu();
MLRState mlr_state = Camera_State->GetMLRState();
menu->CheckMenuItem(ID_ALPHA_ONEZEROMODE,Camera_State->GetAlphaMode()==MidLevelRenderer::MLRState::OneZeroMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_ALPHA_ONEONEMODE,Camera_State->GetAlphaMode()==MidLevelRenderer::MLRState::OneOneMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_ALPHA_ALPHAONEMODE,Camera_State->GetAlphaMode()==MidLevelRenderer::MLRState::AlphaOneMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_ALPHA_ONEALPHAMODE,Camera_State->GetAlphaMode()==MidLevelRenderer::MLRState::OneAlphaMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_ALPHA_ALPHAINVALPHAMODE,Camera_State->GetAlphaMode()==MidLevelRenderer::MLRState::AlphaInvAlphaMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_ALPHA_KEYEDALPHAMODE,Camera_State->GetAlphaMode()==MidLevelRenderer::MLRState::KeyedAlphaMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_BACKFACE_ON,Camera_State->IsBackfaceCullingEnabled()?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_ZBUFFER_COMPARE,Camera_State->IsZBufferCompareEnabled()?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_DITHERING_ON,Camera_State->IsDitheringEnabled()?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_FILTER_NONE,Camera_State->GetFilterMode()==MidLevelRenderer::MLRState::NoFilterMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_FILTER_BILINEAR,Camera_State->GetFilterMode()==MidLevelRenderer::MLRState::BiLinearFilterMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_FILTER_TRILINEAR,Camera_State->GetFilterMode()==MidLevelRenderer::MLRState::TriLinearFilterMode?MF_CHECKED:MF_UNCHECKED);
// menu->CheckMenuItem(ID_FOG_ON,Camera_State->IsFogEnabled()?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_PERSPECTIVE_CORRECT,Camera_State->IsPerspectiveCorrectionEnabled()?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_TEXTURE_ON,1?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_WIREFRAME_ON,Camera_State->GetWireFrameMode()==MidLevelRenderer::MLRState::WireFrameOnlyMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_WIREFRAME_WIREFRAMETEXTURE,Camera_State->GetWireFrameMode()==MidLevelRenderer::MLRState::WireFrameAddMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_WIREFRAME_TEXTURE,Camera_State->GetWireFrameMode()==MidLevelRenderer::MLRState::WireFrameOffMode?MF_CHECKED:MF_UNCHECKED);
menu->CheckMenuItem(ID_ZBUFFER_WRITE,Camera_State->IsZBufferWriteEnabled()?MF_CHECKED:MF_UNCHECKED);
}
void ViewWnd3D::OnClose()
{
// Window3DOpen=false;
ShowWindow(SW_HIDE);
// CFrameWnd::OnClose();
}
int ViewWnd3D::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
Window3DOpen=true;
return 0;
}
void ViewWnd3D::PreGosCleanUp()
{
Camera_State=NULL;
}
void ViewWnd3D::Fix3DView()
{
gActive = true;
gGotFocus= true;
GameOSWinProc(m_hWnd, WM_MOVE, NULL, NULL);
}
void ViewWnd3D::OnMouseMove(UINT nFlags, CPoint point)
{
CFrameWnd::OnMouseMove(nFlags, point);
}
@@ -0,0 +1,56 @@
#if !defined(AFX_VIEWWND3D_H__7C24D343_5DCE_11D2_8408_00A0C933BCAC__INCLUDED_)
#define AFX_VIEWWND3D_H__7C24D343_5DCE_11D2_8408_00A0C933BCAC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ViewWnd3D.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// ViewWnd3D frame
class ViewWnd3D : public CFrameWnd
{
DECLARE_DYNCREATE(ViewWnd3D)
protected:
// Attributes
public:
ViewWnd3D(); // protected constructor used by dynamic creation
bool GOSInit,GOSActive;
virtual ~ViewWnd3D();
// Operations
public:
void PreGosCleanUp();
void UpdateMenu();
void Fix3DView();
BOOL PreTranslateMessage( MSG* pMsg );
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(ViewWnd3D)
protected:
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(ViewWnd3D)
afx_msg void OnClose();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VIEWWND3D_H__7C24D343_5DCE_11D2_8408_00A0C933BCAC__INCLUDED_)
@@ -0,0 +1,43 @@
// WaterDlg1.cpp : implementation file
//
#include "stdafx.h"
#include "mfc gos.h"
#include "WaterDlg1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWaterDlg1 dialog
CWaterDlg1::CWaterDlg1(CWnd* pParent /*=NULL*/)
: CDialog(CWaterDlg1::IDD, pParent)
{
//{{AFX_DATA_INIT(CWaterDlg1)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CWaterDlg1::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CWaterDlg1)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CWaterDlg1, CDialog)
//{{AFX_MSG_MAP(CWaterDlg1)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWaterDlg1 message handlers
@@ -0,0 +1,46 @@
#if !defined(AFX_WATERDLG1_H__C4E3F9FE_2424_4CCD_A1A2_D1206FF315DF__INCLUDED_)
#define AFX_WATERDLG1_H__C4E3F9FE_2424_4CCD_A1A2_D1206FF315DF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// WaterDlg1.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CWaterDlg1 dialog
class CWaterDlg1 : public CDialog
{
// Construction
public:
CWaterDlg1(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CWaterDlg1)
enum { IDD = IDD_WATERDLG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWaterDlg1)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CWaterDlg1)
// 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_WATERDLG1_H__C4E3F9FE_2424_4CCD_A1A2_D1206FF315DF__INCLUDED_)
Binary file not shown.
@@ -0,0 +1,13 @@
//
// MFC GOS.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,221 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by MFC Gos.rc
//
#define IDD_ABOUTBOX 100
#define IDR_MAINFRAME 128
#define IDR_MFCGOSTYPE 129
#define IDR_RENDERMENU 130
#define IDD_TEXTPATH 132
#define IDI_ICON3D 133
#define IDD_EDITMLRSTATE 134
#define IDD_ALPHAMODE 135
#define IDD_FILTERMODE 136
#define IDD_WIREFRAME 137
#define IDD_LIGHTING 138
#define IDD_LIGHTLISTDLG 138
#define IDD_MISC 139
#define IDD_AMBIENTLIGHTPROPS 139
#define IDD_FOG 140
#define IDD_POINTLIGHTPROPS 140
#define IDD_PRIORITY 141
#define IDD_INFINITELIGHT 141
#define IDD_TEXTURE 142
#define IDD_SPOTLIGHT 142
#define IDD_STATE 143
#define IDD_BMPMAPDLG 143
#define IDD_LODRANGE 144
#define IDD_WATERDLG 147
#define IDD_SLIDEDLG 148
#define IDC_INTENSITY 1000
#define IDC_TERRAINREP 1000
#define IDC_START 1000
#define IDC_NUM1 1000
#define IDC_NUM2 1001
#define IDC_FADEIN 1001
#define IDC_NUM3 1002
#define IDC_ALPHA10 1004
#define IDC_ALPHA11 1005
#define IDC_ALPHAA1 1006
#define IDC_DETAILREP 1006
#define IDC_ALPHA1A 1007
#define IDC_WATERREP 1007
#define IDC_ALPHAAIA 1008
#define IDC_FILTER_NONE 1009
#define IDC_BUMPREP 1009
#define IDC_FILTER_BILINEAR 1010
#define IDC_EVNREP 1010
#define IDC_FILTER_TRILINEAR 1011
#define IDC_NORMREP 1011
#define IDC_WF_OFF 1012
#define IDC_WF_ONLY 1013
#define IDC_WF_ADD 1014
#define IDC_ZB_COMPARE 1015
#define IDC_ZB_WRITE 1016
#define IDC_BACKFACE 1017
#define IDC_FOG 1018
#define IDC_DITHERING 1019
#define IDC_P_CORRECTION 1020
#define IDC_TEXTURE 1021
#define IDC_FOGSTART 1022
#define IDC_FOGEND 1023
#define IDC_TEXTUREDSP 1027
#define IDC_FOGBOX 1028
#define IDC_MISCBOX 1029
#define IDC_ALPHABOX 1030
#define IDC_FILTERINGBOX 1031
#define IDC_WIREFRAMEBOX 1032
#define IDC_PER_ZBUFFER_COM 1033
#define IDC_PER_FILTER 1034
#define IDC_DELTA_ZBUFFER_COM 1035
#define IDC_DELTA_FILTER 1036
#define IDC_PER_TEXTURE 1037
#define IDC_DELTA_TEXTURE 1038
#define IDC_PER_WIREFRAME 1039
#define IDC_DELTA_WIREFRAME 1040
#define IDC_PER_ALPHA 1041
#define IDC_DELTA_ALPHA 1042
#define IDC_PRIORITYSLIDE 1043
#define IDC_PRIORITYNUM 1044
#define IDC_LIGHTBOX 1045
#define IDC_PER_FOG 1046
#define IDC_DELTA_FOG 1047
#define IDC_PER_BACKFACE 1048
#define IDC_DELTA_BACKFACE 1049
#define IDC_PER_DITHER 1050
#define IDC_DELTA_DITHER 1051
#define IDC_PER_PCORRECT 1054
#define IDC_DELTA_PCORRECT 1055
#define IDC_LIGHT_OFF 1056
#define IDC_LIGHT_CLASSIC 1057
#define IDC_SAVEBUT 1058
#define IDC_FOG_DISABLE 1059
#define IDC_FOG_OFOG 1060
#define IDC_FOG_OFOGCOLOR 1061
#define IDC_FOGLIST 1062
#define IDC_LIGHT_LIGHTMAP 1063
#define IDC_LIGHT_LMCLASS 1064
#define IDC_PER_LIGHT 1065
#define IDC_DELTA_LIGHT 1066
#define IDC_PER_PRIORITY 1067
#define IDC_PER_TCORRECT 1067
#define IDC_DELTA_PRIORITY 1068
#define IDC_PER_ZBUFFER_WRI 1069
#define IDC_DELTA_ZBUFFER_WRI 1070
#define IDC_DELTA_FOGSTART 1071
#define IDC_DELTA_FOGEND 1072
#define IDC_PRILEVEL 1073
#define IDC_ALPHALIST 1074
#define IDC_FILTERLIST 1075
#define IDC_WIREFRAMELIST 1076
#define IDC_LIGHTLIST 1077
#define IDC_ZBUFLIST 1078
#define IDC_TEXTURELIST 1079
#define IDC_BACKFACELIST 1080
#define IDC_DITHERLIST 1081
#define IDC_TCORRECTLIST 1082
#define IDC_STATELIST 1083
#define IDC_PER_PRI 1084
#define IDC_PER_ZBUF 1085
#define IDC_RED 1085
#define IDC_GREEN 1086
#define IDC_BLUE 1087
#define IDC_PER_SPECULAR 1088
#define IDC_ALPHA 1088
#define IDC_SPECULARLIST 1089
#define IDC_SPREADANGLE 1089
#define IDC_PER_COLORING 1090
#define IDC_DIRX 1090
#define IDC_COLORINGLIST 1091
#define IDC_DIRY 1091
#define IDC_LOCX 1092
#define IDC_DIRZ 1092
#define IDC_LOCY 1093
#define IDC_LOCZ 1094
#define IDC_POSX 1095
#define IDC_INNERRANGE 1095
#define IDC_POSY 1096
#define IDC_OUTERRANGE 1096
#define IDC_POSZ 1097
#define IDC_BROWSE 1097
#define IDC_INNERRANGE2 1098
#define IDC_OUTERRANGE2 1099
#define IDC_TERRAINBROWSE 1099
#define IDC_DETAILBRW 1100
#define IDC_WATERBRW 1101
#define IDC_BUMPBRW 1102
#define IDC_ENVBRW 1103
#define IDC_TERRAINTXT 1104
#define IDC_DETAILTXT 1105
#define IDC_WATERTXT 1106
#define IDC_BUMPTXT 1107
#define IDC_ENVTXT 1108
#define IDC_NORMTXT 1109
#define IDC_NRMBRW 1110
#define IDC_WSCROLLU 1111
#define IDC_WSCROLLV 1112
#define IDC_BSCROLLU 1113
#define IDC_END 1113
#define IDC_BSCROLLV 1114
#define IDC_FADEOUT 1114
#define IDC_NSCROLLU 1115
#define IDC_NSCROLLV 1116
#define IDC_SLIDER1 1118
#define IDC_SLIDER2 1119
#define IDC_SLIDER3 1120
#define IDC_ALIGN_STARTLOD 1125
#define IDC_ALIGN_X 1126
#define IDC_ALIGN_Y 1127
#define IDC_STATICALIGN 1128
#define IDC_STATICSTART 1129
#define IDC_STATICFADEIN 1130
#define IDC_STATICFADEOUT 1131
#define IDC_STATICEND 1132
#define ID_ALPHA_ONEZEROMODE 32771
#define ID_ALPHA_ONEONEMODE 32772
#define ID_ALPHA_ALPHAONEMODE 32773
#define ID_ALPHA_ONEALPHAMODE 32774
#define ID_ALPHA_ALPHAINVALPHAMODE 32775
#define ID_BACKFACE_ON 32777
#define ID_ZBUFFER_COMPARE 32779
#define ID_DITHERING_ON 32781
#define ID_FILTER_NONE 32783
#define ID_FILTER_BILINEAR 32784
#define ID_FILTER_TRILINEAR 32785
#define ID_FOG_ON 32787
#define ID_PERSPECTIVE_CORRECT 32789
#define ID_TEXTURE_ON 32791
#define ID_WIREFRAME_ON 32793
#define ID_ZBUFFER_WRITE 32795
#define ID_WIREFRAME_WIREFRAMETEXTURE 32798
#define ID_WIREFRAME_TEXTURE 32799
#define ID_OPTIONS_TEXTUREPATH 32800
#define ID_FILE_RELOAD 32801
#define ID_VIEW_3DVIEWWINDOW 32806
#define ID_VIEW_UPDATEONIDLE 32807
#define ID_EDIT_ADDLIGHT_POINTLIGHT 32808
#define ID_EDIT_ADDLIGHT_SPOTLIGHT 32809
#define ID_EDIT_ADDLIGHT_AMBIENTLIGHT 32810
#define ID_EDIT_ADDLIGHT_INFINITELIGHT 32811
#define ID_WINDOWS_LIGHTLIST 32814
#define ID_FILE_IMPORT 32815
#define ID_EDIT_ADDLIGHT_PROJECTLIGHT 32816
#define ID_VIEW_EXPANDALL 32817
#define ID_VIEW_COLLAPSEALL 32818
#define ID_VIEW_BUMPMAPTEST 32819
#define ID_ALPHA_KEYEDALPHAMODE 32820
#define ID_VIEW_WATERTEST 32824
#define ID_VIEW_WATERMETHOD2 32825
#define ID_VIEW_WATERMETHOD3 32826
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 149
#define _APS_NEXT_COMMAND_VALUE 32827
#define _APS_NEXT_CONTROL_VALUE 1133
#define _APS_NEXT_SYMED_VALUE 103
#endif
#endif