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,727 @@
// AnimNode.cpp: implementation of the CAnimNode class.
//
//////////////////////////////////////////////////////////////////////
// TODO : jkyle - need to implement SetValue and GetValue for the ParamNode derivatives
#include "stdafx.h"
#include "animscript.h"
#include "AnimNode.h"
#include "AnimScriptDoc.h"
#include "modifycurveparam.h"
#include "modifyfloat.h"
#include "modifypathdlg.h"
#include "modifyattribdlg.h"
#include <assert.h>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
// This is the exact text used for save and load of data file key names, index matches enum in AnimNode.h
char g_szParamKeyName[][40] =
{
"AnimType",
"Start",
"Position",
"Anim",
"StartOverlapCurve",
"EndOverlapCurve",
"TransitionStart",
"PlayOldStateTill",
"OverrideNewStatePosition",
"StartNewState",
"PitchAttrib",
"RollAttrib",
"SpeedAttrib",
"FastAnim",
"SlowAnim",
"SlowSpeedMultiplier",
"LerpTime",
"SlowUpAnim",
"SlowEvenAnim",
"SlowDownAnim",
"FastUpAnim",
"FastEvenAnim",
"FastDownAnim",
"UpAnim",
"EvenAnim",
"DownAnim",
"LeftAnim",
"RightAnim",
"SlowLeftAnim",
"SlowRightAnim",
"FastLeftAnim",
"FastRightAnim",
"InvalidAnim"
};
// This is a mapping of all animation types with the parameter type
int g_arrAnimTypeParams[][2] =
{
{MechWarrior4::AnimationStateEngine::PoseType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::CycleType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::CycleType,PARAM_ANIM},
{MechWarrior4::AnimationStateEngine::SpeedCycleType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::SpeedCycleType,PARAM_ANIM},
{MechWarrior4::AnimationStateEngine::SpeedCycleType,PARAM_SPEEDATTRIB},
{MechWarrior4::AnimationStateEngine::SpeedBlenderCycleType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::SpeedBlenderCycleType,PARAM_SLOWANIM},
{MechWarrior4::AnimationStateEngine::SpeedBlenderCycleType,PARAM_FASTANIM},
{MechWarrior4::AnimationStateEngine::SpeedBlenderCycleType,PARAM_SPEEDATTRIB},
{MechWarrior4::AnimationStateEngine::SpeedBlenderCycleType,PARAM_SLOWSPEEDMULTIPLIER},
{MechWarrior4::AnimationStateEngine::LerpCycleType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::LerpCycleType,PARAM_LERPTIME},
{MechWarrior4::AnimationStateEngine::LerpCycleType,PARAM_ANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWUPANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWEVENANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWDOWNANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_FASTUPANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_FASTEVENANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_FASTDOWNANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_PITCHATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_ROLLATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SPEEDATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWSPEEDMULTIPLIER},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_UPANIM},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_EVENANIM},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_DOWNANIM},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_ROLLATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_PITCHATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_SPEEDATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_UPANIM},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_EVENANIM},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_DOWNANIM},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_LEFTANIM},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_RIGHTANIM},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_ROLLATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_PITCHATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightBlenderCycleType,PARAM_SPEEDATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWUPANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWEVENANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWDOWNANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWLEFTANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWRIGHTANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_FASTUPANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_FASTEVENANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_FASTDOWNANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_FASTLEFTANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_FASTRIGHTANIM},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_ROLLATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_PITCHATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SPEEDATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightSpeedBlenderCycleType,PARAM_SLOWSPEEDMULTIPLIER},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_UPANIM},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_EVENANIM},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_DOWNANIM},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_LEFTANIM},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_RIGHTANIM},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_ROLLATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_PITCHATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_POSITION},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_EVENANIM},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_DOWNANIM},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_ROLLATTRIB},
{MechWarrior4::AnimationStateEngine::FullHeightPoseHolderType,PARAM_PITCHATTRIB}
};
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//**************************//
// The base class for Animation States and Transition States
CAnimNode::CAnimNode(CString strName)
{
m_bValid = false;
m_strName = strName;
m_hItem = NULL;
}
CAnimNode::~CAnimNode()
{
}
CParamNode *CAnimNode::GetParam(int iKey)
{
CObject *pObj;
if (m_mapParams.Lookup(iKey,pObj))
{
CParamNode *pNode = (CParamNode *)pObj;
return pNode;
}
return NULL;
}
// returns the value it replaced if at all
CParamNode *CAnimNode::SetParam(int iKey,CParamNode *pNode)
{
assert(iKey>=0);
assert(iKey<PARAM_COUNT);
CObject *pObj = m_mapParams[iKey];
CParamNode *pOldNode = NULL;
if (pObj)
pOldNode = (CParamNode *)pObj;
m_mapParams[iKey] = pNode;
return pOldNode;
}
bool CAnimNode::LoadState(Page *page)
{
CAnimTypeNode *pType = (CAnimTypeNode *)GetParam(PARAM_ANIMTYPE);
CreateAnimTypeParams(pType,page);
return true;
}
CParamNode *CAnimNode::CreateParam(int iType,Page *page)
{
CParamNode *pNode = NULL;
switch (iType)
{
case PARAM_ANIMTYPE:
return NULL; // This type is not a created parameter
case PARAM_START:
case PARAM_POSITION:
case PARAM_SLOWSPEEDMULTIPLIER:
case PARAM_LERPTIME:
{
pNode = new CFloatNode(iType);
break;
}
case PARAM_ANIM:
case PARAM_FASTANIM:
case PARAM_SLOWANIM:
case PARAM_SLOWUPANIM:
case PARAM_SLOWEVENANIM:
case PARAM_SLOWDOWNANIM:
case PARAM_FASTUPANIM:
case PARAM_FASTEVENANIM:
case PARAM_FASTDOWNANIM:
case PARAM_UPANIM:
case PARAM_EVENANIM:
case PARAM_DOWNANIM:
case PARAM_LEFTANIM:
case PARAM_RIGHTANIM:
case PARAM_SLOWLEFTANIM:
case PARAM_SLOWRIGHTANIM:
case PARAM_FASTLEFTANIM:
case PARAM_FASTRIGHTANIM:
{
pNode = new CPathNode(iType);
break;
}
case PARAM_STARTOVERLAPCURVE:
case PARAM_ENDOVERLAPCURVE:
{
pNode = new CCurveTypeNode(iType,0);
break;
}
case PARAM_TRANSITIONSTART:
case PARAM_PLAYOLDSTATETILL:
case PARAM_OVERRIDENEWSTATEPOSITION:
case PARAM_STARTNEWSTATE:
{
pNode = new CFloatNode(iType);
break;
}
case PARAM_SPEEDATTRIB:
case PARAM_PITCHATTRIB:
case PARAM_ROLLATTRIB:
{
pNode = new CAttribTypeNode(iType,0);
break;
}
default:
{
}
}
if (pNode)
{
CString strValue;
if (page)
{
const char *pData = NULL;
if (page->GetEntry(pNode->GetKeyString(),&pData))
{
pNode->SetValue(pData);
}
}
CParamNode *pOldNode = SetParam(iType,pNode);
if (pOldNode)
{
// Might want to set the new node's value to the old one
CString strValue = pOldNode->GetValue();
pNode->SetValue(strValue);
}
CAnimScriptDoc::m_listParamNodes.AddHead(pNode);
}
return pNode;
}
// Given a known Animation type, create the parameters that go with it
void CAnimNode::CreateAnimTypeParams(CAnimTypeNode *pNode,Page *page)
{
assert(pNode);
CMapWordToPtr mapInvalid; //map the invalid types so we can remove them
// Add the valid parameters
int iSize = sizeof(g_arrAnimTypeParams)>>3;
for (int x=0;x<iSize;x++)
{
int iType = g_arrAnimTypeParams[x][0];
int iParam = g_arrAnimTypeParams[x][1];
if (pNode->m_iType == iType)
{
CreateParam(iParam,page);
mapInvalid[iParam] = 0;
}
else
{
void *pNul;
if (!mapInvalid.Lookup(iParam,pNul))
pNul = (void *)1;
mapInvalid[iParam] = pNul;
}
}
// Now go through the param map and remove anything that is also in m_mapInvalid
POSITION pos = m_mapParams.GetStartPosition();
while (pos)
{
WORD iKey;
CObject *pObj;
m_mapParams.GetNextAssoc(pos,iKey,pObj);
CParamNode *pParam = (CParamNode *)pObj;
void *pNul;
if (mapInvalid.Lookup(iKey,pNul))
{
if (pNul)
{
// iKey is invalid
m_mapParams.RemoveKey(iKey);
POSITION delpos = CAnimScriptDoc::m_listParamNodes.Find(pParam);
CAnimScriptDoc::m_listParamNodes.RemoveAt(delpos);
delete pParam;
}
}
}
}
bool CAnimNode::SaveState(NotationFile *file)
{
if (this->m_bValid)
{
Page *page = file->AddPage(this->m_strName);
Register_Object(page);
POSITION pos = m_mapParams.GetStartPosition();
while (pos)
{
WORD iKey;
CObject *pObj;
m_mapParams.GetNextAssoc(pos,iKey,pObj);
CParamNode *pParam = (CParamNode *)pObj;
page->AppendEntry(pParam->GetKeyString(),pParam->GetValue());
}
Unregister_Object(page);
// delete page;
}
return true;
}
//**************************//
CAnimStateNode::CAnimStateNode(CString strName) : CAnimNode(strName)
{
m_bIsTransition = false;
}
CAnimStateNode::~CAnimStateNode()
{
}
bool CAnimStateNode::LoadState(Page *page)
{
CreateParam(PARAM_START,page);
return CAnimNode::LoadState(page);
}
//**************************//
CTransStateNode::CTransStateNode (CAnimStateNode *pNodeX,CAnimStateNode *pNodeY)
: CAnimStateNode((pNodeX?pNodeX->GetName():"")+"::"+(pNodeY?pNodeY->GetName():""))
{
m_pStartNode = pNodeX;
m_pEndNode = pNodeY;
m_bIsTransition = true;
}
CTransStateNode::~CTransStateNode()
{
}
bool CTransStateNode::LoadState(Page *page)
{
bool bret = CAnimStateNode::LoadState(page);
CreateParam(PARAM_STARTOVERLAPCURVE,page);
CreateParam(PARAM_ENDOVERLAPCURVE,page);
CreateParam(PARAM_TRANSITIONSTART,page);
CreateParam(PARAM_PLAYOLDSTATETILL,page);
CreateParam(PARAM_OVERRIDENEWSTATEPOSITION,page);
CreateParam(PARAM_STARTNEWSTATE,page);
return bret;
}
//**************************//
CParamNode::CParamNode()
{
m_iParamType = -1;
}
CString CParamNode::GetKeyString()
{
return g_szParamKeyName[m_iParamType];
}
CString CParamNode::GetValueString()
{
CString strValue("UNDEFINED");
return strValue;
}
bool CParamNode::OnModify()
{
// Can't modify CParamNode because it is the base class
return false;
}
CString CParamNode::GetValue()
{
CString strValue("UNDEFINED");
return strValue;
}
bool CParamNode::SetValue(CString)
{
return true;
}
//Enum defines for this are in AnimationState.hpp enumerated
// in the range of {0,MechWarrior4::AnimationStateEngine::AnimTypeCount}
// **********************************************************************
char g_szAnimationTypeNames[][50] =
{
"PoseType",
"FullHeightPoseHolderType",
"CycleType",
"SpeedCycleType",
"LerpCycleType",
"FullHeightSpeedBlenderCycleType",
"FullHeightBlenderCycleType",
"SpeedBlenderCycleType",
/*
"PoseType",
"HeightPoseHolderType",
"FullHeightPoseHolderType",
"CycleType",
"SpeedCycleType",
"LerpCycleType",
"HeightSpeedBlenderCycleType",
"HeightBlenderCycleType",
"FullHeightSpeedBlenderCycleType",
"FullHeightBlenderCycleType",
"SpeedBlenderCycleType",
*/
};
#define ANIMATIONTYPENAME_COUNT 11
CAnimTypeNode::CAnimTypeNode(int iType)
{
m_iParamType = PARAM_ANIMTYPE;
m_iType = iType;
m_iIndex = -1;
if ((iType>0)&&(iType<=ANIMATIONTYPENAME_COUNT))
m_strName = g_szAnimationTypeNames[iType-1];
}
CString CAnimTypeNode::GetValueString()
{
return m_strName;
}
bool CAnimTypeNode::OnModify()
{
// Can't modify AnimType from the modify button (actually shouldn't ever show up because it is filtered out
return false;
}
CString CAnimTypeNode::GetValue()
{
return m_strName;
}
bool CAnimTypeNode::SetValue(CString)
{
return true;
}
//Enum defines for this are in AnimationState.hpp enumerated
// in the range of {0,MechWarrior4::AnimCurve::CurveTypeCount}
// **********************************************************************
char g_szCurveTypeNames[][40] =
{
" None",
"LinearUpCurveType",
"CubedCurveType",
"EaseUpCurveType",
"EdgeCurveType",
"BumpCurveType",
"EaseUpSplineCurveType",
"CurveUpCurveType",
"SpikeUpCurveType",
"BellCurveType",
"SpikeCurveType",
"LongBumpCurveType",
"BumpSpikeCurveType",
"SpikeBellCurveType"
};
#define CURVETYPENAMECOUNT 14
CCurveTypeNode::CCurveTypeNode(int iParamType,int iType)
{
m_iParamType = iParamType;
m_iType = iType-1; // So that -1 is "None" or NULL
// m_iIndex = -1;
if ((iType>=0)&&(iType<=CURVETYPENAMECOUNT))
m_strName = g_szCurveTypeNames[iType];
InitializeClass();
curveType = m_iType;
curveMin = 0.0;
curveMax = 1.0;
timeStart = 0.0;
timeEnd = 1.0;
invertTime = false;
invertScale = false;
}
CString CCurveTypeNode::GetValueString()
{
return CString(g_szCurveTypeNames[m_iType+1]);
}
bool CCurveTypeNode::OnModify()
{
CModifyCurveParam dlg;
dlg.m_pCurveNode = this;
return (IDOK == dlg.DoModal());
}
CString CCurveTypeNode::GetValue()
{
CString str;
str.Format("%d %f %f %f %f %d %d", curveType, curveMin, curveMax, timeStart, timeEnd, invertTime, invertScale);
return str;
}
bool CCurveTypeNode::SetValue(CString str)
{
if (str.GetLength())
{
LoadCurve(str);
m_iType = curveType;
}
return true;
}
// **********************************************************************
char g_szAttribTypeNames[][30] =
{
"SpeedDemandMPS",
"CurrentSpeedMPS",
"LocalGroundPitch",
"LocalGroundRoll"
};
#define ATTRIBTYPENAMECOUNT 4
CAttribTypeNode::CAttribTypeNode(int iParamType,int iType)
{
m_iParamType = iParamType;
m_iType = iType; // So that -1 is "None" or NULL
if ((iType>=0)&&(iType<=ATTRIBTYPENAMECOUNT))
m_strName = g_szAttribTypeNames[iType];
}
CString CAttribTypeNode::GetValueString()
{
return m_strName;
}
bool CAttribTypeNode::OnModify()
{
CModifyAttribDlg dlg;
dlg.m_pAttribNode = this;
return (IDOK == dlg.DoModal());
}
CString CAttribTypeNode::GetValue()
{
return m_strName;
}
bool CAttribTypeNode::SetValue(CString str)
{
void *pData = MechWarrior4::Vehicle::DefaultData;
return true;
}
// **********************************************************************
CFloatNode::CFloatNode(int iParamType)
{
m_iParamType = iParamType;
switch (iParamType)
{
case PARAM_SLOWSPEEDMULTIPLIER:
{
m_fValue = 1.0f;
break;
}
default:
{
m_fValue = 0.0f;
}
}
// void *pData = MechWarrior4::Vehicle::DefaultData;
}
CString CFloatNode::GetValueString()
{
CString strValue;
strValue.Format("%f",m_fValue);
return strValue;
}
bool CFloatNode::OnModify()
{
CModifyFloat dlg;
dlg.m_pFloatNode = this;
return (IDOK == dlg.DoModal());
}
CString CFloatNode::GetValue()
{
CString strValue;
strValue.Format("%f",m_fValue);
return strValue;
}
bool CFloatNode::SetValue(CString str)
{
m_fValue = atof(str);
return true;
}
// **********************************************************************
CPathNode::CPathNode(int iParamType)
{
m_iParamType = iParamType;
m_pAnimData = NULL;
}
CPathNode::~CPathNode()
{
if (m_pAnimData)
delete m_pAnimData;
m_pAnimData = NULL;
}
CString CPathNode::GetValueString()
{
return m_strPath;
}
bool CPathNode::OnModify()
{
CModifyPathDlg dlg;
dlg.m_pPathNode = this;
return (IDOK == dlg.DoModal());
}
CString CPathNode::GetValue()
{
if (m_strPath.GetLength()==0)
{
int x=1;
x++;
}
return m_strPath;
}
bool CPathNode::SetValue(CString str)
{
m_strPath = str;
if (m_pAnimData)
delete m_pAnimData;
m_pAnimData = new MW4Animation::AnimData();
if (str.GetLength()&&!m_pAnimData->Load(m_strPath+".mw4anim"))
{
// We had a problem loading the animation
assert(false);
delete m_pAnimData;
m_pAnimData = NULL;
}
return true;
}
@@ -0,0 +1,208 @@
// AnimNode.h: interface for the CAnimNode class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ANIMNODE_H__55E965C5_6AD6_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_ANIMNODE_H__55E965C5_6AD6_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "mw4headers.hpp"
#include "Vehicle.hpp"
#include "MechAnimationState.hpp"
class CAnimTypeNode;
class CCurveTypeNode;
class CAttribTypeNode;
class CParamNode;
class CAnimNode : public CObject
{
private:
CString m_strName;
protected:
bool m_bIsTransition;
public:
CMapWordToOb m_mapParams; //Map of WORD(Type Name Token) - CString( Value )
HTREEITEM m_hItem;
bool m_bValid;
CParamNode *GetParam(int);
CParamNode *SetParam(int,CParamNode *);
CAnimNode(CString);
virtual ~CAnimNode();
CParamNode *CreateParam(int,Page * = NULL);
void CreateAnimTypeParams(CAnimTypeNode *,Page * = NULL);
CString GetName() {return m_strName;}
bool IsTransition() {return m_bIsTransition;}
virtual bool LoadState(Page *);
virtual bool SaveState(NotationFile *);
};
// These are the data section objects
// There is really nothing unique only to Animation State nodes
class CAnimStateNode : public CAnimNode
{
public:
CAnimStateNode(CString);
virtual ~CAnimStateNode();
virtual bool LoadState(Page *);
};
// Transition State nodes have the basic stuff, and more parameters
class CTransStateNode : public CAnimStateNode
{
public:
CAnimNode *m_pStartNode;
CAnimNode *m_pEndNode;
CTransStateNode(CAnimStateNode *,CAnimStateNode *);
virtual ~CTransStateNode ();
virtual bool LoadState(Page *);
};
// NOTE: When adding new type, make sure that in the AnimNode::CreateParam it has an associated node
// that filter is set up from CPageAnimType::ShowParam()
// that the animation type params have the parameters linked
enum // Enumerate the parameter types
{
PARAM_ANIMTYPE = 0, // All AnimNodes will have this in their parameter map
PARAM_START,
PARAM_POSITION,
PARAM_ANIM,
PARAM_STARTOVERLAPCURVE,
PARAM_ENDOVERLAPCURVE,
PARAM_TRANSITIONSTART,
PARAM_PLAYOLDSTATETILL,
PARAM_OVERRIDENEWSTATEPOSITION,
PARAM_STARTNEWSTATE,
PARAM_PITCHATTRIB,
PARAM_ROLLATTRIB,
PARAM_SPEEDATTRIB,
PARAM_FASTANIM,
PARAM_SLOWANIM,
PARAM_SLOWSPEEDMULTIPLIER,
PARAM_LERPTIME,
PARAM_SLOWUPANIM,
PARAM_SLOWEVENANIM,
PARAM_SLOWDOWNANIM,
PARAM_FASTUPANIM,
PARAM_FASTEVENANIM,
PARAM_FASTDOWNANIM,
PARAM_UPANIM,
PARAM_EVENANIM,
PARAM_DOWNANIM,
PARAM_LEFTANIM,
PARAM_RIGHTANIM,
PARAM_SLOWLEFTANIM,
PARAM_SLOWRIGHTANIM,
PARAM_FASTLEFTANIM,
PARAM_FASTRIGHTANIM,
PARAM_COUNT
};
// Text defined in AnimNode.cpp
// These are Parameter map objects
// Base class for all param nodes (the node specific for the Animation Type
class CParamNode : public CObject
{
public:
int m_iParamType;
CParamNode();
virtual ~CParamNode() {};
CString GetKeyString();
virtual CString GetValueString(); //Returns the display output string (for human readability)
virtual bool OnModify();
virtual CString GetValue(); // Returns the file output string (for computer readability)
virtual bool SetValue(CString); // Load the values, based on a string
};
class CAnimTypeNode : public CParamNode
{
public:
CString m_strName;
int m_iIndex;
int m_iType;
CAnimTypeNode(int);
virtual ~CAnimTypeNode() {};
virtual CString GetValueString();
virtual bool OnModify();
virtual CString GetValue(); // Returns the file output string (for computer readability)
virtual bool SetValue(CString); // Load the values, based on a string
};
class CCurveTypeNode : public CParamNode, public MechWarrior4::AnimCurve
{
public:
CString m_strName;
int m_iType;
CCurveTypeNode(int,int);
virtual ~CCurveTypeNode() {};
virtual CString GetValueString();
virtual bool OnModify();
virtual CString GetValue(); // Returns the file output string (for computer readability)
virtual bool SetValue(CString); // Load the values, based on a string
};
class CAttribTypeNode : public CParamNode
{
public:
CString m_strName;
int m_iType;
CAttribTypeNode(int,int);
virtual ~CAttribTypeNode() {};
virtual CString GetValueString();
virtual bool OnModify();
virtual CString GetValue(); // Returns the file output string (for computer readability)
virtual bool SetValue(CString); // Load the values, based on a string
};
class CFloatNode : public CParamNode
{
public:
float m_fValue;
CFloatNode(int);
virtual ~CFloatNode() {};
virtual CString GetValueString();
virtual bool OnModify();
virtual CString GetValue(); // Returns the file output string (for computer readability)
virtual bool SetValue(CString); // Load the values, based on a string
};
class CPathNode : public CParamNode
{
public:
CString m_strPath;
MW4Animation::AnimData *m_pAnimData;
CPathNode(int);
virtual ~CPathNode();
virtual CString GetValueString();
virtual bool OnModify();
virtual CString GetValue(); // Returns the file output string (for computer readability)
virtual bool SetValue(CString); // Load the values, based on a string
};
#endif // !defined(AFX_ANIMNODE_H__55E965C5_6AD6_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,373 @@
// AnimScript.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "AnimScript.h"
#include "MainFrm.h"
#include "AnimScriptDoc.h"
#include "AnimScriptView.h"
#if !defined(STUFF_STUFF_HPP)
#include "Stuff\Stuff.hpp"
#endif
#include <GameOS\GameOS.hpp>
#include <DLLPlatform\DLLPlatform.hpp>
#if !defined(MW4ANIMATIONSYSTEM_HPP)
#include <MW4\MW4AnimationSystem.hpp>
#endif
#include "mw4.hpp"
#include "..\buildnum\buildnum.h" // current version and build number
//#include "AnimDetail.h"
#include "mw4headers.hpp"
#include "Vehicle.hpp"
#include "MechAnimationState.hpp"
#include "mlr\mlr.hpp"
#include "gosfx\gosfx.hpp"
#include "compost\compost.hpp"
// jcem - start
#include "ctcls.h"
#include "ctcl.h" // jcem
extern Time g_fLastGameStart;
#pragma data_seg(".SHARED_DATA")
// all data in this section must be INITIALIZED!!!!!!!!!!!!!
BOOL g_bLaunched = FALSE;
#pragma data_seg()
#pragma comment(linker, "/section:.SHARED_DATA,RWS")
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
char *LocalIPAddress;
int __stdcall Mech4ReconnectGame(void) { gosASSERT(FALSE); return 0; }
void __cdecl CDedicatedServerUI::EnterRunningGameState(void) { gosASSERT(FALSE); }
void __cdecl CDedicatedServerUI::EnterStoppingGameState(void) { gosASSERT(FALSE); }
void __cdecl CDedicatedServerUI::EnterRecyclingGameState(void) { gosASSERT(FALSE); }
void __cdecl CDedicatedServerUI::EnterLoadingGameState(void) { gosASSERT(FALSE); }
SCRIPTVAR_INT(ConnectionIndex) = 0;
void RegisterData(void) { gosASSERT(FALSE); }
void UnRegisterData(void) { gosASSERT(FALSE); }
SCRIPTCALLBACK(PreConnect) { gosASSERT(FALSE); return 0; }
SCRIPTCALLBACK(InitConnectionWizard) { gosASSERT(FALSE); return 0; }
SCRIPTCALLBACK(LoadMPConnectionSettings) { gosASSERT(FALSE); return 0; }
SCRIPTCALLBACK(CancelDialup) { gosASSERT(FALSE); return 0; }
void _stdcall InitializeGameEngine()
{
Stuff::ArmorLevel = 4;
Stuff::InitializeClasses();
MidLevelRenderer::InitializeClasses();
gosFX::InitializeClasses();
ElementRenderer::InitializeClasses();
Compost::InitializeClasses();
Adept::InitializeClasses();
MechWarrior4::InitializeClasses();
}
void _stdcall TerminateGameEngine()
{
}
void __stdcall GetGameOSEnvironment(char* CommandLine)
{
//
//----------------------------------------------------------
// This is where to set GOS environment settings.
//----------------------------------------------------------
//
Environment.applicationName = "AnimationScript";
Environment.screenWidth = 640;
Environment.screenHeight = 480;
Environment.bitDepth = 16;
// Environment.InitializeGameEngine = InitializeGameEngine;
// Environment.TerminateGameEngine = TerminateGameEngine;
}
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptApp
BEGIN_MESSAGE_MAP(CAnimScriptApp, CWinApp)
//{{AFX_MSG_MAP(CAnimScriptApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptApp construction
CAnimScriptApp::CAnimScriptApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CAnimScriptApp object
CAnimScriptApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptApp initialization
CString g_strRoot;
BOOL CAnimScriptApp::InitInstance()
{
InitGameOS( AfxGetInstanceHandle(), NULL, "\0" );
Stuff::ArmorLevel = 4;
Stuff::InitializeClasses();
MidLevelRenderer::InitializeClasses();
gosFX::InitializeClasses();
ElementRenderer::InitializeClasses();
Compost::InitializeClasses();
//Adept::InitializeClasses();
//MechWarrior4::InitializeClasses();
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
SetRegistryKey(_T("Animation Scripter"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CAnimScriptDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CAnimScriptView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
char dir[MAX_PATH];
GetCurrentDirectory(MAX_PATH,dir);
g_strRoot = dir;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
int CAnimScriptApp::ExitInstance()
{
//MechWarrior4::TerminateClasses();
//Adept::TerminateClasses();
Compost::TerminateClasses();
ElementRenderer::TerminateClasses();
gosFX::TerminateClasses();
MidLevelRenderer::TerminateClasses();
Stuff::TerminateClasses();
ExitGameOS();
return CWinApp::ExitInstance();
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CAnimScriptApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptApp message handlers
// jcem - start
int __stdcall CTCL_GetType(void* instance, int args, void* data[])
{
ASSERT(FALSE);
return 0;
}
int __stdcall CTCL_IsConsole(void* instance, int args, void* data[])
{
ASSERT(FALSE);
return 0;
}
int __stdcall CTCL_IsConsoleX(void* instance, int args, void* data[])
{
ASSERT(FALSE);
return 0;
}
int __stdcall CTCL_Get(void* instance, int args, void* data[])
{
ASSERT(FALSE);
return 0;
}
int __stdcall CTCL_Set(void* instance, int args, void* data[])
{
ASSERT(FALSE);
return 0;
}
BOOL __stdcall CTCL_Before()
{
ASSERT(FALSE);
return FALSE;
}
void __stdcall CTCL_After()
{
ASSERT(FALSE);
}
void __stdcall CTCL_Proc()
{
ASSERT(FALSE);
}
void CTCL_API CTCL_DoTerminateAppl()
{
ASSERT(FALSE);
}
void CTCL_API CTCL_DoMainShell()
{
ASSERT(FALSE);
}
void CTCL_API CTCL_DoCreateGame()
{
ASSERT(FALSE);
}
void CTCL_API CTCL_DoJoinGame()
{
ASSERT(FALSE);
}
void CTCL_API CTCL_CheckJoinGame()
{
ASSERT(FALSE);
}
void CTCL_API CTCL_DoGame1st()
{
ASSERT(FALSE);
}
void CTCL_API CTCL_StartGame(BOOL bRealLaunch)
{
ASSERT(FALSE);
}
SCRIPTVAR_INT(AdvertiseThisGame) = 1;
SCRIPTCALLBACK(SetGameNameDefault)
{
DWORD dwSize = 256;
FREE_PTR(GameName);
GameName = (char *) gos_Malloc(dwSize);
strcpy(GameName, "Server");
return 0;
}
//========================================================================
// Sets the global variable 'PlayerName' to the default player name.
//========================================================================
SCRIPTCALLBACK(SetPlayerNameDefault)
{
DWORD dwSize = 256;
FREE_PTR(PlayerName);
PlayerName = (char *) gos_Malloc(dwSize);
strcpy(PlayerName, "Player");
return 0;
}
// jcem - end
@@ -0,0 +1,273 @@
# Microsoft Developer Studio Project File - Name="AnimScript" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=AnimScript - 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 "AnimScript.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 "AnimScript.mak" CFG="AnimScript - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "AnimScript - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "AnimScript - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "AnimScript - 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 "Release"
# PROP Intermediate_Dir "Release"
# 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 /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /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 /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "AnimScript - 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 "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /G6 /Zp4 /MDd /W3 /Gm /GR /Zi /Od /I "..\..\libraries\stlport" /I "..\..\Libraries" /I "..\..\Code\Mw4" /I "..\..\Code" /I "..\..\..\CoreTech\Libraries" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "MULTI_PLAYER" /D "USE_PROTOTYPES" /D "STRICT" /D TEST_CLASS=50 /D "_ARMOR" /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 rpcrt4.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "AnimScript - Win32 Release"
# Name "AnimScript - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\AnimNode.cpp
# End Source File
# Begin Source File
SOURCE=.\AnimScript.cpp
# End Source File
# Begin Source File
SOURCE=.\AnimScript.rc
# End Source File
# Begin Source File
SOURCE=.\AnimScriptDoc.cpp
# End Source File
# Begin Source File
SOURCE=.\AnimScriptView.cpp
# End Source File
# Begin Source File
SOURCE=.\GraphView.cpp
# End Source File
# Begin Source File
SOURCE=.\GraphView1.cpp
# End Source File
# Begin Source File
SOURCE=.\MainFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\ModifyAttribDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\ModifyCurveParam.cpp
# End Source File
# Begin Source File
SOURCE=.\ModifyFloat.cpp
# End Source File
# Begin Source File
SOURCE=.\ModifyPathDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\ModifyView.cpp
# End Source File
# Begin Source File
SOURCE=.\PageAnimType.cpp
# End Source File
# Begin Source File
SOURCE=.\ParamPage.cpp
# End Source File
# Begin Source File
SOURCE=.\StateListView.cpp
# End Source File
# Begin Source File
SOURCE=.\StateParamView.cpp
# End Source File
# Begin Source File
SOURCE=.\StateTreeView.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\AnimNode.h
# End Source File
# Begin Source File
SOURCE=.\AnimScript.h
# End Source File
# Begin Source File
SOURCE=.\AnimScriptDoc.h
# End Source File
# Begin Source File
SOURCE=.\AnimScriptView.h
# End Source File
# Begin Source File
SOURCE=.\GraphView.h
# End Source File
# Begin Source File
SOURCE=.\GraphView1.h
# End Source File
# Begin Source File
SOURCE=.\MainFrm.h
# End Source File
# Begin Source File
SOURCE=.\ModifyAttribDlg.h
# End Source File
# Begin Source File
SOURCE=.\ModifyCurveParam.h
# End Source File
# Begin Source File
SOURCE=.\ModifyFloat.h
# End Source File
# Begin Source File
SOURCE=.\ModifyPathDlg.h
# End Source File
# Begin Source File
SOURCE=.\ModifyView.h
# End Source File
# Begin Source File
SOURCE=.\PageAnimType.h
# End Source File
# Begin Source File
SOURCE=.\ParamPage.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StateListView.h
# End Source File
# Begin Source File
SOURCE=.\StateParamView.h
# End Source File
# Begin Source File
SOURCE=.\StateTreeView.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.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\AnimScript.ico
# End Source File
# Begin Source File
SOURCE=.\res\AnimScript.rc2
# End Source File
# Begin Source File
SOURCE=.\res\AnimScriptDoc.ico
# End Source File
# Begin Source File
SOURCE=.\res\Toolbar.bmp
# End Source File
# End Group
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project
@@ -0,0 +1,266 @@
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>
{{{
}}}
###############################################################################
Project: "AnimScript"=.\AnimScript.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Adept
End Project Dependency
Begin Project Dependency
Project_Dep_Name Stuff
End Project Dependency
Begin Project Dependency
Project_Dep_Name gosFX
End Project Dependency
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name MW4Animation
End Project Dependency
Begin Project Dependency
Project_Dep_Name MW4
End Project Dependency
Begin Project Dependency
Project_Dep_Name Compost
End Project Dependency
Begin Project Dependency
Project_Dep_Name ElementRenderer
End Project Dependency
Begin Project Dependency
Project_Dep_Name MLR
End Project Dependency
Begin Project Dependency
Project_Dep_Name comwnd
End Project Dependency
Begin Project Dependency
Project_Dep_Name server
End Project Dependency
Begin Project Dependency
Project_Dep_Name DLLPlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
Begin Project Dependency
Project_Dep_Name MW4Gos
End Project Dependency
}}}
###############################################################################
Project: "Compost"=..\..\Libraries\Compost\Compost.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "DLLPlatform"=..\..\..\CoreTech\Libraries\DLLPlatform\DLLPlatform.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "ElementRenderer"=..\..\Libraries\ElementRenderer\ElementRenderer.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
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: "MW4"=..\..\Code\MW4\MW4.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "MW4Animation"=..\..\Code\MW4\MW4Animation.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "MW4Gos"=..\..\Code\MW4GOS\MW4Gos.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Stuff"=..\..\Libraries\Stuff\Stuff.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "client"=..\..\Libraries\comline\client.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "comwnd"=..\..\Code\comwnd\comwnd.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name client
End Project Dependency
}}}
###############################################################################
Project: "gosFX"=..\..\Libraries\gosFX\gosFX.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "server"=..\..\Libraries\comline\server.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,50 @@
// AnimScript.h : main header file for the ANIMSCRIPT application
//
#if !defined(AFX_ANIMSCRIPT_H__7CADECC4_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_ANIMSCRIPT_H__7CADECC4_6795_11D3_9C1B_00609712FBEF__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
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptApp:
// See AnimScript.cpp for the implementation of this class
//
class CAnimScriptApp : public CWinApp
{
public:
CAnimScriptApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAnimScriptApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CAnimScriptApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ANIMSCRIPT_H__7CADECC4_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,550 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\AnimScript.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#include ""afxprint.rc"" // printing/print preview resources\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\AnimScript.ico"
IDR_ANIMSCTYPE ICON DISCARDABLE "res\\AnimScriptDoc.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15
BEGIN
BUTTON ID_FILE_NEW
BUTTON ID_FILE_OPEN
BUTTON ID_FILE_SAVE
SEPARATOR
BUTTON ID_EDIT_CUT
BUTTON ID_EDIT_COPY
BUTTON ID_EDIT_PASTE
SEPARATOR
BUTTON ID_FILE_PRINT
SEPARATOR
BUTTON ID_APP_ABOUT
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE
MENUITEM "Save &As...", ID_FILE_SAVE_AS
MENUITEM SEPARATOR
MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW
MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
MENUITEM SEPARATOR
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
END
POPUP "&Help"
BEGIN
MENUITEM "&About AnimScript...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"N", ID_FILE_NEW, VIRTKEY, CONTROL
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
"P", ID_FILE_PRINT, VIRTKEY, CONTROL
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
VK_F6, ID_NEXT_PANE, VIRTKEY
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About AnimScript"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "AnimScript Version 1.0",IDC_STATIC,40,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (C) 1999",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END
IDD_STATE_PARAM DIALOG DISCARDABLE 0, 0, 387, 114
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Animation Type:",IDC_STATIC,13,30,52,8
COMBOBOX IDC_COMBO_ANIMTYPE,70,30,100,75,CBS_DROPDOWNLIST |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Create",IDC_CREATE,13,10,50,14
GROUPBOX "Parameters",IDC_STATEPARAM_TITLE,7,0,170,50,BS_RIGHT
GROUPBOX "Static",IDC_PROPSHEET_POS,190,7,190,100,NOT WS_VISIBLE
END
IDD_PARAM_ANIMTYPE DIALOG DISCARDABLE 0, 0, 200, 95
STYLE WS_CAPTION
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "List1",IDC_LIST_PARAM,"SysListView32",LVS_REPORT |
LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE |
WS_BORDER | WS_TABSTOP,7,7,130,81
PUSHBUTTON "Modify",IDC_MODIFY,143,7,50,14
END
IDD_MODIFY_CURVE DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Modify Curve"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,74,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,74,50,14
COMBOBOX IDC_COMBO_CURVETYPE,7,7,85,81,CBS_DROPDOWNLIST |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "Invert Time",IDC_CHECK_INVERTTIME,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,90,60,51,10
CONTROL "InvertScale",IDC_CHECK_INVERTSCALE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,60,52,10
GROUPBOX "Curve Range",IDC_STATIC,7,20,85,40
EDITTEXT IDC_EDIT_MIN,45,30,40,14,ES_AUTOHSCROLL
EDITTEXT IDC_EDIT_MAX,45,45,40,14,ES_AUTOHSCROLL
LTEXT "MIN",IDC_STATIC,25,30,14,8
LTEXT "MAX",IDC_STATIC,25,45,16,8
GROUPBOX "Time Range",IDC_STATIC,93,20,85,40
LTEXT "START",IDC_STATIC,100,30,25,8
LTEXT "END",IDC_STATIC,100,45,16,8
EDITTEXT IDC_EDIT_START,139,30,40,14,ES_AUTOHSCROLL
EDITTEXT IDC_EDIT_END,139,45,40,14,ES_AUTOHSCROLL
END
IDD_MODIFY_FLOAT DIALOG DISCARDABLE 0, 0, 186, 46
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Modify Float"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
LTEXT "Value:",IDC_STATIC,7,7,21,8
EDITTEXT IDC_EDIT_VALUE,35,7,80,14,ES_AUTOHSCROLL
END
IDD_MODIFY_PATH DIALOG DISCARDABLE 0, 0, 186, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Modify Path"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,42,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,42,50,14
LTEXT "Path",IDC_STATIC,7,7,16,8
EDITTEXT IDC_EDIT_PATH,7,25,172,14,ES_AUTOHSCROLL
PUSHBUTTON "Browse",IDC_BROWSE,129,7,50,14
END
IDD_MODIFY_ATTRIB DIALOG DISCARDABLE 0, 0, 186, 46
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Modify Attribute"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
LISTBOX IDC_LIST_ATTRIB,7,7,115,32,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
END
IDD_MODIFY_PARAM DIALOG DISCARDABLE 0, 0, 393, 95
STYLE WS_CHILD | WS_BORDER
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Slider1",IDC_SLIDER_START,"msctls_trackbar32",TBS_BOTH |
WS_TABSTOP,7,7,300,15
CONTROL "Slider2",IDC_SLIDER_PLAYOLDTILL,"msctls_trackbar32",
TBS_BOTH | WS_TABSTOP,7,23,300,15
CONTROL "Slider3",IDC_SLIDER_STARTNEW,"msctls_trackbar32",
TBS_BOTH | WS_TABSTOP,7,55,300,15
CONTROL "Slider5",IDC_SLIDER_OVERRIDE,"msctls_trackbar32",
TBS_BOTH | WS_TABSTOP,7,71,300,15
LTEXT "Start",IDC_STATIC,315,7,16,8
LTEXT "Play Old State Till",IDC_STATIC,314,23,56,8
LTEXT "Start New State",IDC_STATIC,315,55,51,8
LTEXT "Override New Start",IDC_STATIC,315,71,61,8
CONTROL "Slider4",IDC_SLIDER_TRANSSTART,"msctls_trackbar32",
TBS_BOTH | WS_TABSTOP,7,39,300,15
LTEXT "Transition Start",IDC_STATIC,315,39,48,8
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "AnimScript MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "AnimScript\0"
VALUE "LegalCopyright", "Copyright (C) 1999\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "AnimScript.EXE\0"
VALUE "ProductName", "AnimScript Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_STATE_PARAM, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 380
BOTTOMMARGIN, 107
END
IDD_PARAM_ANIMTYPE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 193
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
IDD_MODIFY_CURVE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
IDD_MODIFY_FLOAT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 39
END
IDD_MODIFY_PATH, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 56
END
IDD_MODIFY_ATTRIB, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 39
END
IDD_MODIFY_PARAM, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 386
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "AnimScript\n\nAnimSc\n\n\nAnimScript.Document\nAnimSc Document"
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE "AnimScript"
AFX_IDS_IDLEMESSAGE "Ready"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_INDICATOR_EXT "EXT"
ID_INDICATOR_CAPS "CAP"
ID_INDICATOR_NUM "NUM"
ID_INDICATOR_SCRL "SCRL"
ID_INDICATOR_OVR "OVR"
ID_INDICATOR_REC "REC"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_NEW "Create a new document\nNew"
ID_FILE_OPEN "Open an existing document\nOpen"
ID_FILE_CLOSE "Close the active document\nClose"
ID_FILE_SAVE "Save the active document\nSave"
ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup"
ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup"
ID_FILE_PRINT "Print the active document\nPrint"
ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_MRU_FILE1 "Open this document"
ID_FILE_MRU_FILE2 "Open this document"
ID_FILE_MRU_FILE3 "Open this document"
ID_FILE_MRU_FILE4 "Open this document"
ID_FILE_MRU_FILE5 "Open this document"
ID_FILE_MRU_FILE6 "Open this document"
ID_FILE_MRU_FILE7 "Open this document"
ID_FILE_MRU_FILE8 "Open this document"
ID_FILE_MRU_FILE9 "Open this document"
ID_FILE_MRU_FILE10 "Open this document"
ID_FILE_MRU_FILE11 "Open this document"
ID_FILE_MRU_FILE12 "Open this document"
ID_FILE_MRU_FILE13 "Open this document"
ID_FILE_MRU_FILE14 "Open this document"
ID_FILE_MRU_FILE15 "Open this document"
ID_FILE_MRU_FILE16 "Open this document"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_EDIT_CLEAR "Erase the selection\nErase"
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
ID_EDIT_FIND "Find the specified text\nFind"
ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
ID_EDIT_REPEAT "Repeat the last action\nRepeat"
ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
ID_EDIT_UNDO "Undo the last action\nUndo"
ID_EDIT_REDO "Redo the previously undone action\nRedo"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCSIZE "Change the window size"
AFX_IDS_SCMOVE "Change the window position"
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCRESTORE "Restore the window to normal size"
AFX_IDS_SCTASKLIST "Activate Task List"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\AnimScript.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#include "afxprint.rc" // printing/print preview resources
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
@@ -0,0 +1,393 @@
// AnimScriptDoc.cpp : implementation of the CAnimScriptDoc class
//
#include "stdafx.h"
#include "AnimScript.h"
#include "AnimScriptDoc.h"
#include "AnimNode.h"
#include "mw4headers.hpp"
#include "Vehicle.hpp"
#include "MechAnimationState.hpp"
#include "stuff\NotationFile.hpp"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CString g_strRoot;
CObList CAnimScriptDoc::m_listParamNodes;
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptDoc
IMPLEMENT_DYNCREATE(CAnimScriptDoc, CDocument)
BEGIN_MESSAGE_MAP(CAnimScriptDoc, CDocument)
//{{AFX_MSG_MAP(CAnimScriptDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptDoc construction/destruction
char g_szStateNames[][40] =
{
// see Mw4/Code/Mw4/MechAnimationState.hpp
"StandState",
"StandHalfState",
"Stand_1_8_thState",
"Stand_2_8_thState",
"Stand_3_8_thState",
"Stand_5_8_thState",
"Stand_6_8_thState",
"Stand_7_8_thState",
"ForwardState",
"BackwardState",
"TurnLeftState",
"TurnRightState",
"LGimpTurnRightState",
"RGimpTurnRightState",
"LGimpTurnLeftState",
"RGimpTurnLeftState",
"GimpStandLeftState",
"GimpForwardLeftState",
"GimpStandRightState",
"GimpForwardRightState",
"FallForwardState",
"FallBackwardState",
"FallLeftState",
"FallRightState",
"FallCataclysmicState",
"PowerDownState",
"PowerDownCataclysmicState",
"CrouchState",
"FlyState",
};
//#define STATENAME_COUNT 22
CAnimScriptDoc::CAnimScriptDoc()
{
this->m_pSelectedNode = NULL;
// Create all of the state nodes
for (int x=MechWarrior4::AnimationStateEngine::StateCount;x<(MechWarrior4::MechAnimationStateEngine::StateCount);x++)
//for (int x=0;x<MechWarrior4::MechAnimationStateEngine::DefaultData->GetStateCount();x++)
{
int i = x-MechWarrior4::AnimationStateEngine::StateCount;
CAnimStateNode *pNode = new CAnimStateNode(g_szStateNames[i]);
this->m_listStates.AddHead(pNode);
}
// Create all of the transition nodes (fully connected)
POSITION posx = m_listStates.GetHeadPosition();
while (posx)
{
CObject *pObj = m_listStates.GetNext(posx);
CAnimStateNode *pAnimNodeX = (CAnimStateNode *)pObj;
// Create one sided Transition states to and from this state
CTransStateNode *pNode = new CTransStateNode(pAnimNodeX,NULL);
m_listTransitions.AddHead(pNode);
pNode = new CTransStateNode(NULL,pAnimNodeX);
m_listTransitions.AddHead(pNode);
POSITION posy = m_listStates.GetHeadPosition();
while (posy)
{
pObj = m_listStates.GetNext(posy);
CAnimStateNode *pAnimNodeY = (CAnimStateNode *)pObj;
if (pAnimNodeX != pAnimNodeY)
{
pNode = new CTransStateNode(pAnimNodeX,pAnimNodeY);
m_listTransitions.AddHead(pNode);
}
}
}
for (x=1;x<(MechWarrior4::AnimationStateEngine::AnimTypeCount);x++)
{
CAnimTypeNode *pNode = new CAnimTypeNode(x);
m_listAnimTypes.AddHead(pNode);
}
}
CAnimScriptDoc::~CAnimScriptDoc()
{
POSITION pos = m_listStates.GetHeadPosition();
while (pos)
{
CObject *pObj = m_listStates.GetNext(pos);
CAnimStateNode *pNode = (CAnimStateNode *)pObj;
delete pNode;
}
pos = m_listTransitions.GetHeadPosition();
while (pos)
{
CObject *pObj = m_listTransitions.GetNext(pos);
CTransStateNode *pNode = (CTransStateNode *)pObj;
delete pNode;
}
m_listTransitions.RemoveAll();
pos = m_listAnimTypes.GetHeadPosition();
while (pos)
{
CObject *pObj = m_listAnimTypes.GetNext(pos);
CAnimTypeNode *pNode = (CAnimTypeNode *)pObj;
delete pNode;
}
m_listAnimTypes.RemoveAll();
pos = m_listParamNodes.GetHeadPosition();
while (pos)
{
CObject *pObj = m_listParamNodes.GetNext(pos);
CParamNode*pNode = (CParamNode *)pObj;
delete pNode;
}
m_listParamNodes.RemoveAll();
}
BOOL CAnimScriptDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptDoc serialization
void CAnimScriptDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptDoc diagnostics
#ifdef _DEBUG
void CAnimScriptDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CAnimScriptDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptDoc commands
extern char g_szParamKeyName[][40];
BOOL CAnimScriptDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
// Be sure that all of the states are invalid
{
POSITION pos = m_listStates.GetHeadPosition();
while (pos)
{
CAnimNode *pAnimNode = (CAnimNode *)m_listStates.GetNext(pos);
pAnimNode->m_bValid = false;
}
}
{
POSITION pos = this->m_listTransitions.GetHeadPosition();
while (pos)
{
CAnimNode *pAnimNode = (CAnimNode *)m_listTransitions.GetNext(pos);
pAnimNode->m_bValid = false;
}
}
//if (!CDocument::OnOpenDocument(lpszPathName))
// return FALSE;
CString root = g_strRoot;
CString path(lpszPathName);
if (path.GetLength()>root.GetLength())
path.Delete(0,root.GetLength()+1);
SetCurrentDirectory(root);
NotationFile *notefile = new NotationFile(lpszPathName);
Register_Object(notefile);
NotationFile::PageIterator *pages = notefile->MakePageIterator();
Check_Object(pages);
pages->First();
Page *page = NULL;
while (page = pages->ReadAndNext())
{
Check_Object(page);
const char* anim_state_name = page->GetName();
Check_Pointer(anim_state_name);
CAnimNode *pNode = NULL;
if (strstr(anim_state_name, "::") == NULL)
{
// Find the state
POSITION pos = m_listStates.GetHeadPosition();
while (pos)
{
CAnimNode *pAnimNode = (CAnimNode *)m_listStates.GetNext(pos);
if (0==strcmpi(pAnimNode->GetName(),anim_state_name)) // (0==strncmp(pAnimNode->GetName(),anim_state_name,strlen(anim_state_name)))
{
pNode = pAnimNode;
break;
}
}
if (NULL == pNode)
STOP(("CAnimScriptDoc::OnOpenDocument: FILE FORMAT - "+CString(anim_state_name)+" is not a valid animation state."));
}
else if (strstr(anim_state_name, "::") != NULL) // load the transitions
{
// Find the state
POSITION pos = this->m_listTransitions.GetHeadPosition();
while (pos)
{
CAnimNode *pAnimNode = (CAnimNode *)m_listTransitions.GetNext(pos);
if (0==strcmpi(pAnimNode->GetName(),anim_state_name)) // (0==strncmp(pAnimNode->GetName(),anim_state_name,strlen(anim_state_name)))
{
pNode = pAnimNode;
break;
}
}
if (NULL == pNode)
STOP(("CAnimScriptDoc::OnOpenDocument: FILE FORMAT - "+CString(anim_state_name)+" is not a valid transition state."));
// load the transition based off of type (anim, transition or expression)
/* TransitionState *new_anim_state = new TransitionState(this);
Check_Object(new_anim_state);
new_anim_state->PreLoad(script_notefile, anim_state_name);
anim_holder_count += new_anim_state->GetAnimHolderCount(script_notefile, anim_state_name);
total_curve_count += new_anim_state->GetCurveCount(script_notefile, anim_state_name);
transitionsLoaded.Add(new_anim_state);
*/
}
else
{
STOP(("CAnimScriptDoc::OnOpenDocument: INVALID CODE - SHOULD NEVER REACH HERE"));
}
assert(pNode);
pNode->m_bValid = true;
// NameList *entry_pages = notefile->MakeEntryList(anim_state_name);
// Check_Object(entry_pages);
// NameList::Entry *entry_page = entry_pages->FindEntry(g_szParamKeyName[PARAM_ANIMTYPE]);
// find the CAnimTypeNode with the same name
CAnimTypeNode *pAnimType = NULL;
POSITION pos = m_listAnimTypes.GetHeadPosition();
const char *pName=NULL;
const char *pData=NULL;
if (page->GetEntry(pName = g_szParamKeyName[PARAM_ANIMTYPE],&pData))
{
while (pos)
{
pAnimType = (CAnimTypeNode *)m_listAnimTypes.GetNext(pos);
//pName = (char *)entry_page->GetName();
//pData = (char *)entry_page->GetData();
if (0 == strcmpi(pAnimType->m_strName,pData)) // (0 == strncmp(pAnimType->m_strName,pData,strlen(pData)))
{
// found the right Animation Type
pNode->SetParam(PARAM_ANIMTYPE,pAnimType);
break;
}
}
}
if (pAnimType)
pNode->LoadState(page);
else
STOP(("AnimScriptDoc::OnOpenDocument: File Error" + CString(anim_state_name)+"|"+CString(pName)+"|" + pData+CString(" missing AnimType parameter")));
//Check_Object(entry_pages);
//delete entry_pages;
//page = page->GetNextEntry();
}
Check_Object(pages);
delete pages;
Check_Object(notefile);
delete notefile;
return TRUE;
}
BOOL CAnimScriptDoc::OnSaveDocument(LPCTSTR lpszPathName)
{
NotationFile notefile;
// Save all of the states
{
POSITION pos = m_listStates.GetHeadPosition();
while (pos)
{
CAnimNode *pAnimNode = (CAnimNode *)m_listStates.GetNext(pos);
pAnimNode->SaveState(&notefile);
}
}
{
POSITION pos = this->m_listTransitions.GetHeadPosition();
while (pos)
{
CAnimNode *pAnimNode = (CAnimNode *)m_listTransitions.GetNext(pos);
pAnimNode->SaveState(&notefile);
}
}
notefile.SaveAs(lpszPathName);
/*
Check_Object(FileStreamManager::Instance);
FileStream *file = FileStream::MakeFileStream();
Check_Object(file);
file->Open(lpszPathName, FileStream::WriteOnly);
notefile->Write(file);
file->Close();
Check_Object(notefile);
delete notefile;
Check_Object(file);
delete file;*/
return true;
//return CDocument::OnSaveDocument(lpszPathName);
}
@@ -0,0 +1,67 @@
// AnimScriptDoc.h : interface of the CAnimScriptDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_ANIMSCRIPTDOC_H__7CADECCA_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_ANIMSCRIPTDOC_H__7CADECCA_6795_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "animnode.h"
class CAnimScriptDoc : public CDocument
{
protected: // create from serialization only
CAnimScriptDoc();
DECLARE_DYNCREATE(CAnimScriptDoc)
// Attributes
public:
// Lists of CAnimNodes
CObList m_listStates;
CObList m_listTransitions;
CObList m_listAnimTypes;
static CObList m_listParamNodes;
CAnimNode *m_pSelectedNode;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAnimScriptDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CAnimScriptDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CAnimScriptDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ANIMSCRIPTDOC_H__7CADECCA_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,118 @@
// AnimScriptView.cpp : implementation of the CAnimScriptView class
//
#include "stdafx.h"
#include "AnimScript.h"
#include "AnimScriptDoc.h"
#include "AnimScriptView.h"
#include "StateTreeView.h"
#include "StateListView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptView
IMPLEMENT_DYNCREATE(CAnimScriptView, CView)
BEGIN_MESSAGE_MAP(CAnimScriptView, CView)
//{{AFX_MSG_MAP(CAnimScriptView)
ON_WM_CREATE()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptView construction/destruction
CAnimScriptView::CAnimScriptView()
{
// TODO: add construction code here
}
CAnimScriptView::~CAnimScriptView()
{
}
BOOL CAnimScriptView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptView drawing
void CAnimScriptView::OnDraw(CDC* pDC)
{
CAnimScriptDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
//m_wndSplitter.RedrawWindow();
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptView printing
BOOL CAnimScriptView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CAnimScriptView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CAnimScriptView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptView diagnostics
#ifdef _DEBUG
void CAnimScriptView::AssertValid() const
{
CView::AssertValid();
}
void CAnimScriptView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CAnimScriptDoc* CAnimScriptView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAnimScriptDoc)));
return (CAnimScriptDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CAnimScriptView message handlers
void CAnimScriptView::OnInitialUpdate()
{
CView::OnInitialUpdate();
}
int CAnimScriptView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
// TODO: Add your specialized creation code here
return 0;
}
@@ -0,0 +1,68 @@
// AnimScriptView.h : interface of the CAnimScriptView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_ANIMSCRIPTVIEW_H__7CADECCC_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_ANIMSCRIPTVIEW_H__7CADECCC_6795_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CAnimScriptView : public CView
{
protected: // create from serialization only
CAnimScriptView();
DECLARE_DYNCREATE(CAnimScriptView)
// Attributes
public:
CAnimScriptDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAnimScriptView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
CSplitterWnd m_wndSplitter;
virtual ~CAnimScriptView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CAnimScriptView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in AnimScriptView.cpp
inline CAnimScriptDoc* CAnimScriptView::GetDocument()
{ return (CAnimScriptDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ANIMSCRIPTVIEW_H__7CADECCC_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
File diff suppressed because it is too large Load Diff
+197
View File
@@ -0,0 +1,197 @@
#if !defined(__CStr__)
#define __CStr__
// include: cstr.h, stdarg.h
#if !defined(CHAR)
#define CHAR char
#endif // !defined(CHAR)
#if !defined(USE_STRLOCK)
#define USE_STRLOCK
#endif // !defined(USE_STRLOCK)
#if !defined(__QSortCompareProc_DEFINED__)
typedef int (__cdecl* QSortCompareProc)(const void* elem1, const void* elem2);
#define __QSortCompareProc_DEFINED__
#endif // !defined(__QSortCompareProc_DEFINED__)
int __cdecl str_memcmp(const void* elem1, const void* elem2);
#if !defined(WIN32)
#define lstrcmp strcmp
#define lstrcmpi strcasecmp
char* _strupr(char *string);
char* _strlwr(char *string);
#endif // !defined(WIN32)
int __cdecl str_Compare(const void* elem1, const void* elem2);
int __cdecl str_CompareReverse(const void* elem1, const void* elem2);
int __cdecl str_CompareIC(const void* elem1, const void* elem2);
int __cdecl str_CompareICReverse(const void* elem1, const void* elem2);
DECLARE_TARRAYREF(CStr);
class CStr
{
private:
CHAR* m_psz;
// all data in this section must be INITIALIZED!!!!!!!!!!!!!
public:
CStr();
CStr(const CHAR* pcsz);
CStr(const CHAR* pcsz, int nLen);
CStr(CHAR c, int nLen);
CStr(const CStr& that);
private:
CStr(int nMax);
public:
~CStr();
public:
operator const CHAR* () const { return m_psz; }
CHAR* GetRawBuffer() const { return m_psz; } // be very cautious!!!!
int GetLength() const { return strlen(m_psz); }
BOOL IsEmpty() const { return m_psz[0] == '\0'; }
const CHAR* String() const { return m_psz; }
const CHAR* Empty();
void Swap(CStr& that);
#ifdef USE_STRLOCK
WORD IsLocked() const;
CHAR* LockBuffer();
WORD UnlockBuffer();
#endif // USE_STRLOCK
#ifndef _DEBUG
#define CheckRange(nIndex)
#else // _DEBUG
void CheckRange(int nIndex) const
{
ASSERT((0 <= nIndex) && (nIndex <= lstrlen(m_psz)));
}
#endif // !_DEBUG
CHAR operator () (int nIndex) const { CheckRange(nIndex); return m_psz[nIndex]; }
const CHAR& operator [] (int nIndex) const { CheckRange(nIndex); return m_psz[nIndex]; }
CHAR& operator [] (int nIndex) { CheckRange(nIndex); return m_psz[nIndex]; }
CHAR GetAt(int nIndex) const { CheckRange(nIndex); return m_psz[nIndex]; }
void SetAt(int nIndex, CHAR c) { CheckRange(nIndex); m_psz[nIndex] = c; }
#ifndef _DEBUG
#undef CheckRange
#endif // !_DEBUG
const CHAR* Assign(const CHAR* pcsz, int nLen = -1);
CStr& operator = (const CHAR* pcsz) { Assign(pcsz); return *this; }
CStr& operator = (const CStr& that) { Assign(that.m_psz); return *this; }
BOOL operator == (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) == 0: m_psz[0] == '\0'; }
BOOL operator != (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) != 0: m_psz[0] != '\0'; }
BOOL operator > (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) > 0: m_psz[0] != '\0'; }
BOOL operator >= (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) >= 0: TRUE; }
BOOL operator < (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) < 0: FALSE; }
BOOL operator <= (const CHAR* pcsz) const { return pcsz ? strcmp(m_psz, pcsz) <= 0: m_psz[0] == '\0'; }
CStr operator + (const CHAR* pcsz) const;
CStr& operator += (const CHAR* pcsz);
CStr operator + (CHAR c) const;
CStr& operator += (CHAR c);
void MakeUpper() { _strupr(m_psz); }
void MakeLower() { _strlwr(m_psz); }
void MakeReverse();
const CHAR* Prune(const CHAR* pcszDELs = NULL);
const CHAR* TrimLeft();
const CHAR* TrimRight();
const CHAR* TrimAll();
void __cdecl Format(LPCTSTR lpszFormat, ...);
void vFormat(LPCTSTR lpszFormat, va_list marker);
CHAR* GetBuffer(int nLen);
const CHAR* ReleaseBuffer(int nLen = -1);
CHAR* GetBufferSetLength(int nLen);
void ChangeChars(CHAR cBefore, CHAR cAfter);
BOOL AsDirectory(BOOL bRemoveLastDEL = FALSE);
BOOL AddDirDEL();
int FindExtPos() const;
const char* FindExt() const;
BOOL ChangeExt(const char* pcszExt, BOOL bForce = TRUE);
const CHAR* Left(CStr& strLeft, int nCount) const;
const CHAR* Right(CStr& strRight, int nCount) const;
const CHAR* Mid(CStr& strMid, int nFirst) const;
const CHAR* Mid(CStr& strMid, int nFirst, int nCount) const;
CStr Left(int nCount) const;
CStr Right(int nCount) const;
CStr Mid(int nFirst) const;
CStr Mid(int nFirst, int nCount) const;
int FindNext(CHAR c, int nStart) const;
int Find(CHAR c) const;
int rFindNext(CHAR c, int nStart) const;
int rFind(CHAR c) const;
int Find(const CHAR* pcsz, int nStart) const;
int Find(const CHAR* pcsz) const;
int FindSet(const CHAR* pcszSet) const;
int rFindSet(const CHAR* pcszSet) const;
#if defined(WIN32)
BOOL GetWindowText(HWND hWnd);
#endif // defined(WIN32)
protected:
const CHAR* AssignNoCheck(const CHAR* pcsz, int nLen = -1);
private:
CHAR* Reset();
#ifdef USE_STRLOCK
CHAR* ResetLocked();
#endif // USE_STRLOCK
};
#if !defined(USE_CSTR_ISTREAM) && defined(_INC_ISTREAM)
#define USE_CSTR_ISTREAM
#endif // !defined(USE_CSTR_ISTREAM) && defined(_INC_ISTREAM)
#if defined(NO_USE_CSTR_ISTREAM)
#undef USE_CSTR_ISTREAM
#endif // defined(NO_USE_CSTR_ISTREAM)
#ifdef USE_CSTR_ISTREAM
istream& operator >> (istream& s, CStr& str);
#endif // USE_CSTR_ISTREAM
#define LSTRS_TOLOWER 0x0001
#define LSTRS_TOUPPER 0x0002
#define LSTRS_ALLOWDUP 0x0004
#define LSTRS_DOSORT 0x0008
class CStrArray : public TARRAYREF(CStr)
{
public:
int GetTotalLength() const;
int Find(const char* pcsz) const;
int AddIfNotFound(const char* pcsz);
int AddIfNotFound(const CStr astrs[], int nCount);
void Sort(QSortCompareProc pQSortCompareProc = (QSortCompareProc)NULL);
BOOL LoadStrs(const char* pcszFile, const char* pcszVals = NULL, UINT uFlags = 0);
BOOL LoadStrs(FILE* pFile, const char* pcszVals = NULL, UINT uFlags = 0);
void LSTRS_CheckAdd(CStr& str, UINT uFlags);
};
#ifdef _DEBUG
#define ASSERT_VALIDSTRING(pcszStr) ASSERT(IsValidString(pcszStr))
#define ASSERT_VALIDSTRINGSAFE(pcszStr) ASSERT(IsValidStringSafe(pcszStr))
#define ASSERT_CLSPTR(p) ASSERT(IsValidMemory(p, sizeof(*p), TRUE))
BOOL IsValidString(const CHAR* pcszStr, int nLen = -1);
BOOL IsValidStringSafe(const CHAR* pcszStr, int nLen = -1);
BOOL IsValidMemory(const void* pMem, UINT uBytes, BOOL bWriteCheck = TRUE);
BOOL IsValidMemorySafe(const void* pMem, UINT uBytes, BOOL bWriteCheck = TRUE);
#else // !_DEBUG
#define ASSERT_VALIDSTRING(pcszStr)
#define ASSERT_VALIDSTRINGSAFE(pcszStr)
#define ASSERT_CLSPTR(p)
inline BOOL __RelIsValidAddr(const void* p, int nLen = -1) { &p, &nLen; return TRUE; }
#define IsValidString 1 ? 1: __RelIsValidAddr
#define IsValidStringSafe 1 ? 1: __RelIsValidAddr
#define IsValidMemory 1 ? 1: __RelIsValidAddr
#define IsValidMemorySafe 1 ? 1: __RelIsValidAddr
#endif // _DEBUG
#ifdef _DEBUG
void CStrTestMain();
#endif // _DEBUG
#endif // !defined(__CStr__)
@@ -0,0 +1,129 @@
// GraphView.cpp : implementation file
//
#include "stdafx.h"
#include "AnimScript.h"
#include "GraphView.h"
#include "AnimScriptDoc.h"
#include <math.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGraphView
IMPLEMENT_DYNCREATE(CGraphView, CScrollView)
CGraphView::CGraphView()
{
}
CGraphView::~CGraphView()
{
}
BEGIN_MESSAGE_MAP(CGraphView, CScrollView)
//{{AFX_MSG_MAP(CGraphView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGraphView drawing
CButton *pButton = NULL;
void CGraphView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CRect rc;
GetClientRect(&rc);
CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = rc.right;
sizeTotal.cy = rc.bottom;
//sizeTotal = this->GetTotalSize();
SetScrollSizes(MM_TEXT, sizeTotal);
}
void CGraphView::OnDraw(CDC* pDC)
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc->m_pSelectedNode;
CSize sz = GetTotalSize();
CDC dcMemory;
dcMemory.CreateCompatibleDC(pDC);
pDC->BitBlt(0,0,sz.cx,sz.cy,&dcMemory,sz.cx,sz.cy,BLACKNESS);
bool hascurves = false;
if (pNode)
{
POSITION pos = pNode->m_mapParams.GetStartPosition();
while (pos)
{
CObject *pObj;
WORD iKey;
pNode->m_mapParams.GetNextAssoc(pos,iKey,pObj);
CParamNode *pParam = (CParamNode *)pObj;
switch (iKey)
{
case PARAM_STARTOVERLAPCURVE:
case PARAM_ENDOVERLAPCURVE:
{
// Draw the curve
CCurveTypeNode *pCurve = (CCurveTypeNode *)pParam;
float xMult = ((float)sz.cx)/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (pCurve->curveType>=0)
{
hascurves = true;
for (int x=0;x<100;x++)
{
double y = pCurve->Play(((double)x)/(double)100.0);
if ((y>0.0)&&(y<sz.cy))
pDC->SetPixel(x*xMult,sz.cy-y*yMult,RGB(255,255,0));
}
}
break;
}
default:
{
}
}
}
if (!hascurves)
{
for (int x=0;x<sz.cx;x++)
{
int y = (int)(50.0+50.0*sin(x/10.0));
if ((y>0)&&(y<sz.cy))
pDC->SetPixel(x,y,RGB(0,255,0));
}
}
}
}
/////////////////////////////////////////////////////////////////////////////
// CGraphView diagnostics
#ifdef _DEBUG
void CGraphView::AssertValid() const
{
CScrollView::AssertValid();
}
void CGraphView::Dump(CDumpContext& dc) const
{
CScrollView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGraphView message handlers
@@ -0,0 +1,53 @@
#if !defined(AFX_GRAPHVIEW_H__7CADECD6_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_GRAPHVIEW_H__7CADECD6_6795_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GraphView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CGraphView view
class CGraphView : public CScrollView
{
protected:
CGraphView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CGraphView)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGraphView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnInitialUpdate(); // first time after construct
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CGraphView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(CGraphView)
// 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_GRAPHVIEW_H__7CADECD6_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,334 @@
// GraphView1.cpp : implementation file
//
#include "stdafx.h"
#include "animscript.h"
#include "GraphView1.h"
#include "AnimScriptDoc.h"
#include <math.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGraphView1
IMPLEMENT_DYNCREATE(CGraphView1, CView)
CGraphView1::CGraphView1()
{
}
CGraphView1::~CGraphView1()
{
}
BEGIN_MESSAGE_MAP(CGraphView1, CView)
//{{AFX_MSG_MAP(CGraphView1)
ON_WM_CREATE()
ON_WM_DESTROY()
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGraphView1 drawing
void CGraphView1::OnDraw(CDC* pDC)
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc?pDoc->m_pSelectedNode:NULL;
CSize sz;
CRect rc;
GetClientRect(&rc);
sz.cx = rc.right;
sz.cy = rc.bottom;
//pDC->BitBlt(0,0,sz.cx,sz.cy,NULL,sz.cx,sz.cy,BLACKNESS);
bool hascurves = false;
if (pNode)
{
CCurveTypeNode *pStartOverlapCurve = NULL;
CCurveTypeNode *pEndOverlapCurve = NULL;
float
start = 0.0f,
transitionstart = 0.0f,
playoldstatetill = 0.0f,
startnewstate = 0.0f,
overridenewstateposition = 0.0f;
CPathNode *pPath = NULL,*pNewPath = NULL;
CTransStateNode *pTrans = NULL;
if (pNode->IsTransition())
pTrans = (CTransStateNode *)pNode;
POSITION pos = pNode->m_mapParams.GetStartPosition();
while (pos)
{
CObject *pObj;
WORD iKey;
pNode->m_mapParams.GetNextAssoc(pos,iKey,pObj);
CParamNode *pParam = (CParamNode *)pObj;
switch (iKey)
{
case PARAM_START:
{
start = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_TRANSITIONSTART:
{
transitionstart = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_PLAYOLDSTATETILL:
{
playoldstatetill = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_STARTNEWSTATE:
{
startnewstate = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_OVERRIDENEWSTATEPOSITION:
{
overridenewstateposition = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_STARTOVERLAPCURVE:
{
pStartOverlapCurve = (CCurveTypeNode *)pParam;
break;
}
case PARAM_ENDOVERLAPCURVE:
{
pEndOverlapCurve = (CCurveTypeNode *)pParam;
CObject *pNObj;
for (int x=PARAM_SLOWUPANIM;x<PARAM_COUNT;x++)
{
if (pTrans->m_pEndNode->m_mapParams.Lookup(x,pNObj))
{
pNewPath = (CPathNode *)pNObj;
break;
}
}
hascurves = true;
break;
}
case PARAM_ANIM:
case PARAM_FASTANIM:
case PARAM_SLOWANIM:
case PARAM_SLOWUPANIM:
case PARAM_SLOWEVENANIM:
case PARAM_SLOWDOWNANIM:
case PARAM_FASTUPANIM:
case PARAM_FASTEVENANIM:
case PARAM_FASTDOWNANIM:
case PARAM_UPANIM:
case PARAM_EVENANIM:
case PARAM_DOWNANIM:
case PARAM_LEFTANIM:
case PARAM_RIGHTANIM:
case PARAM_SLOWLEFTANIM:
case PARAM_SLOWRIGHTANIM:
case PARAM_FASTLEFTANIM:
case PARAM_FASTRIGHTANIM:
{
pPath = (CPathNode *)pParam;
break;
}
default:
{
}
}
}
if (!hascurves)
{
for (int x=0;x<sz.cx;x++)
{
int y = (int)(50.0+50.0*sin(x/10.0));
if ((y>0)&&(y<sz.cy))
pDC->SetPixel(x,y,RGB(0,255,0));
}
}
else if (pNewPath)
{
float totaltime = (transitionstart+playoldstatetill)-start;
totaltime += startnewstate - playoldstatetill;
totaltime += pNewPath->m_pAnimData->animHeaderBlock->endTime - overridenewstateposition;
{
// Draw a tick every 0.5 seconds
float yMult = ((float)sz.cy)/2.0f;
float y = 1.4f;
for (float x=0.0f;x<totaltime;x+=0.5f)
{
float xpos = ((float)sz.cx)*(x/totaltime);
pDC->SetPixel(xpos,sz.cy-y*yMult,RGB(255,255,255));
}
}
{
// Draw the Old State
float curvestart = 0.0f;
float curveend = transitionstart+playoldstatetill;
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=0;x<100;x++)
{
double y = 1.1f;
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(0,255,0));
}
}
}
{
// Draw the Start overlap curve
float curvestart = start+pStartOverlapCurve->timeStart;
float curveend = (transitionstart+pStartOverlapCurve->timeEnd);
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=pStartOverlapCurve->timeStart*100;x<(100*pStartOverlapCurve->timeEnd);x++)
{
double y = pStartOverlapCurve->Play(((double)x)/(double)100.0);
if ((y>0.0)&&(y<sz.cy))
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(255,255,0));
}
}
}
if (pPath && pPath->m_pAnimData && pPath->m_pAnimData->animHeaderBlock)
{
// Draw the Transition State
float curvestart = transitionstart+pPath->m_pAnimData->animHeaderBlock->startTime;
float curveend = transitionstart+pPath->m_pAnimData->animHeaderBlock->endTime;
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=0;x<100;x++)
{
double y = 1.2f;
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(255,0,0));
}
}
}
if (pEndOverlapCurve && pEndOverlapCurve->curveType>=0)
{
// Draw the End overlap curve
float curvestart = transitionstart+startnewstate+pEndOverlapCurve->timeStart;
float curveend = transitionstart+startnewstate+(pEndOverlapCurve->timeEnd-overridenewstateposition);
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=pEndOverlapCurve->timeStart*100;x<(100*pEndOverlapCurve->timeEnd);x++)
{
double y = pEndOverlapCurve->Play(((double)x)/(double)100.0);
if ((y>0.0)&&(y<sz.cy))
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(255,255,0));
}
}
}
if (pNewPath && pNewPath->m_pAnimData && pNewPath->m_pAnimData->animHeaderBlock)
{
// Draw the new state
float curvestart = transitionstart+startnewstate;
float curveend = curvestart+(pNewPath->m_pAnimData->animHeaderBlock->endTime - overridenewstateposition);
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=0;x<100;x++)
{
double y = 1.3f;
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(0,0,255));
}
}
}
}
}
}
/////////////////////////////////////////////////////////////////////////////
// CGraphView1 diagnostics
#ifdef _DEBUG
void CGraphView1::AssertValid() const
{
CView::AssertValid();
}
void CGraphView1::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGraphView1 message handlers
int CGraphView1::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
return 0;
}
BOOL CGraphView1::PreCreateWindow(CREATESTRUCT& cs)
{
CCreateContext *pContext = (CCreateContext *)cs.lpCreateParams;
return CView::PreCreateWindow(cs);
}
void CGraphView1::OnDestroy()
{
CView::OnDestroy();
}
void CGraphView1::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
RedrawWindow();
}
BOOL CGraphView1::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CSize sz;
CRect rc;
GetClientRect(&rc);
sz.cx = rc.right;
sz.cy = rc.bottom;
pDC->BitBlt(0,0,sz.cx,sz.cy,NULL,sz.cx,sz.cy,BLACKNESS);
return 0;
//CView::OnEraseBkgnd(pDC);
}
@@ -0,0 +1,57 @@
#if !defined(AFX_GRAPHVIEW1_H__A80735F6_6C98_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_GRAPHVIEW1_H__A80735F6_6C98_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GraphView1.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CGraphView1 view
class CGraphView1 : public CView
{
protected:
CGraphView1(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CGraphView1)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGraphView1)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CGraphView1();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CGraphView1)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GRAPHVIEW1_H__A80735F6_6C98_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,133 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "AnimScript.h"
#include "MainFrm.h"
#include "AnimScriptDoc.h"
#include "StateTreeView.h"
#include "GraphView1.h"
#include "GraphView.h"
#include "StateParamView.h"
#include "modifyview.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}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, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (m_wndSplitter.CreateStatic(this,1,2))
{
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CStateTreeView),CSize(300,100),pContext);
if (m_wndSplitter1.CreateStatic(&m_wndSplitter,3,1,WS_CHILD | WS_VISIBLE | WS_BORDER,m_wndSplitter.IdFromRowCol(0, 1)))
{
m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CStateParamView),CSize(400,200),pContext);
m_wndSplitter1.CreateView(1,0,RUNTIME_CLASS(CModifyView),CSize(400,100),pContext);
m_wndSplitter1.CreateView(2,0,RUNTIME_CLASS(CGraphView1),CSize(0,0),pContext);
CGraphView1 *pGraph = (CGraphView1 *)m_wndSplitter1.GetPane(2,0);
// pGraph->m_pDocument = pContext->m_pCurrentDoc;
pContext->m_pCurrentDoc->AddView(pGraph);
}
return TRUE;
}
return CFrameWnd::OnCreateClient(lpcs, pContext);
}
@@ -0,0 +1,63 @@
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__7CADECC8_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_MAINFRM_H__7CADECC8_6795_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
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);
protected:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//}}AFX_VIRTUAL
// Implementation
public:
CSplitterWnd m_wndSplitter,m_wndSplitter1;
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;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}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__7CADECC8_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,77 @@
// ModifyAttribDlg.cpp : implementation file
//
#include "stdafx.h"
#include "animscript.h"
#include "ModifyAttribDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CModifyAttribDlg dialog
CModifyAttribDlg::CModifyAttribDlg(CWnd* pParent /*=NULL*/)
: CDialog(CModifyAttribDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CModifyAttribDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CModifyAttribDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CModifyAttribDlg)
DDX_Control(pDX, IDC_LIST_ATTRIB, m_listAttrib);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CModifyAttribDlg, CDialog)
//{{AFX_MSG_MAP(CModifyAttribDlg)
ON_LBN_SELCHANGE(IDC_LIST_ATTRIB, OnSelchangeListAttrib)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CModifyAttribDlg message handlers
extern char g_szAttribTypeNames[][30];
BOOL CModifyAttribDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_iType = m_pAttribNode->m_iType;
for (int x=0;x<4;x++)
{
int index = m_listAttrib.AddString(g_szAttribTypeNames[x]);
m_listAttrib.SetItemData(index,x);
if (x == m_iType)
m_listAttrib.SetCurSel(index);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CModifyAttribDlg::OnSelchangeListAttrib()
{
int index = m_listAttrib.GetCurSel();
m_iType = m_listAttrib.GetItemData(index);
CString str;
m_listAttrib.GetText(index,str);
m_pAttribNode->m_strName = str;
}
void CModifyAttribDlg::OnOK()
{
m_pAttribNode->m_iType = m_iType;
m_pAttribNode->m_strName = g_szAttribTypeNames[m_iType];
CDialog::OnOK();
}
@@ -0,0 +1,50 @@
#if !defined(AFX_MODIFYATTRIBDLG_H__A80735F5_6C98_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_MODIFYATTRIBDLG_H__A80735F5_6C98_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ModifyAttribDlg.h : header file
//
#include "animNode.h"
/////////////////////////////////////////////////////////////////////////////
// CModifyAttribDlg dialog
class CModifyAttribDlg : public CDialog
{
// Construction
public:
CModifyAttribDlg(CWnd* pParent = NULL); // standard constructor
CAttribTypeNode *m_pAttribNode;
int m_iType;
// Dialog Data
//{{AFX_DATA(CModifyAttribDlg)
enum { IDD = IDD_MODIFY_ATTRIB };
CListBox m_listAttrib;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CModifyAttribDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CModifyAttribDlg)
virtual void OnOK();
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeListAttrib();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MODIFYATTRIBDLG_H__A80735F5_6C98_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,143 @@
// ModifyCurveParam.cpp : implementation file
//
#include "stdafx.h"
#include "animscript.h"
#include "ModifyCurveParam.h"
#include "mw4headers.hpp"
#include "Vehicle.hpp"
#include "MechAnimationState.hpp"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CModifyCurveParam dialog
CModifyCurveParam::CModifyCurveParam(CWnd* pParent /*=NULL*/)
: CDialog(CModifyCurveParam::IDD, pParent)
{
//{{AFX_DATA_INIT(CModifyCurveParam)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CModifyCurveParam::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CModifyCurveParam)
DDX_Control(pDX, IDC_EDIT_START, m_ctrlEditStart);
DDX_Control(pDX, IDC_EDIT_MIN, m_ctrlEditMin);
DDX_Control(pDX, IDC_EDIT_MAX, m_ctrlEditMax);
DDX_Control(pDX, IDC_EDIT_END, m_ctrlEditEnd);
DDX_Control(pDX, IDC_CHECK_INVERTTIME, m_ctrlCheckTime);
DDX_Control(pDX, IDC_CHECK_INVERTSCALE, m_ctrlCheckScale);
DDX_Control(pDX, IDC_COMBO_CURVETYPE, m_ctrlCurveType);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CModifyCurveParam, CDialog)
//{{AFX_MSG_MAP(CModifyCurveParam)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CModifyCurveParam message handlers
extern char g_szCurveTypeNames[][40];
BOOL CModifyCurveParam::OnInitDialog()
{
CDialog::OnInitDialog();
assert(this->m_pCurveNode);
iCurveType = m_pCurveNode->curveType;
min = m_pCurveNode->curveMin;
max = m_pCurveNode->curveMax;
start = m_pCurveNode->timeStart;
end = m_pCurveNode->timeEnd;
inverttime = m_pCurveNode->invertTime;
invertscale = m_pCurveNode->invertScale;
for (int x=0;x<=MechWarrior4::AnimCurve::CurveTypeCount;x++)
{
int index = m_ctrlCurveType.AddString(g_szCurveTypeNames[x]);
m_ctrlCurveType.SetItemData(index,x);
}
for (x=0;x<m_ctrlCurveType.GetCount();x++)
{
if ( (iCurveType+1) == m_ctrlCurveType.GetItemData(x))
break;
}
// So iCurveType is really the index of the current item
iCurveType = x;
CString str;
m_ctrlCurveType.SetCurSel(iCurveType);
str.Format("%f",start);
m_ctrlEditStart.SetWindowText(str);
str.Format("%f",end);
m_ctrlEditEnd.SetWindowText(str);
str.Format("%f",min);
m_ctrlEditMin.SetWindowText(str);
str.Format("%f",max);
m_ctrlEditMax.SetWindowText(str);
m_ctrlCheckTime.SetCheck(inverttime);
m_ctrlCheckScale.SetCheck(invertscale);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CModifyCurveParam::OnOK()
{
// verify that a curve type is selected
int index = m_ctrlCurveType.GetCurSel();
if (-1 == index)
{
MessageBox("You Must Select a Curve Type",NULL,MB_OK);
m_ctrlCurveType.SetCurSel(iCurveType);
return;
}
iCurveType = m_ctrlCurveType.GetItemData(index);
// Verify that all of the text data is correct
CString str;
m_ctrlEditStart.GetWindowText(str);
start = atof(str);
m_ctrlEditEnd.GetWindowText(str);
end = atof(str);
m_ctrlEditMin.GetWindowText(str);
min = atof(str);
m_ctrlEditMax.GetWindowText(str);
max = atof(str);
inverttime = m_ctrlCheckTime.GetCheck();
invertscale = m_ctrlCheckScale.GetCheck();
Clamp(min, 0.0f, 1.0f);
Clamp(max, 0.0f, 1.0f);
Clamp(start, 0.0f, 1.0f);
Clamp(end, 0.0f, 1.0f);
// Now copy the data back in the node
m_pCurveNode->m_iType = m_pCurveNode->curveType = iCurveType-1;
m_pCurveNode->curveMin = min;
m_pCurveNode->curveMax = max;
m_pCurveNode->timeStart = start;
m_pCurveNode->timeEnd = end;
m_pCurveNode->invertTime = inverttime;
m_pCurveNode->invertScale = invertscale;
CDialog::OnOK();
}
@@ -0,0 +1,58 @@
#if !defined(AFX_MODIFYCURVEPARAM_H__2FC2D4B2_6B42_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_MODIFYCURVEPARAM_H__2FC2D4B2_6B42_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ModifyCurveParam.h : header file
//
#include "animNode.h"
/////////////////////////////////////////////////////////////////////////////
// CModifyCurveParam dialog
class CModifyCurveParam : public CDialog
{
// Construction
public:
CCurveTypeNode *m_pCurveNode;
CModifyCurveParam(CWnd* pParent = NULL); // standard constructor
int iCurveType;
double min,max,start,end;
bool inverttime,invertscale;
// Dialog Data
//{{AFX_DATA(CModifyCurveParam)
enum { IDD = IDD_MODIFY_CURVE };
CEdit m_ctrlEditStart;
CEdit m_ctrlEditMin;
CEdit m_ctrlEditMax;
CEdit m_ctrlEditEnd;
CButton m_ctrlCheckTime;
CButton m_ctrlCheckScale;
CComboBox m_ctrlCurveType;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CModifyCurveParam)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CModifyCurveParam)
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_MODIFYCURVEPARAM_H__2FC2D4B2_6B42_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,62 @@
// ModifyFloat.cpp : implementation file
//
#include "stdafx.h"
#include "animscript.h"
#include "ModifyFloat.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CModifyFloat dialog
CModifyFloat::CModifyFloat(CWnd* pParent /*=NULL*/)
: CDialog(CModifyFloat::IDD, pParent)
{
//{{AFX_DATA_INIT(CModifyFloat)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CModifyFloat::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CModifyFloat)
DDX_Control(pDX, IDC_EDIT_VALUE, m_editValue);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CModifyFloat, CDialog)
//{{AFX_MSG_MAP(CModifyFloat)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CModifyFloat message handlers
void CModifyFloat::OnOK()
{
CString str;
m_editValue.GetWindowText(str);
m_pFloatNode->SetValue(str);
CDialog::OnOK();
}
BOOL CModifyFloat::OnInitDialog()
{
CDialog::OnInitDialog();
m_editValue.SetWindowText(m_pFloatNode->GetValue());
m_editValue.SetFocus();
m_editValue.SetSel(MAKELONG(0,-1));
return false;
//return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -0,0 +1,48 @@
#if !defined(AFX_MODIFYFLOAT_H__A80735F3_6C98_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_MODIFYFLOAT_H__A80735F3_6C98_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ModifyFloat.h : header file
//
#include "animNode.h"
/////////////////////////////////////////////////////////////////////////////
// CModifyFloat dialog
class CModifyFloat : public CDialog
{
// Construction
public:
CModifyFloat(CWnd* pParent = NULL); // standard constructor
CFloatNode *m_pFloatNode;
// Dialog Data
//{{AFX_DATA(CModifyFloat)
enum { IDD = IDD_MODIFY_FLOAT };
CEdit m_editValue;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CModifyFloat)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CModifyFloat)
virtual void OnOK();
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_MODIFYFLOAT_H__A80735F3_6C98_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,181 @@
// ModifyPathDlg.cpp : implementation file
//
#include "stdafx.h"
#include "animscript.h"
#include "ModifyPathDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CModifyPathDlg dialog
/*
int CALLBACK BrowseCallbackProc(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
RECT rect;
//
//Center the browse dialog on the screen...
//
switch (uMsg)
{
case BFFM_INITIALIZED:
{
char szPath[MAX_PATH];
strcpy(szPath,(char *)lpData);
//CString strCurrent = (CString)lpData;
char szCurDir[MAX_PATH];
GetCurrentDirectory(MAX_PATH,szCurDir);
strcat(szCurDir,"\\");
strcat(szCurDir,szPath);
SendMessage(hWnd,BFFM_SETSELECTION,TRUE,(LPARAM)szCurDir);
if (GetWindowRect(hWnd, &rect))
{
SetWindowPos(hWnd,
HWND_TOP,
(GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) >> 1,
(GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) >> 1,
0,
0,
SWP_NOSIZE);
}
}
}
return 0;
}
CString BrowseDirectory(const char *strCurrent,CWnd *pWnd)
{
CString str;
TCHAR szBuffer[MAX_PATH];
LPITEMIDLIST pidlBrowse,pidlRoot;
BROWSEINFO bi;
LPMALLOC lpMalloc;
SHGetMalloc(&lpMalloc);
ASSERT(lpMalloc);
bi.hwndOwner = pWnd->GetSafeHwnd();
// Get the ID for the "My Computer" root folder
SHGetSpecialFolderLocation(pWnd->GetSafeHwnd(),CSIDL_DRIVES,&pidlRoot);
bi.pidlRoot = pidlRoot;
bi.pszDisplayName = szBuffer;
// Localize the descriptive text
bi.lpszTitle = "Select Destination Folder";
// BIF_EDITBOX and BIF_VALIDATE are for versions 4.71 and later, they
// might be ignored by older versions
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_EDITBOX;// | BIF_USENEWUI;// | BIF_VALIDATE;
bi.lParam = 0;
bi.iImage = NULL;
bi.lpfn = BrowseCallbackProc;
bi.lParam = (LPARAM)strCurrent;
//
//Call the Windows shell folder browsing routine...
//
pidlBrowse = SHBrowseForFolder(&bi);
if (NULL != pidlBrowse)
{
if (SHGetPathFromIDList(pidlBrowse, szBuffer))
{
if ('\\' == szBuffer[lstrlen(szBuffer)-1])
szBuffer[lstrlen(szBuffer)-1] = '\0';
str = CString(szBuffer);
}
else
str = "";
//
//Free up shell memory used...
//
lpMalloc->Free(pidlBrowse);
}
else
str = "";
lpMalloc->Free(pidlRoot);
lpMalloc->Release();
return str;
}
*/
CModifyPathDlg::CModifyPathDlg(CWnd* pParent /*=NULL*/)
: CDialog(CModifyPathDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CModifyPathDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CModifyPathDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CModifyPathDlg)
DDX_Control(pDX, IDC_EDIT_PATH, m_editPath);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CModifyPathDlg, CDialog)
//{{AFX_MSG_MAP(CModifyPathDlg)
ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CModifyPathDlg message handlers
void CModifyPathDlg::OnBrowse()
{
CString strCurrent;
m_editPath.GetWindowText(strCurrent);
char szCurDir[MAX_PATH];
GetCurrentDirectory(MAX_PATH,szCurDir);
strcat(szCurDir,"\\");
int curDirLen = strlen(szCurDir);
strcat(szCurDir,m_strPath);
char szDrive[MAX_PATH];
CFileDialog dlg(true);
{
char szDir[MAX_PATH];
char szOld[MAX_PATH];
strcpy(szOld,szCurDir);
_splitpath(szOld,szDrive,szDir,NULL,NULL);
strcat(szDrive,szDir);
if (szDrive[strlen(szDrive)-1] == '\\')
szDrive[strlen(szDrive)-1] = '\0';
dlg.m_ofn.lpstrInitialDir = szDrive;
}
dlg.m_ofn.lpstrFile = szCurDir;
if (IDOK == dlg.DoModal())
{
CString path = dlg.GetPathName();
char *localpath = ((char *)(LPCTSTR)path)+curDirLen;
m_editPath.SetWindowText(localpath);
}
}
BOOL CModifyPathDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_strPath = m_pPathNode->GetValue();
m_editPath.SetWindowText(m_strPath);
m_editPath.SetFocus();
m_editPath.SetSel(MAKELONG(0,-1));
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CModifyPathDlg::OnOK()
{
m_pPathNode->SetValue(m_strPath);
CDialog::OnOK();
}
@@ -0,0 +1,50 @@
#if !defined(AFX_MODIFYPATHDLG_H__A80735F4_6C98_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_MODIFYPATHDLG_H__A80735F4_6C98_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ModifyPathDlg.h : header file
//
#include "animNode.h"
/////////////////////////////////////////////////////////////////////////////
// CModifyPathDlg dialog
class CModifyPathDlg : public CDialog
{
// Construction
public:
CModifyPathDlg(CWnd* pParent = NULL); // standard constructor
CPathNode *m_pPathNode;
CString m_strPath;
// Dialog Data
//{{AFX_DATA(CModifyPathDlg)
enum { IDD = IDD_MODIFY_PATH };
CEdit m_editPath;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CModifyPathDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CModifyPathDlg)
afx_msg void OnBrowse();
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_MODIFYPATHDLG_H__A80735F4_6C98_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,473 @@
// ModifyView.cpp : implementation file
//
#include "stdafx.h"
#include "animscript.h"
#include "ModifyView.h"
#include "AnimScriptDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CModifyView
IMPLEMENT_DYNCREATE(CModifyView, CFormView)
CModifyView::CModifyView()
: CFormView(CModifyView::IDD)
{
//{{AFX_DATA_INIT(CModifyView)
//}}AFX_DATA_INIT
}
CModifyView::~CModifyView()
{
}
void CModifyView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CModifyView)
DDX_Control(pDX, IDC_SLIDER_OVERRIDE, m_ctrlOverride);
DDX_Control(pDX, IDC_SLIDER_TRANSSTART, m_ctrlTransStart);
DDX_Control(pDX, IDC_SLIDER_STARTNEW, m_ctrlStartNew);
DDX_Control(pDX, IDC_SLIDER_PLAYOLDTILL, m_ctrlPlayTill);
DDX_Control(pDX, IDC_SLIDER_START, m_ctrlStart);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CModifyView, CFormView)
//{{AFX_MSG_MAP(CModifyView)
ON_WM_CREATE()
ON_WM_LBUTTONDOWN()
ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER_START, OnCustomdrawSliderStart)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_START, OnReleasedcaptureSliderStart)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_TRANSSTART, OnReleasedcaptureSliderTransstart)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_STARTNEW, OnReleasedcaptureSliderStartnew)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_PLAYOLDTILL, OnReleasedcaptureSliderPlayoldtill)
ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER_PLAYOLDTILL, OnCustomdrawSliderPlayoldtill)
ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER_STARTNEW, OnCustomdrawSliderStartnew)
ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER_TRANSSTART, OnCustomdrawSliderTransstart)
ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER_OVERRIDE, OnCustomdrawSliderOverride)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_OVERRIDE, OnReleasedcaptureSliderOverride)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CModifyView diagnostics
#ifdef _DEBUG
void CModifyView::AssertValid() const
{
CFormView::AssertValid();
}
void CModifyView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CModifyView message handlers
void CModifyView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc?pDoc->m_pSelectedNode:NULL;
if (pNode)
{
bool hascurves = false;
CCurveTypeNode *pStartOverlapCurve = NULL;
CCurveTypeNode *pEndOverlapCurve = NULL;
float
start = 0.0f,
transitionstart = 0.0f,
playoldstatetill = 0.0f,
startnewstate = 0.0f,
overridenewstateposition = 0.0f;
CPathNode *pPath = NULL,*pNewPath = NULL;
CTransStateNode *pTrans = NULL;
if (pNode->IsTransition())
pTrans = (CTransStateNode *)pNode;
POSITION pos = pNode->m_mapParams.GetStartPosition();
while (pos)
{
CObject *pObj;
WORD iKey;
pNode->m_mapParams.GetNextAssoc(pos,iKey,pObj);
CParamNode *pParam = (CParamNode *)pObj;
switch (iKey)
{
case PARAM_START:
{
start = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_TRANSITIONSTART:
{
transitionstart = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_PLAYOLDSTATETILL:
{
playoldstatetill = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_STARTNEWSTATE:
{
startnewstate = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_OVERRIDENEWSTATEPOSITION:
{
overridenewstateposition = ((CFloatNode *)pParam)->m_fValue;
break;
}
case PARAM_STARTOVERLAPCURVE:
{
pStartOverlapCurve = (CCurveTypeNode *)pParam;
break;
}
case PARAM_ENDOVERLAPCURVE:
{
pEndOverlapCurve = (CCurveTypeNode *)pParam;
CObject *pNObj;
for (int x=PARAM_SLOWUPANIM;x<PARAM_COUNT;x++)
{
if (pTrans->m_pEndNode->m_mapParams.Lookup(x,pNObj))
{
pNewPath = (CPathNode *)pNObj;
break;
}
}
hascurves = true;
break;
}
case PARAM_ANIM:
case PARAM_FASTANIM:
case PARAM_SLOWANIM:
case PARAM_SLOWUPANIM:
case PARAM_SLOWEVENANIM:
case PARAM_SLOWDOWNANIM:
case PARAM_FASTUPANIM:
case PARAM_FASTEVENANIM:
case PARAM_FASTDOWNANIM:
case PARAM_UPANIM:
case PARAM_EVENANIM:
case PARAM_DOWNANIM:
case PARAM_LEFTANIM:
case PARAM_RIGHTANIM:
case PARAM_SLOWLEFTANIM:
case PARAM_SLOWRIGHTANIM:
case PARAM_FASTLEFTANIM:
case PARAM_FASTRIGHTANIM:
{
pPath = (CPathNode *)pParam;
break;
}
default:
{
}
}
}
if (hascurves&&pNewPath)
{
m_ctrlStart.SetPos(start*100.0f);
m_ctrlPlayTill.SetPos(playoldstatetill * 100.0f);
m_ctrlStartNew.SetPos(startnewstate * 100.0f);
m_ctrlTransStart.SetPos(transitionstart * 100.0f);
m_ctrlOverride.SetPos(overridenewstateposition* 100.0f);
float totaltime = (transitionstart+playoldstatetill)-start;
totaltime += startnewstate - playoldstatetill;
totaltime += pNewPath->m_pAnimData->animHeaderBlock->endTime - overridenewstateposition;
/* {
// Draw a tick every 0.5 seconds
float yMult = ((float)sz.cy)/2.0f;
float y = 1.4f;
for (float x=0.0f;x<totaltime;x+=0.5f)
{
float xpos = ((float)sz.cx)*(x/totaltime);
pDC->SetPixel(xpos,sz.cy-y*yMult,RGB(255,255,255));
}
}
{
// Draw the Old State
float curvestart = 0.0f;
float curveend = transitionstart+playoldstatetill;
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=0;x<100;x++)
{
double y = 1.1f;
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(0,255,0));
}
}
}
{
// Draw the Start overlap curve
float curvestart = start+pStartOverlapCurve->timeStart;
float curveend = (transitionstart+pStartOverlapCurve->timeEnd);
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=pStartOverlapCurve->timeStart*100;x<(100*pStartOverlapCurve->timeEnd);x++)
{
double y = pStartOverlapCurve->Play(((double)x)/(double)100.0);
if ((y>0.0)&&(y<sz.cy))
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(255,255,0));
}
}
}
{
// Draw the Transition State
float curvestart = transitionstart+pPath->m_pAnimData->animHeaderBlock->startTime;
float curveend = transitionstart+pPath->m_pAnimData->animHeaderBlock->endTime;
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=0;x<100;x++)
{
double y = 1.2f;
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(255,0,0));
}
}
}
if (pEndOverlapCurve->curveType>=0)
{
// Draw the End overlap curve
float curvestart = transitionstart+startnewstate+pEndOverlapCurve->timeStart;
float curveend = transitionstart+startnewstate+(pEndOverlapCurve->timeEnd-overridenewstateposition);
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=pEndOverlapCurve->timeStart*100;x<(100*pEndOverlapCurve->timeEnd);x++)
{
double y = pEndOverlapCurve->Play(((double)x)/(double)100.0);
if ((y>0.0)&&(y<sz.cy))
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(255,255,0));
}
}
}
{
// Draw the new state
float curvestart = transitionstart+startnewstate;
float curveend = curvestart+(pNewPath->m_pAnimData->animHeaderBlock->endTime - overridenewstateposition);
float range = curveend-curvestart;
float xMult = (((float)sz.cx)*(range/totaltime))/100.0f;
float yMult = ((float)sz.cy)/2.0f;
if (range>0.00001)
{
int xstart = sz.cx*(curvestart/totaltime);
for (int x=0;x<100;x++)
{
double y = 1.3f;
pDC->SetPixel(xstart+((float)x)*xMult,sz.cy-y*yMult,RGB(0,0,255));
}
}
}*/
}
}
}
void CModifyView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
m_ctrlStart.SetRange(0,100);
m_ctrlStart.SetTicFreq(50);
m_ctrlPlayTill.SetRange(0,100);
m_ctrlPlayTill.SetTicFreq(50);
m_ctrlStartNew.SetRange(0,100);
m_ctrlStartNew.SetTicFreq(50);
m_ctrlTransStart.SetRange(0,100);
m_ctrlTransStart.SetTicFreq(50);
m_ctrlOverride.SetRange(0,100);
m_ctrlOverride.SetTicFreq(50);
}
int CModifyView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFormView::OnCreate(lpCreateStruct) == -1)
return -1;
return 0;
}
BOOL CModifyView::OnCommand(WPARAM wParam, LPARAM lParam)
{
return CFormView::OnCommand(wParam, lParam);
}
LRESULT CModifyView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_LBUTTONDOWN:
{
int x=1;
break;
}
case WM_NOTIFY:
{
}
}
return CFormView::WindowProc(message, wParam, lParam);
}
void CModifyView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CFormView::OnLButtonDown(nFlags, point);
}
void CModifyView::OnReleasedcaptureSliderStart(NMHDR* pNMHDR, LRESULT* pResult)
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc?pDoc->m_pSelectedNode:NULL;
if (pNode)
{
CParamNode *pParam = pNode->GetParam(PARAM_START);
if (pParam)
{
CString str;
str.Format("%f",((float)this->m_ctrlStart.GetPos()) / 100.0f);
pParam->SetValue(str);
pDoc->UpdateAllViews(this);
}
}
*pResult = 0;
}
void CModifyView::OnReleasedcaptureSliderTransstart(NMHDR* pNMHDR, LRESULT* pResult)
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc?pDoc->m_pSelectedNode:NULL;
if (pNode)
{
CParamNode *pParam = pNode->GetParam(PARAM_TRANSITIONSTART);
if (pParam)
{
CString str;
str.Format("%f",((float)this->m_ctrlTransStart.GetPos()) / 100.0f);
pParam->SetValue(str);
pDoc->UpdateAllViews(this);
}
}
*pResult = 0;
}
void CModifyView::OnReleasedcaptureSliderStartnew(NMHDR* pNMHDR, LRESULT* pResult)
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc?pDoc->m_pSelectedNode:NULL;
if (pNode)
{
CParamNode *pParam = pNode->GetParam(PARAM_STARTNEWSTATE);
if (pParam)
{
CString str;
str.Format("%f",((float)this->m_ctrlStartNew.GetPos()) / 100.0f);
pParam->SetValue(str);
pDoc->UpdateAllViews(this);
}
}
*pResult = 0;
}
void CModifyView::OnReleasedcaptureSliderPlayoldtill(NMHDR* pNMHDR, LRESULT* pResult)
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc?pDoc->m_pSelectedNode:NULL;
if (pNode)
{
CParamNode *pParam = pNode->GetParam(PARAM_PLAYOLDSTATETILL);
if (pParam)
{
CString str;
str.Format("%f",((float)this->m_ctrlPlayTill.GetPos()) / 100.0f);
pParam->SetValue(str);
pDoc->UpdateAllViews(this);
}
}
*pResult = 0;
}
void CModifyView::OnReleasedcaptureSliderOverride(NMHDR* pNMHDR, LRESULT* pResult)
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc?pDoc->m_pSelectedNode:NULL;
if (pNode)
{
CParamNode *pParam = pNode->GetParam(PARAM_OVERRIDENEWSTATEPOSITION);
if (pParam)
{
CString str;
str.Format("%f",((float)this->m_ctrlOverride.GetPos()) / 100.0f);
pParam->SetValue(str);
pDoc->UpdateAllViews(this);
}
}
*pResult = 0;
}
void CModifyView::OnCustomdrawSliderStart(NMHDR* pNMHDR, LRESULT* pResult)
{
OnReleasedcaptureSliderStart(pNMHDR,pResult);
}
void CModifyView::OnCustomdrawSliderPlayoldtill(NMHDR* pNMHDR, LRESULT* pResult)
{
OnReleasedcaptureSliderPlayoldtill(pNMHDR,pResult);
}
void CModifyView::OnCustomdrawSliderStartnew(NMHDR* pNMHDR, LRESULT* pResult)
{
OnReleasedcaptureSliderStartnew(pNMHDR,pResult);
}
void CModifyView::OnCustomdrawSliderTransstart(NMHDR* pNMHDR, LRESULT* pResult)
{
OnReleasedcaptureSliderTransstart(pNMHDR,pResult);
}
void CModifyView::OnCustomdrawSliderOverride(NMHDR* pNMHDR, LRESULT* pResult)
{
OnReleasedcaptureSliderOverride(pNMHDR,pResult);
}
@@ -0,0 +1,82 @@
#if !defined(AFX_MODIFYVIEW_H__BB3BEA80_CCFB_11D3_AD34_0000F81AA1BA__INCLUDED_)
#define AFX_MODIFYVIEW_H__BB3BEA80_CCFB_11D3_AD34_0000F81AA1BA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ModifyView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CModifyView form view
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class CModifyView : public CFormView
{
protected:
CModifyView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CModifyView)
// Form Data
public:
//{{AFX_DATA(CModifyView)
enum { IDD = IDD_MODIFY_PARAM };
CSliderCtrl m_ctrlOverride;
CSliderCtrl m_ctrlTransStart;
CSliderCtrl m_ctrlStartNew;
CSliderCtrl m_ctrlPlayTill;
CSliderCtrl m_ctrlStart;
//}}AFX_DATA
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CModifyView)
public:
virtual void OnInitialUpdate();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CModifyView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(CModifyView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnCustomdrawSliderStart(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnReleasedcaptureSliderStart(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnReleasedcaptureSliderTransstart(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnReleasedcaptureSliderStartnew(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnReleasedcaptureSliderPlayoldtill(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnCustomdrawSliderPlayoldtill(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnCustomdrawSliderStartnew(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnCustomdrawSliderTransstart(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnCustomdrawSliderOverride(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnReleasedcaptureSliderOverride(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MODIFYVIEW_H__BB3BEA80_CCFB_11D3_AD34_0000F81AA1BA__INCLUDED_)
@@ -0,0 +1,278 @@
// PageAnimType.cpp : implementation file
//
#include "stdafx.h"
#include "animscript.h"
#include "PageAnimType.h"
#include <assert.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPageAnimType property page
IMPLEMENT_DYNCREATE(CPageAnimType, CPropertyPage)
CPageAnimType::CPageAnimType() : CPropertyPage(CPageAnimType::IDD)
{
//{{AFX_DATA_INIT(CPageAnimType)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_pDocument = NULL;
}
CPageAnimType::~CPageAnimType()
{
}
void CPageAnimType::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageAnimType)
DDX_Control(pDX, IDC_MODIFY, m_ctrlModify);
DDX_Control(pDX, IDC_LIST_PARAM, m_ctrlListParam);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageAnimType, CPropertyPage)
//{{AFX_MSG_MAP(CPageAnimType)
ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST_PARAM, OnItemchangedListParam)
ON_BN_CLICKED(IDC_MODIFY, OnModify)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageAnimType message handlers
void CPageAnimType::OnCreateExec()
{
assert(m_pDocument);
CAnimNode *pNode = m_pDocument->m_pSelectedNode;
if (NULL == pNode)
return;
switch (m_iPageType)
{
case 0:
// Animation State
{
if (pNode->m_bValid)
{
// Create Animation State Specific data
}
break;
}
case 1:
// Transition State
{
if (pNode->m_bValid)
{
}
break;
}
case 2:
// Anim Type Param
{
if (pNode->m_bValid)
{
}
break;
}
default:
assert(false);
}
}
// Called to update the window
BOOL CPageAnimType::OnApply()
{
if (::IsWindow(m_ctrlListParam.GetSafeHwnd()))
{
m_ctrlListParam.DeleteAllItems();
if (m_pDocument)
{
CAnimNode *pNode = m_pDocument->m_pSelectedNode;
if (pNode)
{
if (pNode->m_bValid)
{
POSITION pos = pNode->m_mapParams.GetStartPosition();
int x=0;
while (pos)
{
CObject *pObj;
WORD iKey;
pNode->m_mapParams.GetNextAssoc(pos,iKey,pObj);
CParamNode *pParam = (CParamNode *)pObj;
if (ShowParam(pParam))
{
int index = m_ctrlListParam.InsertItem(x,pParam->GetKeyString());
m_ctrlListParam.SetItemText(index,1,pParam->GetValueString());
m_ctrlListParam.SetItemData(index,(DWORD)pParam);
x++;
}
}
}
}
}
m_ctrlListParam.EnableWindow(ShouldEnable());
}
if (::IsWindow(m_ctrlModify.GetSafeHwnd()))
{
bool bEnable = false;
if (::IsWindow(m_ctrlListParam.GetSafeHwnd()))
{
if (m_ctrlListParam.GetSelectedCount())
bEnable = true;
}
m_ctrlModify.EnableWindow(bEnable);
}
return CPropertyPage::OnApply();
}
BOOL CPageAnimType::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_ctrlListParam.InsertColumn(0,"Parameter",LVCFMT_LEFT,100);
m_ctrlListParam.InsertColumn(1,"Value",LVCFMT_LEFT,300);
OnApply();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
bool CPageAnimType::ShouldEnable()
{
bool bEnable = false;
if (m_pDocument)
{
CAnimNode *pNode = m_pDocument->m_pSelectedNode;
if (pNode)
{
if (pNode->m_bValid)
{
bEnable = true;
if (1 == m_iPageType) // Is this a Transition Page
{
if (!pNode->IsTransition())
bEnable = false;
}
}
}
}
return bEnable;
}
bool CPageAnimType::ShowParam(CParamNode *pNode)
{
switch (m_iPageType)
{
case 0:
// Animation State
{
switch (pNode->m_iParamType)
{
case PARAM_START:
return true;
default:
return false;
}
break;
}
case 1:
// Transition State
{
switch (pNode->m_iParamType)
{
case PARAM_STARTOVERLAPCURVE:
case PARAM_ENDOVERLAPCURVE:
case PARAM_TRANSITIONSTART:
case PARAM_PLAYOLDSTATETILL:
case PARAM_OVERRIDENEWSTATEPOSITION:
case PARAM_STARTNEWSTATE:
return true;
default:
return false;
}
break;
}
case 2:
// Anim Type Param
{
switch (pNode->m_iParamType)
{
case PARAM_POSITION:
case PARAM_ANIM:
case PARAM_SPEEDATTRIB:
case PARAM_PITCHATTRIB:
case PARAM_ROLLATTRIB:
case PARAM_FASTANIM:
case PARAM_SLOWANIM:
case PARAM_SLOWSPEEDMULTIPLIER:
case PARAM_LERPTIME:
case PARAM_SLOWUPANIM:
case PARAM_SLOWEVENANIM:
case PARAM_SLOWDOWNANIM:
case PARAM_FASTUPANIM:
case PARAM_FASTEVENANIM:
case PARAM_FASTDOWNANIM:
case PARAM_UPANIM:
case PARAM_EVENANIM:
case PARAM_DOWNANIM:
case PARAM_LEFTANIM:
case PARAM_RIGHTANIM:
case PARAM_SLOWLEFTANIM:
case PARAM_SLOWRIGHTANIM:
case PARAM_FASTLEFTANIM:
case PARAM_FASTRIGHTANIM:
return true;
default:
return false;
}
}
default:
assert(false);
}
// Item that fell through!
assert(false);
return true;
}
void CPageAnimType::OnItemchangedListParam(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
if (pNMListView->uNewState & LVIS_SELECTED)
{
m_ctrlModify.EnableWindow(true);
}
else
{
m_ctrlModify.EnableWindow(false);
}
*pResult = 0;
}
void CPageAnimType::OnModify()
{
POSITION pos = m_ctrlListParam.GetFirstSelectedItemPosition();
while (pos)
{
int index = m_ctrlListParam.GetNextSelectedItem(pos);
CParamNode *pNode = (CParamNode *)m_ctrlListParam.GetItemData(index);
if (pNode)
{
if (pNode->OnModify())
m_pDocument->UpdateAllViews(NULL,0,NULL);
}
}
}
@@ -0,0 +1,60 @@
#if !defined(AFX_PAGEANIMTYPE_H__2FC2D4B1_6B42_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_PAGEANIMTYPE_H__2FC2D4B1_6B42_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageAnimType.h : header file
//
#include "AnimScriptDoc.h"
/////////////////////////////////////////////////////////////////////////////
// CPageAnimType dialog
class CPageAnimType : public CPropertyPage
{
DECLARE_DYNCREATE(CPageAnimType)
// Construction
public:
bool ShowParam(CParamNode *);
bool ShouldEnable();
CAnimScriptDoc *m_pDocument;
int m_iPageType;
void OnCreateExec();
CPageAnimType();
~CPageAnimType();
// Dialog Data
//{{AFX_DATA(CPageAnimType)
enum { IDD = IDD_PARAM_ANIMTYPE };
CButton m_ctrlModify;
CListCtrl m_ctrlListParam;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageAnimType)
public:
virtual BOOL OnApply();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageAnimType)
virtual BOOL OnInitDialog();
afx_msg void OnItemchangedListParam(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnModify();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PAGEANIMTYPE_H__2FC2D4B1_6B42_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,62 @@
// ParamPage.cpp : implementation file
//
#include "stdafx.h"
#include "animscript.h"
#include "ParamPage.h"
#include <assert.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CParamPage property page
IMPLEMENT_DYNCREATE(CParamPage, CPropertyPage)
CParamPage::CParamPage()
{
// This function is not actually called
assert(false);
m_pDocument = NULL;
m_bInitialized = false;
}
CParamPage::CParamPage(UINT id) : CPropertyPage(id)
{
m_pDocument = NULL;
m_bInitialized = false;
//{{AFX_DATA_INIT(CParamPage)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CParamPage::~CParamPage()
{
}
void CParamPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CParamPage)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CParamPage, CPropertyPage)
//{{AFX_MSG_MAP(CParamPage)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CParamPage message handlers
void CParamPage::OnCreateExec()
{
assert(false);
}
@@ -0,0 +1,56 @@
#if !defined(AFX_PARAMPAGE_H__2FC2D4B0_6B42_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_PARAMPAGE_H__2FC2D4B0_6B42_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ParamPage.h : header file
//
#include "AnimScriptDoc.h"
/////////////////////////////////////////////////////////////////////////////
// CParamPage dialog
class CParamPage : public CPropertyPage
{
DECLARE_DYNCREATE(CParamPage)
// Construction
public:
CAnimScriptDoc *m_pDocument;
bool m_bInitialized;
CParamPage();
CParamPage(UINT);
~CParamPage();
virtual void OnCreateExec();
// Dialog Data
//{{AFX_DATA(CParamPage)
// enum { IDD = _UNKNOWN_RESOURCE_ID_ };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CParamPage)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CParamPage)
// 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_PARAMPAGE_H__2FC2D4B0_6B42_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,105 @@
========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : AnimScript
========================================================================
AppWizard has created this AnimScript application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.
This file contains a summary of what you will find in each of the files that
make up your AnimScript application.
AnimScript.dsp
This file (the project file) contains information at the project level and
is used to build a single project or subproject. Other users can share the
project (.dsp) file, but they should export the makefiles locally.
AnimScript.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CAnimScriptApp application class.
AnimScript.cpp
This is the main application source file that contains the application
class CAnimScriptApp.
AnimScript.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
AnimScript.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.
res\AnimScript.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file AnimScript.rc.
res\AnimScript.rc2
This file contains resources that are not edited by Microsoft
Visual C++. You should place all resources not editable by
the resource editor in this file.
/////////////////////////////////////////////////////////////////////////////
For the main frame window:
MainFrm.h, MainFrm.cpp
These files contain the frame class CMainFrame, which is derived from
CFrameWnd and controls all SDI frame features.
res\Toolbar.bmp
This bitmap file is used to create tiled images for the toolbar.
The initial toolbar and status bar are constructed in the CMainFrame
class. Edit this toolbar bitmap using the resource editor, and
update the IDR_MAINFRAME TOOLBAR array in AnimScript.rc to add
toolbar buttons.
/////////////////////////////////////////////////////////////////////////////
AppWizard creates one document type and one view:
AnimScriptDoc.h, AnimScriptDoc.cpp - the document
These files contain your CAnimScriptDoc class. Edit these files to
add your special document data and to implement file saving and loading
(via CAnimScriptDoc::Serialize).
AnimScriptView.h, AnimScriptView.cpp - the view of the document
These files contain your CAnimScriptView class.
CAnimScriptView objects are used to view CAnimScriptDoc objects.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named AnimScript.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC42XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC42DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system.
/////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,59 @@
// StateListView.cpp : implementation file
//
#include "stdafx.h"
#include "AnimScript.h"
#include "StateListView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStateListView
IMPLEMENT_DYNCREATE(CStateListView, CListView)
CStateListView::CStateListView()
{
}
CStateListView::~CStateListView()
{
}
BEGIN_MESSAGE_MAP(CStateListView, CListView)
//{{AFX_MSG_MAP(CStateListView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStateListView drawing
void CStateListView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CStateListView diagnostics
#ifdef _DEBUG
void CStateListView::AssertValid() const
{
CListView::AssertValid();
}
void CStateListView::Dump(CDumpContext& dc) const
{
CListView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CStateListView message handlers
@@ -0,0 +1,53 @@
#if !defined(AFX_STATELISTVIEW_H__7CADECD4_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_STATELISTVIEW_H__7CADECD4_6795_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// StateListView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CStateListView view
class CStateListView : public CListView
{
protected:
CStateListView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CStateListView)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CStateListView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CStateListView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CStateListView)
// 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_STATELISTVIEW_H__7CADECD4_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,205 @@
// StateParamView.cpp : implementation file
//
#include "stdafx.h"
#include "AnimScript.h"
#include "StateParamView.h"
#include "AnimScriptDoc.h"
#include "mw4headers.hpp"
#include "Vehicle.hpp"
#include "MechAnimationState.hpp"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStateParamView
IMPLEMENT_DYNCREATE(CStateParamView, CFormView)
CStateParamView::CStateParamView()
: CFormView(CStateParamView::IDD)
{
//{{AFX_DATA_INIT(CStateParamView)
//}}AFX_DATA_INIT
}
CStateParamView::~CStateParamView()
{
}
void CStateParamView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CStateParamView)
DDX_Control(pDX, IDC_CREATE, m_ctrlCreateButton);
DDX_Control(pDX, IDC_STATEPARAM_TITLE, m_ctrlTitle);
DDX_Control(pDX, IDC_COMBO_ANIMTYPE, m_ctrlAnimType);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CStateParamView, CFormView)
//{{AFX_MSG_MAP(CStateParamView)
ON_BN_CLICKED(IDC_CREATE, OnCreateExec)
ON_WM_CREATE()
ON_CBN_SELENDOK(IDC_COMBO_ANIMTYPE, OnSelendokComboAnimtype)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStateParamView diagnostics
#ifdef _DEBUG
void CStateParamView::AssertValid() const
{
CFormView::AssertValid();
}
void CStateParamView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CStateParamView message handlers
void CStateParamView::OnInitialUpdate()
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CFormView::OnInitialUpdate();
m_ctrlAnimType.EnableWindow(false);
m_ctrlAnimType.ResetContent();
POSITION pos = pDoc->m_listAnimTypes.GetHeadPosition();
while (pos)
{
CObject *pObj = pDoc->m_listAnimTypes.GetNext(pos);
CAnimTypeNode *pNode = (CAnimTypeNode *)pObj;
int index = m_ctrlAnimType.AddString(pNode->m_strName);
m_ctrlAnimType.SetItemData(index,(DWORD)pNode);
}
// Second pass - set the index on data because the items may be sorted when entered
for (int x=0;x<m_ctrlAnimType.GetCount();x++)
{
CAnimTypeNode *pNode = (CAnimTypeNode *)m_ctrlAnimType.GetItemData(x);
pNode->m_iIndex = x;
}
}
void CStateParamView::OnCreateExec()
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc->m_pSelectedNode;
if (pNode)
{
if (pNode->m_bValid)
{
pNode->m_bValid = false;
}
else
{
pNode->m_bValid = true;
CAnimTypeNode *pType = (CAnimTypeNode *)pNode->GetParam(PARAM_ANIMTYPE);
if (NULL == pType)
{
pType = (CAnimTypeNode *)m_ctrlAnimType.GetItemData(0);
assert(NULL != pType);
pNode->SetParam(PARAM_ANIMTYPE,pType);
}
pNode->LoadState(NULL);
}
for (int x=0;x<3;x++)
m_arrPages[x].OnCreateExec();
pDoc->UpdateAllViews(NULL,0,NULL);
}
}
void CStateParamView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CAnimNode *pNode = pDoc->m_pSelectedNode;
CString strTitle = "Parameters";
CString strCreate = "Create";
int iCurSel = -1;
bool bEnable = false;
if (pNode)
{
strTitle = pNode->GetName();
if (pNode->m_bValid)
{
bEnable = true;
strCreate = "Delete";
CAnimTypeNode *pType = (CAnimTypeNode *)pNode->GetParam(PARAM_ANIMTYPE);
iCurSel = (pType)?pType->m_iIndex:-1;
}
}
m_ctrlAnimType.EnableWindow(bEnable);
m_ctrlAnimType.SetCurSel(iCurSel);
m_ctrlTitle.SetWindowText(strTitle);
m_ctrlCreateButton.SetWindowText(strCreate);
for (int x=0;x<3;x++)
m_arrPages[x].OnApply();
}
int CStateParamView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFormView::OnCreate(lpCreateStruct) == -1)
return -1;
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
char szTitle[][30] =
{
"Animation",
"Transition",
"Animation Type Parameters"
};
// Create the Property Sheet
for (int x=0;x<3;x++)
{
m_arrPages[x].m_pDocument = pDoc;
m_arrPages[x].m_iPageType = x;
m_arrPages[x].m_psp.pszTitle = szTitle[x];
m_arrPages[x].m_psp.dwFlags |= PSP_USETITLE;
m_ctrlPropertySheet.AddPage(&m_arrPages[x]);
}
m_ctrlPropertySheet.EnableStackedTabs(false);
m_ctrlPropertySheet.Create(this,WS_VISIBLE | WS_CHILD);
CRect rc;
GetClientRect(&rc);
// TODO: Need to have the property sheet at this location
CWnd *pWnd = this->GetDlgItem(IDC_PROPSHEET_POS);
//CRect rc1;
//pWnd->GetWindowRect(&rc1);
CPoint pt(280,5);
//pWnd->ScreenToClient(&pt);
rc.OffsetRect(pt);
m_ctrlPropertySheet.SetWindowPos(this,rc.left,rc.top,rc.right,rc.bottom,SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOZORDER |SWP_NOACTIVATE);
return 0;
}
void CStateParamView::OnSelendokComboAnimtype()
{
int index = m_ctrlAnimType.GetCurSel();
if (index>=0)
{
CAnimTypeNode *pNode = (CAnimTypeNode *)m_ctrlAnimType.GetItemData(index);
// index should be equal to pNode->m_iIndex
assert(index == pNode->m_iIndex);
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
if (pDoc->m_pSelectedNode)
{
pDoc->m_pSelectedNode->SetParam(PARAM_ANIMTYPE,pNode);
pDoc->m_pSelectedNode->CreateAnimTypeParams(pNode);
pDoc->UpdateAllViews(NULL,1,NULL);
}
}
}
@@ -0,0 +1,77 @@
#if !defined(AFX_STATEPARAMVIEW_H__7CADECD7_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_STATEPARAMVIEW_H__7CADECD7_6795_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// StateParamView.h : header file
//
#include "animnode.h"
#include "pageAnimType.h"
/////////////////////////////////////////////////////////////////////////////
// CStateParamView form view
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class CStateParamView : public CFormView
{
protected:
CStateParamView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CStateParamView)
// Form Data
public:
//{{AFX_DATA(CStateParamView)
enum { IDD = IDD_STATE_PARAM };
CButton m_ctrlCreateButton;
CButton m_ctrlTitle;
CComboBox m_ctrlAnimType;
//}}AFX_DATA
// Attributes
public:
CPropertySheet m_ctrlPropertySheet;
CPageAnimType m_arrPages[3];
// Operations
public:
// CParamPage *GetAnimTypeParamPage(CAnimNode *);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CStateParamView)
public:
virtual void OnInitialUpdate();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CStateParamView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
//{{AFX_MSG(CStateParamView)
afx_msg void OnCreateExec();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSelendokComboAnimtype();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STATEPARAMVIEW_H__7CADECD7_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,237 @@
// StateTreeView.cpp : implementation file
//
#include "stdafx.h"
#include "AnimScript.h"
#include "StateTreeView.h"
#include "AnimScriptDoc.h"
#include "modifyview.h"
#include "stateparamview.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CStateTreeView
IMPLEMENT_DYNCREATE(CStateTreeView, CTreeView)
CStateTreeView::CStateTreeView()
{
}
CStateTreeView::~CStateTreeView()
{
}
BEGIN_MESSAGE_MAP(CStateTreeView, CTreeView)
//{{AFX_MSG_MAP(CStateTreeView)
ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CStateTreeView drawing
void CStateTreeView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CStateTreeView diagnostics
#ifdef _DEBUG
void CStateTreeView::AssertValid() const
{
CTreeView::AssertValid();
}
void CStateTreeView::Dump(CDumpContext& dc) const
{
CTreeView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CStateTreeView message handlers
void CStateTreeView::OnInitialUpdate()
{
CTreeView::OnInitialUpdate();
}
void CStateTreeView::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
CAnimNode *pNode = (CAnimNode *)this->GetTreeCtrl().GetItemData(this->GetTreeCtrl().GetSelectedItem());
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
pDoc->m_pSelectedNode = pNode;
GetDocument()->UpdateAllViews(this,NULL,NULL);
*pResult = 0;
}
BOOL CStateTreeView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= TVS_SHOWSELALWAYS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_FULLROWSELECT | TVS_HASBUTTONS;
return CTreeView::PreCreateWindow(cs);
}
void CStateTreeView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
if (pSender && pSender->IsKindOf(RUNTIME_CLASS(CModifyView)))
return;
if (lHint)
return;
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
CTreeCtrl *pCtrl = &this->GetTreeCtrl();
//Check all of the Animation States
HTREEITEM hItem = pCtrl->GetRootItem();
while (hItem)
{
CAnimStateNode *pAnimNode = (CAnimStateNode *)this->GetTreeCtrl().GetItemData(hItem);
if (pAnimNode->m_bValid)
{
pCtrl->SetItemState(hItem,TVIS_BOLD,TVIS_BOLD);
}
else
{
pCtrl->SetItemState(hItem,0,TVIS_BOLD);
}
hItem = pCtrl->GetNextItem(hItem, TVGN_NEXT);
}
// Check all of the transition states
POSITION pos = pDoc->m_listTransitions.GetHeadPosition();
while (pos)
{
CObject *pObj = pDoc->m_listTransitions.GetNext(pos);
CTransStateNode *pTransNode = (CTransStateNode *)pObj;
bool bAdd = false;
for (int x=0;x<2;x++)
{
CAnimNode *pNode = NULL;
if (0==x)
pNode = pTransNode->m_pStartNode;
else
pNode = pTransNode->m_pEndNode;
if (pNode)
{
// if (pNode->m_bValid)
{
//pTransNode should be a child of hItem
// Look for it, and if it's not there then add it.
bool bFound = false;
HTREEITEM hChild = pCtrl->GetChildItem(pNode->m_hItem);
while (hChild)
{
CTransStateNode *pNode1 = (CTransStateNode *)pCtrl->GetItemData(hChild);
if (pNode1&&pNode1->m_bValid)
pCtrl->SetItemState(hChild,TVIS_BOLD,TVIS_BOLD);
else
pCtrl->SetItemState(hChild,0,TVIS_BOLD);
if (pNode1 == pTransNode)
{
bFound = true;
bool bValidX = pTransNode->m_pStartNode?pTransNode->m_pStartNode->m_bValid:1;
bool bValidY = pTransNode->m_pEndNode?pTransNode->m_pEndNode->m_bValid:1;
if (!(bValidX & bValidY))
{
if (pNode->m_hItem)
{
pCtrl->DeleteItem(hChild);
CRect rc;
pCtrl->GetItemRect(pNode->m_hItem,&rc,false);
pCtrl->InvalidateRect(&rc);
}
}
break;
}
hChild = pCtrl->GetNextItem(hChild,TVGN_NEXT);
}
/*if (bFound)
{
bool bValidX = pTransNode->m_pStartNode?pTransNode->m_pStartNode->m_bValid:1;
bool bValidY = pTransNode->m_pEndNode?pTransNode->m_pEndNode->m_bValid:1;
if (!(bValidX & bValidY))
{
if (pNode->m_hItem)
{
pCtrl->DeleteItem(pTransNode->m_hItem);
CRect rc;
pCtrl->GetItemRect(pNode->m_hItem,&rc,false);
pCtrl->InvalidateRect(&rc);
}
}
}
else*/
if (!bFound)
{
if (pNode->m_bValid)
{
bAdd = true;
bool bValidX = pTransNode->m_pStartNode?pTransNode->m_pStartNode->m_bValid:1;
bool bValidY = pTransNode->m_pEndNode?pTransNode->m_pEndNode->m_bValid:1;
if (bValidX & bValidY)
{
// Add pTransNode to pNode (parent)
hChild = pCtrl->InsertItem(pTransNode->GetName(),pNode->m_hItem);
pTransNode->m_hItem = hChild;
pCtrl->SetItemData(hChild,(DWORD)pTransNode);
// Invalidate the rect so that the "+" and other stuff gets drawn
CRect rc;
pCtrl->GetItemRect(hChild,&rc,false);
pCtrl->InvalidateRect(&rc);
pCtrl->GetItemRect(pNode->m_hItem,&rc,false);
pCtrl->InvalidateRect(&rc);
}
}
}
}
/* else
{
if (pNode->m_hItem)
{
pCtrl->DeleteItem(pTransNode->m_hItem);
CRect rc;
pCtrl->GetItemRect(pNode->m_hItem,&rc,false);
pCtrl->InvalidateRect(&rc);
}
}*/
}
}
}
}
int CStateTreeView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CTreeView::OnCreate(lpCreateStruct) == -1)
return -1;
CTreeCtrl *pCtrl = &this->GetTreeCtrl();
CAnimScriptDoc* pDoc = (CAnimScriptDoc *)GetDocument();
POSITION pos = pDoc->m_listStates.GetHeadPosition();
while (pos)
{
CObject *pObj = pDoc->m_listStates.GetNext(pos);
CAnimStateNode *pNode = (CAnimStateNode *)pObj;
HTREEITEM hItem = pCtrl->InsertItem(pNode->GetName());
pNode->m_hItem = hItem;
pCtrl->SetItemData(hItem,(DWORD)pNode);
}
return 0;
}
@@ -0,0 +1,58 @@
#if !defined(AFX_STATETREEVIEW_H__7CADECD5_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_STATETREEVIEW_H__7CADECD5_6795_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// StateTreeView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CStateTreeView view
class CStateTreeView : public CTreeView
{
protected:
CStateTreeView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CStateTreeView)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CStateTreeView)
public:
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CStateTreeView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CStateTreeView)
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STATETREEVIEW_H__7CADECD5_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// AnimScript.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
+106
View File
@@ -0,0 +1,106 @@
// 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__7CADECC6_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
#define AFX_STDAFX_H__7CADECC6_6795_11D3_9C1B_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define __exdisp_h__
// jcem
#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
#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
#include <afxcview.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#include <afxole.h>
#include <afxmt.h>
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <MW4\MW4.hpp>
#include <windows.h>
#include <MW4DedicatedUI\DedicatedUI.hpp>
#include <GameOS\GameOS.hpp>
#include <GameOS\Platform.hpp>
#include <GameOs\Network.hpp>
#include <gosFX\gosFX.hpp>
#include <gosFX\EffectLibrary.hpp>
#include <Adept\Application.hpp>
#include <MW4\MWApplication.hpp>
#include <gosScript\gosScriptHeaders.hpp>
#include <Adept\ResourceImagePool.hpp>
#include <MW4\MWMission.hpp>
#include <MW4\MWPlayer.hpp>
#include <Compost\Compost.hpp>
#include <mw4\gameinfo.hpp>
#include <Adept\ResourceEffectLibrary.hpp>
#include <mw4\ai_statistics.hpp>
#include "mw4\mw4shell.hpp"
#include "mw4\hudcomp.hpp"
#include <Adept\GlobalPointerManager.hpp>
#include <MW4\MWTool.hpp>
#include <Stuff\Random.hpp>
#include <MLR\MLR.hpp>
#include <MLR\MLRTexturePool.hpp>
#include <MLR\MLRTexture.hpp>
#include <adept\gamespy\gamespy.h>
#include <GameOS\GUNGameList.h>
#include <process.h>
// Insert your headers here
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <limits.h>
#include <malloc.h>
#include <math.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#include <crtdbg.h>
#include <stdio.h>
#include <ctype.h>
#include <signal.h>
#include <errno.h>
#include <limits.h>
#include <fcntl.h>
#include <assert.h>
#if !defined(_T)
#define _T(x) x
#endif // !defined(_T)
#include "nonmfc.h"
#include "mugpdefs.h"
#include "ctime.h"
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__7CADECC6_6795_11D3_9C1B_00609712FBEF__INCLUDED_)
@@ -0,0 +1,163 @@
#if !defined(__STDDEFS__)
#define __STDDEFS__
#ifdef RC_INVOKED
#else // RC_INVOKED
#ifdef WIN32
#pragma warning (disable:4200)
#endif // WIN32
#if 0 // def _DEBUG
inline void HEAPCHK()
{
PVOID pa[10];
int i;
for(i = 0; i < 10; i++) {
pa[i] = malloc(rand() % 32000 + 767);
ASSERT(_heapchk() == _HEAPOK);
}
_HEAPINFO hh;
int nRet;
hh._pentry = NULL;
while((nRet = _heapwalk(&hh)) == _HEAPOK)
;
if (nRet != _HEAPEND) {
ASSERT(FALSE);
}
for(i = 0; i < 10; i++) {
free(pa[i]);
ASSERT(_heapchk() == _HEAPOK);
}
}
#else
#define HEAPCHK()
#endif
#ifdef WIN32
#pragma pack(push, 1)
#endif // WIN32
union WORDPACK {
struct {
BYTE m_bLow;
BYTE m_bHigh;
} m_W;
WORD m_wValue;
};
typedef WORDPACK* PWORDPACK;
union DWORDPACK {
struct {
WORDPACK m_wLow;
WORDPACK m_wHigh;
} m_DW;
DWORD m_dwValue;
};
typedef DWORDPACK* PDWORDPACK;
#ifdef WIN32
#pragma pack(pop)
#endif // WIN32
#define GETLBYTE(W) (((PWORDPACK)&(W))->m_W.m_bLow)
#define GETHBYTE(W) (((PWORDPACK)&(W))->m_W.m_bHigh)
#define GETLWORD(D) (((PDWORDPACK)&(D))->m_DW.m_wLow.m_wValue)
#define GETHWORD(D) (((PDWORDPACK)&(D))->m_DW.m_wHigh.m_wValue)
#define WORDHI(lvalue) (*((LPWORD)&(lvalue) + 1))
#define BYTEHI(lvalue) (*((LPBYTE)&(lvalue) + 1))
#define MAKE_VERSION(rmj, rmm, rup) (((DWORD)rmj) << 16) | (((DWORD)rmm) << 8) | (((DWORD)rup) << 0)
#define NOFA(name_of_array) (sizeof(name_of_array)/sizeof(name_of_array[0]))
#define ChkFlag(flag,mask) ((flag) & (mask))
#define SetFlag(flag,mask) ((flag) |= (mask))
#define XorFlag(flag,mask) ((flag) ^= (mask))
#define ClrFlag(flag,mask) ((flag) &= ~(mask))
#ifdef _DEBUG
#define DEBUGONLY(expr) (expr)
#else
#define DEBUGONLY(expr)
#endif
typedef signed long SINT; // logical unit, signed 32bit
typedef short SINT16;
typedef unsigned short UINT16;
typedef int SINT32;
#if _MSC_VER <= 1100
typedef unsigned int UINT32;
#endif // _MSC_VER <== 1100(developers studio 5.0)
#ifdef WIN32
typedef __int64 SINT64;
typedef unsigned __int64 UINT64;
#else // WIN32
typedef long long SINT64;
typedef unsigned long long UINT64;
#endif // WIN32
typedef float FLOAT;
typedef double DOUBLE;
typedef unsigned char U8;
typedef signed char S8;
typedef unsigned short U16;
typedef signed short S16;
typedef unsigned int U32;
typedef signed int S32;
#define SIZE_SINT 4
#define SIZE_SINT16 2
#define SIZE_UINT16 2
#define SIZE_SINT32 4
#define SIZE_UINT32 4
#define SIZE_SINT64 8
#define SIZE_UINT64 8
#define SIZE_FLOAT 4
#define SIZE_DOUBLE 8
typedef SINT* PSINT;
typedef PSINT* PPSINT;
typedef SINT16* PSINT16;
typedef PSINT16* PPSINT16;
typedef UINT16* PUINT16;
typedef PUINT16* PPUINT16;
typedef SINT32* PSINT32;
typedef PSINT32* PPSINT32;
typedef UINT32* PUINT32;
typedef PUINT32* PPUINT32;
typedef SINT64* PSINT64;
typedef PSINT64* PPSINT64;
typedef UINT64* PUINT64;
typedef PUINT64* PPUINT64;
typedef FLOAT* PFLOAT;
typedef PFLOAT* PPFLOAT;
typedef DOUBLE* PDOUBLE;
typedef PDOUBLE* PPDOUBLE;
#if !(defined(BOOL) || defined(TRUE) || defined(FALSE))
#define BOOL int
#define TRUE 1
#define FALSE 0
#endif
#if 1 // def WIN32
#define DECLARE_VOIDHANDLE(name) struct __##name##__ { int unused; }; typedef const struct __##name##__* name
#define DECLARE_CLASS(name) __DECLARE_CLASS(C,name)
#define DECLARE_CLASS_PTR(name) __DECLARE_CLASS_PTR(C,name)
#define __DECLARE_CLASS(prefix,name) class prefix##name; typedef class prefix##name* P##name; typedef const class prefix##name* PC##name
#define __DECLARE_CLASS_PTR(prefix,name) __DECLARE_CLASS(prefix, name); typedef P##name* PP##name; typedef PC##name* PPC##name
#define DECLARE_STRUCT(name) __DECLARE_STRUCT(S,name)
#define DECLARE_STRUCT_PTR(name) __DECLARE_STRUCT_PTR(S,name)
#define __DECLARE_STRUCT(prefix,name) struct prefix##name; typedef struct prefix##name* P##name; typedef const struct prefix##name* PC##name;
#define __DECLARE_STRUCT_PTR(prefix,name) __DECLARE_STRUCT(prefix,name); typedef P##name* PP##name; typedef PC##name* PPC##name
#endif // WIN32
#define DLLDAT // will be redefined, if necessary in dllapi.h
#define DLLAPI // will be redefined, if necessary in dllapi.h
#define DLLCLS // will be redefined, if necessary in dllapi.h
#endif // RC_INVOKED
#endif // __STDDEFS__
File diff suppressed because it is too large Load Diff
+174
View File
@@ -0,0 +1,174 @@
#if !defined(__CTCL_H__)
#define __CTCL_H__
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the CTCL_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// CTCL_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#define CTCL_API _stdcall
#if !defined(BOOL)
#define BOOL int
#if !defined(TRUE)
#define TRUE 1
#define FALSE 0
#endif // !defined(TRUE)
#endif // !defined(BOOL)
#pragma pack(push, 1)
#if !defined(CTCLS_EXPORTS)
class CInviteCOOP
{
public:
void* m_pParent;
int m_nTimeInvite;
int m_nResult; // 0: not inited, 1: requesting, 2: no, 3: yes...
int m_nResultAccepted;
GUID m_guidGameData;
public:
CInviteCOOP();
void Clear();
};
#endif // !defined(CTCLS_EXPORTS)
struct STeslaInfo
{
public:
BOOL m_bCameraShip;
unsigned long m_ulAddr;
const char* m_pcsz;
int m_nLauncherConnection; // 0: no connection, +1: connection, -1: connecting
int m_nConnection2; // m_bCameraShip값에 따라 게임 혹은 카메라 쉽과의 접속을 의미, 0: no connection, +1: connection, -1: connecting
int m_nApplType;
int m_nApplState;
int m_nGameState;
int m_nGameTime;
int m_nGameIsServer;
public:
};
#define MAX_PLYR_NAME 20
struct SPlayerInfo
{
public:
BYTE m_bBot;
BYTE m_bTeam;
int m_nLevelOrTesla;
char m_szName[MAX_PLYR_NAME];
UINT m_uPlayerID;
int m_nMechIndex;
short m_fileID;
WORD m_recordID;
char m_szMech[64];
int m_nTeamOrSkin;
int m_nDecal;
DWORD m_dwAddr;
};
#pragma pack(pop)
#define C_GameInfo 1 // Console 2 Launcher
#define S_GameInfo 1 // Launcher 2 Console
#define C_OrderAppl 10 // Console 2 Launcher
#define C_ErrorStartGame 19 // to server & client - error occurred, to mainmenu
#define C_ReadyStartGame 20 // to server - Game Server Start w/ HostSetup & Mission Params...
#define C_BOTS 21 // to server - Bot Infos
#define C_SetMechs 22 // to server & client -
#define C_GetReady 23 // to server & client -
#define C_DoLaunch 24 // to server
#define S_GameReturn 30 // game to console
#define C_SendFile 40
#define S_SendFile 40
#define C_InviteCOOP 50 // to server & client - invite clients
#define S_InviteCOOP 50 // to server & client - reply to server for invitation
class CTeslaInfo;
typedef CTeslaInfo* TESLA_HANDLE;
BOOL CTCL_API CTCL_Start(int nCTCLType);
void CTCL_API CTCL_Stop();
void CTCL_API CTCL_Run();
// Used by All
int CTCL_API CTCL_API CTCL_GetType();
BOOL CTCL_API CTCL_IsNone(); // no -ctcltype...
BOOL CTCL_API CTCL_IsConsole(); // Console Only
bool CTCL_API CTCL_IsCOOP(); // is COOP?
BOOL CTCL_API CTCL_IsConsoleOrCOOP(); // Console or COOP(COin OPerational)
BOOL CTCL_API CTCL_IsConsoleX(); // Game & Cameraship
// Used by Console(+ COOP)
int CTCL_API CTCL_GetTeslaCountAll();
int CTCL_API CTCL_GetTeslaCount();
TESLA_HANDLE CTCL_API CTCL_GetTeslaInfo(int nIndex, STeslaInfo& TI);
int CTCL_API CTCL_InviteCOOP(int nTimeInvite, int& nYes, int& nNo, int& nProcessings);
const char* CTCL_API CTCL_GetTeslaName(int nIndex);
int CTCL_API CTCL_OrderAppl(int nIndex, int nOrder, int nParam);
// Used by Launcher
// Used by Game
// Used by CameraShip
void CTCL_API CTCL_DoTerminateAppl();
void CTCL_API CTCL_DoEndMission();
void CTCL_API CTCL_DoMainShell();
void CTCL_API CTCL_DoCreateGame();
void CTCL_API CTCL_DoJoinGame();
void CTCL_API CTCL_StartGame(BOOL bRealLaunch);
void CTCL_API CTCL_InitMechDatas();
void CTCL_API CTCL_CheckJoinGame();
void CTCL_API CTCL_CheckNetConnectedToServer();
void CTCL_API CTCL_SetMissionParams();
void CTCL_API CTCL_CheckMissionParams();
void CTCL_API CTCL_SetMechs();
void CTCL_API CTCL_CheckClientReady();
void CTCL_API CTCL_CheckServerReady();
void CTCL_API CTCL_DefaultHostSetup(int nMode);
// from here - Mech4 only
void CTCL_API CTCL_DoSendGameReturn(int nValue);
void CTCL_API CTCL_SaveNMP(const void* p, int nSize);
void* CTCL_API CTCL_LoadNMP(int& nSize);
void CTCL_API CTCL_SendFile(const SYSTEMTIME& SysTime, const GUID& guid, int nType);
bool CTCL_API CTCL_DoReprintOrCheck(bool bRealPrint);
void CTCL_API CTCL_SetGameStateAsIdle();
// to here - Mech4 only
extern "C" {
extern int g_nCTCLType;
extern int g_nCTCL_DoLaunchGame;
#if !defined(CTCLS_EXPORTS)
extern CInviteCOOP g_InviteCOOP;
// console only...
// Mech4 only
extern int g_nMech4Comm;
// server & client only
extern BOOL g_bIsServer;
// console(All), server & client only(g_aPlayerInfos[0]), server only(g_aPlayerInfos[1..g_nBOTs]
extern SPlayerInfo g_aPlayerInfos[20];
extern int g_nPlayerInfos;
extern int g_nServer;
extern int g_nTeslas;
extern int g_nPrintOut;
extern int g_nMissionReview;
extern SYSTEMTIME g_SysTime;
extern GUID g_guidGameDatas;
// Tesla Server & Clients only
extern char g_szGameName[128];
extern int g_nBOTs;
extern DWORD g_dwJoinStartTicks;
#endif // !defined(CTCLS_EXPORTS)
extern const char PROF_INI[];
extern const char SECT_TESLAS[];
extern const char SECT_GAMES[];
extern const char SECT_CONFIG[];
} // end of extern "C"
#endif // !defined(__CTCL_H__)
@@ -0,0 +1,49 @@
#define _EAT_None 0
#define _EAT_MW4 1
#define _EAT_RP 2
#define _EAT_MAX 2 // max appl count...
#define _EAS_None 0
#define _EAS_PreLaunch 1
#define _EAS_Launched 2
#define _EAS_PostLaunch 3
#define _EGS_None 0
#define _EGS_Idle 1
#define _EGS_Preparing 2
#define _EGS_Running 3
#define _EGS_Closing 4
#define _EGR_NotConnected (-2)
#define _EGR_Connected (-1)
#define _EGR_NoError 0
#define _EGR_PreparingStarted 1
#define _EGR_ErrCreateSession 2
#define _EGR_OkCreateSession 3
#define _EGR_OkLaunchReady 4
#define _EGR_ErrJoinSession 5
#define _EGR_OkJoinSession 6
// CTCL_GetType return value
#define _ECTCL_Launcher 0
#define _ECTCL_Console 1 // CTCL_IsConsole()
#define _ECTCL_Game 2
#define _ECTCL_CameraShip 3
#define _ECTCL_None 4
// CTCL_Get/Set Param...
#define _CTCL_GetTeslaCountAll 100
#define _CTCL_GetTeslaCount 101
#define _CTCL_GetTeslaInfo 102
#define _CTCL_GetTeslaName 103
#define _CTCL_OrderAppl 104 // param: 0 - terminate, 1 - launch, 2 - end mission
#define _CTCL_Order_Terminate 0
#define _CTCL_Order_EndMission 1
#define _CTCL_Order_Launch 100
#define _CTCL_Order_Shutdown 101
#define _CTCL_Order_Reboot 102
#define _CTCL_Order_Unload 103
#define _CTCL_GetInviteCOOP 105
#define _CTCL_SetInviteCOOP 106
@@ -0,0 +1,26 @@
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the CTCLS_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// CTCLS_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef CTCLS_EXPORTS
#define CTCLS_API __declspec(dllexport)
#else
#define CTCLS_API __declspec(dllimport)
#endif
#include "ctcl_params.h"
CTCLS_API DWORD CTCL_GetVersion();
CTCLS_API int CTCL_GetApplType();
CTCLS_API void CTCL_SetApplType(int nApplType);
CTCLS_API int CTCL_GetApplState();
CTCLS_API void CTCL_SetApplState(int nApplState);
CTCLS_API int CTCL_GetGameState();
CTCLS_API void CTCL_SetGameState(int nGameState);
CTCLS_API int CTCL_GetGameTime();
CTCLS_API void CTCL_SetGameTime(int nGameTime);
CTCLS_API int CTCL_GetGameIsServer();
CTCLS_API void CTCL_SetGameIsServer(int nGameIsServer);
@@ -0,0 +1,191 @@
#include "stdafx.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/*
BOOL IsLeapYear(int nYear)
{
// nYear is in Solar system, 1982...
if (nYear % 4 == 0) {
if (nYear % 100 == 0) {
if (nYear % 400 == 0) {
//...
return FALSE;
}
}
return TRUE;
}
return FALSE;
}
int GetDayEnd(int nYear, int nMonth)
{
int nDayEnd;
if (nMonth == 2) {
nDayEnd = 28;
if (IsLeapYear(nYear)) {
nDayEnd++;
} else {
// 28
}
} else {
nDayEnd = 30;
if ((nMonth == 1) || (nMonth == 3) || (nMonth == 5) || (nMonth == 7) || (nMonth == 8) || (nMonth == 10) || (nMonth == 12))
nDayEnd++; // 31
}
return nDayEnd;
}
long GetTotalSeconds(int nYear, int nMonth, int nDay)
{
// nYear, nMonth, nDay날의 0시 0분 0초를 0으로 한 초단위 수...
ASSERT(nYear >= 1970);
ASSERT((1 <= nMonth) && (nMonth <= 12));
ASSERT(1 <= nDay);
ASSERT(nDay <= GetDayEnd(nYear, nMonth));
long lTotal = 0;
int nStart;
for(nStart = 1970; nStart < nYear; nStart++) {
int nDays = 365;
if (IsLeapYear(nStart)) {
nDays++;
}
lTotal += nDays * 24 * 60 * 60; // 24시간 60분 60초
}
for(nStart = 1; nStart < nMonth; nStart++) {
int nDayEnd = GetDayEnd(nYear, nStart);
lTotal += nDayEnd * 24 * 60 * 60; // 24시간 60분 60초
}
lTotal += (nDay - 1) * 24 * 60 * 60; // 24시간 60분 60초
return lTotal;
}
*/
BOOL CTimeDate::IsLeapYear(int nYear)
{
// nYear is in Solar system, 1982...
if (nYear % 4 == 0) {
if (nYear % 100 == 0) {
if (nYear % 400 == 0) {
//...
return FALSE;
}
}
return TRUE;
}
return FALSE;
}
long CTimeDate::GetCurrent()
{
CTimeDate t;
t.CurrentDate();
return t.m_lDate;
}
void CTimeDate::CurrentDate()
{
ASSERT(this);
time_t t;
struct tm* p;
time(&t);
p = localtime(&t);
m_lDate = 0;
m_LN.m_xDay = p->tm_mday - 1;
m_LN.m_xMonth = p->tm_mon;
m_LN.m_xYear = (p->tm_year + 1900) - TIMEDATE_YEAR_BASE;
//m_LN.m_xReserved = 0;
//m_LN.m_xLunar = 0;
//m_LN.m_xLeap = 0;
}
BOOL CTimeDate::GetDate(long lDate, BOOL bLunar/* = FALSE*/, BOOL bLeap/* = FALSE*/)
{
ASSERT(!bLunar && !bLeap); // not yet implemented...
int nDay = lDate % 100;
lDate /= 100;
int nMonth = lDate % 100;
lDate /= 100;
int nYear = lDate;
BOOL bLeapYear = IsLeapYear(nYear);
nYear -= TIMEDATE_YEAR_BASE;
if ((nYear < 0) || (nYear >= (1 << TIMEDATE_YEAR_BITS)))
return FALSE;
if (!((1 <= nMonth) && (nMonth <= 12))) {
return FALSE;
}
int nDayMax = 30;
switch(nMonth) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
nDayMax++; // 31
break;
case 2:
nDayMax--; // 29
if (!bLeapYear) {
nDayMax--; // 28
}
break;
default:
break;
}
if (!((1 <= nDay) && (nDay <= nDayMax))) {
return FALSE;
}
nMonth--;
nDay--;
m_lDate = 0;
m_LN.m_xYear = nYear;
m_LN.m_xMonth = nMonth;
m_LN.m_xDay = nDay;
//m_LN.m_xReserved = 0;
//m_LN.m_xLunar = 0;
//m_LN.m_xLeap = 0;
return TRUE;
}
long CTimeLong::GetCurrent()
{
CTimeLong t;
t.CurrentTime();
return t.m_lTime;
}
void CTimeLong::CurrentTime()
{
ASSERT(this);
time_t t;
time(&t);
m_lTime = t;
}
void CTimeLong::GetTime(tm& t) const
{
ASSERT(this);
t = *localtime(&m_lTime);
}
@@ -0,0 +1,55 @@
#if !defined(__CTIME__)
#define __CTIME__
#if !defined(TIMEDATE_YEAR_BASE)
#define TIMEDATE_YEAR_BASE 1900
#endif // !defined(TIMEDATE_YEAR_BASE)
#if !defined(TIMEDATE_YEAR_BITS)
#define TIMEDATE_YEAR_BITS 8
#endif // !defined(TIMEDATE_YEAR_BITS)
#define TIMEDATE_RESERVED_BITS (32 - (5 + 4 + TIMEDATE_YEAR_BITS + 1 + 1)) // 13?
class CTimeDate
{
public:
union {
struct {
// Bit Field는 앞쪽에 지정된 것이 LowBit이다.
DWORD m_xDay: 5; // 2^0, 2^5-1
DWORD m_xMonth: 4; // 2^5, 2^4-1
DWORD m_xYear: TIMEDATE_YEAR_BITS; // from 1900-2155 // 2^9, 2^8-1
DWORD m_xReserved: TIMEDATE_RESERVED_BITS; // 2^17,2^13-1
DWORD m_xLunar: 1; // lunar system not solar system // 2^30, 2^1-1
DWORD m_xLeap: 1; // leap month? in case of lunar system // 2^31, 2^1-1
} m_LN;
long m_lDate;
};
public:
CTimeDate() { m_lDate = 0; } // TIMEDATE_YEAR_BASE/1/1 in solar
CTimeDate(const CTimeDate& that) { m_lDate = that.m_lDate; }
operator long& () { return *(long*)&m_lDate; }
static BOOL IsLeapYear(int nYear);
static long GetCurrent();
int const GetYear() const { return m_LN.m_xYear + TIMEDATE_YEAR_BASE; }
int const GetMonth() const { return m_LN.m_xMonth; }
int const GetDay() const { return m_LN.m_xDay; }
void CurrentDate();
BOOL GetDate(long lDate, BOOL bLunar = FALSE, BOOL bLeap = FALSE);
};
class CTimeLong
{
public:
long m_lTime; // time_t
public:
CTimeLong() { m_lTime = 0; }
CTimeLong(const CTimeLong& that) { m_lTime = that.m_lTime; }
operator long& () { return *(long*)&m_lTime; }
static long GetCurrent();
void CurrentTime();
void GetTime(tm& t) const;
};
#endif //!defined(__CTIME__)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,80 @@
#ifdef WIN32
#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
#pragma warning(disable:4201)
#endif // WIN32
#ifdef IRIX
#define _BSD_SIGNALS
#include <fcntl.h>
/* #include <stropts.h> */
#endif
#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#ifdef WIN32
//#include <winsock.h>
#include <winsock2.h>
#else
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/signal.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#endif
#ifdef CHECK_ASSERT_VALID
#define CHECK_ASSERT_VALID(expr) (expr)
#endif // CHECK_ASSERT_VALID
#ifndef TRACE
#define TRACE(x)
#endif // TRACE
#ifndef ASSERT
#define ASSERT(x)
#endif // ASSERT
#include "stddefs.h"
#include "array.inl"
#include "dblinks.inl"
#include "qsort.inl"
#include "bsearch.inl"
#include "dqfixed.inl"
DECLARE_CLASS(TEXTFmt);
DECLARE_CLASS(DAPacket);
DECLARE_CLASS(TimerEvent);
DECLARE_CLASS(TimerPool);
DECLARE_CLASS(PacketDumper);
DECLARE_CLASS(PacketDump);
DECLARE_CLASS(Packet);
DECLARE_CLASS(PacketAuto);
DECLARE_CLASS(Broadcast);
DECLARE_CLASS(SockAddr);
DECLARE_CLASS(FileTransfer);
DECLARE_CLASS(FTPArray);
DECLARE_CLASS(SOC);
DECLARE_CLASS(SOCListen);
DECLARE_CLASS(SOCConnect);
DECLARE_CLASS(SOCClient);
DECLARE_CLASS(SOCServer);
DECLARE_CLASS(FDSet);
DECLARE_CLASS(Droppings);
DECLARE_CLASS(SOCManager);
DECLARE_CLASS(SOCSystem);
#include "cstr.h"
#include "mugsocs.h"
#ifdef WIN32
#pragma warning(default:4201)
#endif // WIN32
File diff suppressed because it is too large Load Diff
+108
View File
@@ -0,0 +1,108 @@
#ifdef _DEBUG
#define AssertDebugBreak() _asm { int 3 }
inline BOOL AssertDialog(const char* pcszExpr, const char* pcszfile, int nLine)
{
char szBuf[MAX_PATH * 2];
sprintf(szBuf, "\"%s\" 파일의 %d줄에서 ASSERT!!!\n\n디버깅을 하시겠습니까?", pcszfile, nLine);
#ifdef WIN32
return ::MessageBox(NULL, szBuf, pcszExpr, MB_YESNO) == IDYES;
#else // !WIN32
return FALSE;
#endif // WIN32
}
inline BOOL __cdecl AssertReturnFALSE()
{
return FALSE;
}
#ifndef ASSERT
#define ASSERT(x) { if (!(x)) AssertDialog(#x, THIS_FILE, __LINE__); }
#endif
#define ASSERT_FALSE() ASSERT(AssertReturnFALSE())
#ifndef VERIFY
#define VERIFY(x) { if (!(x)) AssertDialog(#x, THIS_FILE, __LINE__); }
#endif
#ifndef TRACE
inline int __DbgTrace(const char* pcszFormat, ...)
{
va_list ap;
va_start(ap, pcszFormat);
char caBuffer[1024];
vsprintf(caBuffer, pcszFormat, ap);
va_end(ap);
::OutputDebugString(caBuffer);
return 0;
}
#define TRACE __DbgTrace
#endif
#ifndef THIS_FILE
#define THIS_FILE __FILE__
#endif // !THIS_FILE
#ifndef BASED_CODE
#define BASED_CODE
#endif // !BASED_CODE
#ifdef malloc
#undef malloc
#undef calloc
#undef realloc
#undef _expand
#undef free
#undef _msize
#endif
#define malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define calloc(c, s) _calloc_dbg(c, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define realloc(p, s) _realloc_dbg(p, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define _expand(p, s) _expand_dbg(p, s, _NORMAL_BLOCK, THIS_FILE, __LINE__)
#define free(p) _free_dbg(p, _NORMAL_BLOCK)
#define _msize(p) _msize_dbg(p, _NORMAL_BLOCK)
//----------------------------------------------------------------------------------------------------------
inline void* __cdecl operator new(size_t nSize, LPCSTR lpszFileName, int nLine)
{
void* p = _malloc_dbg(nSize, _NORMAL_BLOCK, lpszFileName, nLine);
return p;
}
inline void __cdecl operator delete(void* p, LPCSTR lpszFileName, int nLine)
{
_free_dbg(p, _NORMAL_BLOCK);
}
//----------------------------------------------------------------------------------------------------------
#ifndef _AFX
#define DEBUG_NEW new //(THIS_FILE, __LINE__)
#define DEBUG_DELETE delete //(THIS_FILE, __LINE__)
#endif
#else // !_DEBUG
#define ASSERTDLG_PUSH(hWnd)
#define ASSERTDLG_POP()
#ifndef ASSERT
#define ASSERT(x)
#endif
#define ASSERT_FALSE()
#ifndef VERIFY
#define VERIFY(x) x
#endif
#ifndef TRACE
inline int __DbgTraceIgnore(const char* pcszFormat, ...) { &pcszFormat; return 0; }
#define TRACE 1 ? 0: __DbgTraceIgnore
#endif
#endif // _DEBUG
@@ -0,0 +1,194 @@
#if !defined(__RECSCORE_H__)
#define __RECSCORE_H__
#define MAX_SCORE_PACK 100
#define MAX_SCORE_PACK_PER_FRAME 2000
struct SRecScore;
class CRecScorePack;
class CRecScoreObject;
class CRecScoreFull;
extern const char* g_pcszGameDataSavePath;
extern const char* g_pcszGameDataExtPR;
void GetFileName4GUID(char szBuf[256], const char* pcszPath, const char* pcszExt, const GUID& guid = *(const GUID*)NULL);
#define MW4PRINT_COPYDATA_META 0xf4f72a54
#pragma pack(push, 1)
class MW4PRINT_COPYDATASTRUCT : public COPYDATASTRUCT
{
public:
GUID m_GUID;
char m_szFile[256];
};
#pragma pack(pop)
#pragma pack(push, 4)
union PART_WHERE
{
public:
int m_nWhere;
struct {
int m_xWhere: 8;
int m_xMasks: 24;
};
public:
void SetWhere(int nWhere);
void SetMask(int nWhere);
};
struct SRecScore
{
public:
int m_nType; // CBucketManager::Bucket_Type
ReplicatorID m_who;
ReplicatorID m_whom;
int m_nBy;
PART_WHERE m_Where;
union {
DWORD m_dwParam;
int m_nParam;
void* m_pParam;
float m_fTime;
};
};
class CRecScorePack
{
public:
CRecScorePack* m_pPrev;
CRecScorePack* m_pNext;
int m_nCount;
SRecScore m_a[MAX_SCORE_PACK];
public:
CRecScorePack();
~CRecScorePack();
int GetMemSize() const;
void Save(DynamicMemoryStream& mf);
void Load(MemoryStream& mf);
};
class CRecScoreFull;
class CRecScoreObject
{
public:
CRecScoreFull* m_pRSF;
CRecScoreObject* m_pPrev;
CRecScoreObject* m_pNext;
bool m_bRemoved;
// player info
bool m_bBOT;
ReplicatorID m_who;
MString m_strName;
MString m_strMech;
// Mech Info...
int m_nPilotTeam;
int m_nTeamDecal;
int m_nPilotDecal;
// Score...
int m_nScore;
int m_nKills;
int m_nDeaths;
public:
CRecScoreObject(CRecScoreFull* pRSF);
#if !defined(MW4PRINT)
CRecScoreObject(CRecScoreFull* pRSF, const Mech* pMech, const char* pcszName, const char* pcszMech, int nPilotTeam, int nTeamDecal, int nPilotDecal);
#endif // !defined(MW4PRINT)
~CRecScoreObject();
const char* GetName() const;
const char* GetMech() const;
bool CheckRemove();
int GetMemSize() const;
void Save(DynamicMemoryStream& mf, DWORD dwMeta);
void Load(MemoryStream& mf, DWORD dwMeta);
};
typedef CRecScoreObject* PRecScoreObject;
typedef const CRecScoreObject* PCRecScoreObject;
class CRecScoreFull
{
public:
int m_nState;
SYSTEMTIME m_SysTime;
int m_nMissionParamSize;
BYTE* m_pMissionParam;
bool m_bTeamGame;
CRecScoreObject* m_pScoreObjects;
int m_nCount;
float m_fFrameTime;
int m_naTeamScores[8];
CRecScorePack* m_pScorePackStart;
struct SPVP_Rec
{
public:
ReplicatorID m_Inf;
ReplicatorID m_Rcv;
int m_nKills;
int m_nScore;
};
int m_nPVPs;
SPVP_Rec* m_pPVPs;
public:
static int s_nLang;
public:
CRecScoreFull();
~CRecScoreFull();
static void CheckLanguage();
#if !defined(MW4PRINT)
static MWApplication* Check();
#endif // !defined(MW4PRINT)
bool IsValidData() const;
void Reset();
void Loading();
void Loaded();
void Starting();
void Started();
void StartFrame();
void StopFrame();
void ReduceFrame();
void Stopping();
void Stopped();
int GetTotalRECs() const;
int CalcKillsAndDeaths(ReplicatorID who, ReplicatorID whom) const;
int CalcKillsAndDeathsForTeam(int nTeam, ReplicatorID id, bool bKill) const;
int GetTeamScore(int nTeam) const;
int RelativeGetScore4Player(const ReplicatorID& me, const ReplicatorID& whom, int& nKills, int& nDeaths) const; // jcem
void Snap();
CRecScoreObject& FindReplicatorID(ReplicatorID who) const;
#if !defined(MW4PRINT)
void AddScoreObject(Mech* pMech, const char* pcszName, int nPilotTeam, int nTeamDecal, int nPilotDecal);
void RemoveScoreObject(Mech* pMech);
#endif // !defined(MW4PRINT)
SRecScore* AddRecScore();
void RecScore(int nType, ReplicatorID who, ReplicatorID whom = ReplicatorID::Null, int nBy = 0, int nWhere = 0, DWORD dwParam = 0);
#ifdef _DEBUG
void AddString(const SRecScore& RS) const;
#endif // _DEBUG
int AddString(MString& str, const SRecScore& RS, const CRecScoreObject& For) const;
MString* MakeInfoTable(PCRecScoreObject aRSOs[], int nPlayers, const int naTeams[8], int nTeamCount) const;
int DoPrint() const;
bool CheckTableFont(HDC hDC, const RECT& rcDraw, const POINT& DPI, const MString* pInfoTable, int nPlayers, int nTeamCount, int naColWidths[], int& nCellTextHeight) const;
void DrawTable(HDC hDC, const MString* pInfoTable, const int naX[], const int naY[], const int nTableCols, const int nTableRows, const int nInvCol, const int nInvRow) const;
void DoPrint(HDC hDC, const RECT& rcDraw, const POINT& DPI, int nCurPlayer, const MString* pInfoTable, const int naColWidths[], int nCellTextHeight, int nRow, PCRecScoreObject aRSOs[], int nPlayers, const int naTeams[8], int nTeamCount, int nTotals, const void* pParams) const;
int GetMemSize() const;
bool SavePR(const char* pcszFile);
bool LoadPR(const char* pcszFile);
void LoadPrintParams() const;
void LoadPrintParam(const char* pcszINI, const char* pcszKey, long& lValue, int nDef, int nMin, int nMax) const;
void LoadPrintParam(const char* pcszINI, const char* pcszKey, int& nValue, int nDef, int nMin, int nMax) const;
};
#pragma pack(pop)
extern CRecScoreFull g_RSF;
#endif // !defined(__RECSCORE_H__)
Binary file not shown.
@@ -0,0 +1,13 @@
//
// ANIMSCRIPT.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.
@@ -0,0 +1,51 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by AnimScript.rc
//
#define IDD_ABOUTBOX 100
#define IDR_MAINFRAME 128
#define IDR_ANIMSCTYPE 129
#define IDD_STATE_PARAM 130
#define IDD_PARAM_ANIMTYPE 144
#define IDD_MODIFY_CURVE 145
#define IDD_MODIFY_FLOAT 146
#define IDD_MODIFY_PATH 147
#define IDD_MODIFY_ATTRIB 148
#define IDD_MODIFY_PARAM 149
#define IDC_COMBO_ANIMTYPE 1000
#define IDC_CREATE 1001
#define IDC_STATEPARAM_TITLE 1002
#define IDC_PROPSHEET_POS 1007
#define IDC_LIST_PARAM 1018
#define IDC_MODIFY 1019
#define IDC_COMBO_CURVETYPE 1020
#define IDC_CHECK_INVERTTIME 1021
#define IDC_CHECK_INVERTSCALE 1022
#define IDC_EDIT_MIN 1023
#define IDC_EDIT_MAX 1024
#define IDC_EDIT_START 1025
#define IDC_EDIT_END 1026
#define IDC_EDIT_VALUE 1027
#define IDC_EDIT_PATH 1028
#define IDC_BROWSE 1029
#define IDC_LIST_ATTRIB 1030
#define IDC_SLIDER_START 1031
#define IDC_SLIDER_START2 1032
#define IDC_SLIDER_START3 1033
#define IDC_SLIDER_START4 1034
#define IDC_SLIDER_PLAYOLDTILL 1046
#define IDC_SLIDER_STARTNEW 1047
#define IDC_SLIDER_TRANSSTART 1048
#define IDC_SLIDER_OVERRIDE 1049
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 150
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1050
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif