mirror of
https://github.com/electronicarts/CnC_Renegade.git
synced 2025-12-16 07:31:40 -05:00
Initial commit of Command & Conquer Renegade source code.
This commit is contained in:
123
Code/Tools/ViewTrans/ViewTrans.dsp
Normal file
123
Code/Tools/ViewTrans/ViewTrans.dsp
Normal file
@@ -0,0 +1,123 @@
|
||||
# Microsoft Developer Studio Project File - Name="ViewTrans" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=ViewTrans - Win32 Release
|
||||
!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 "ViewTrans.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 "ViewTrans.mak" CFG="ViewTrans - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ViewTrans - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "ViewTrans - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""$/Commando/Code/Tools/ViewTrans", WBMAAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ViewTrans - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "c:\3dsmax2\maxsdk\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib core.lib geom.lib mesh.lib util.lib /nologo /subsystem:windows /dll /machine:I386 /out:"Release\viewtrans.dlu"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ViewTrans - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# 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 /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MD /W3 /Gm /GX /ZI /Od /I "c:\3dsmax2\maxsdk\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib core.lib mesh.lib geom.lib util.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"Debug\viewtrans.dlu"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ViewTrans - Win32 Release"
|
||||
# Name "ViewTrans - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dllmain.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\viewtrans.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\viewtrans.def
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\viewtrans.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\viewtrans.rc
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
97
Code/Tools/ViewTrans/dllmain.cpp
Normal file
97
Code/Tools/ViewTrans/dllmain.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* $Header: /Commando/Code/Tools/ViewTrans/dllmain.cpp 2 1/16/98 5:02p Greg_h $ */
|
||||
/***********************************************************************************************
|
||||
*** Confidential - Westwood Studios ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : Matrix Viewer Utility *
|
||||
* *
|
||||
* File Name : DLLMAIN.CPP *
|
||||
* *
|
||||
* Programmer : Greg Hjelstrom *
|
||||
* *
|
||||
* Start Date : 02/25/97 *
|
||||
* *
|
||||
* Last Update : February 25, 1997 [GH] *
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* DllMain -- Windows DLL initialization *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
#include <Max.h>
|
||||
#include "viewtrans.h"
|
||||
|
||||
|
||||
/*
|
||||
** Globals
|
||||
*/
|
||||
|
||||
int controlsInit = FALSE;
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* DllMain -- Windows DLL initialization *
|
||||
* *
|
||||
* This function is called by Windows when the DLL is loaded. This *
|
||||
* function may also be called many times during time critical operations *
|
||||
* like rendering. Therefore developers need to be careful what they *
|
||||
* do inside this function. In the code below, note how after the DLL is *
|
||||
* loaded the first time only a few statements are executed. *
|
||||
* *
|
||||
* INPUT: *
|
||||
* *
|
||||
* OUTPUT: *
|
||||
* *
|
||||
* WARNINGS: *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 02/25/1997 GH : Created. *
|
||||
*=============================================================================================*/
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
|
||||
{
|
||||
// Hang on to this DLL's instance handle.
|
||||
hInstance = hinstDLL;
|
||||
|
||||
if (! controlsInit) {
|
||||
controlsInit = TRUE;
|
||||
|
||||
// Initialize MAX's custom controls
|
||||
InitCustomControls(hInstance);
|
||||
|
||||
// Initialize Win95 controls
|
||||
InitCommonControls();
|
||||
}
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
__declspec(dllexport) const TCHAR *
|
||||
LibDescription() { return _T("Transformation Matrix Viewer"); }
|
||||
|
||||
__declspec(dllexport) int
|
||||
LibNumberClasses() { return 1; }
|
||||
|
||||
__declspec(dllexport) ClassDesc*
|
||||
LibClassDesc(int i) { return &UtilityDesc; }
|
||||
|
||||
__declspec(dllexport) ULONG
|
||||
LibVersion() { return VERSION_3DSMAX; }
|
||||
|
||||
62
Code/Tools/ViewTrans/resource.h
Normal file
62
Code/Tools/ViewTrans/resource.h
Normal file
@@ -0,0 +1,62 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by ViewTrans.rc
|
||||
//
|
||||
#define IDD_VIEWTRANS 118
|
||||
#define IDC_NODETM_0 1016
|
||||
#define IDC_NODETM_1 1017
|
||||
#define IDC_NODETM_2 1018
|
||||
#define IDC_NODETM_3 1019
|
||||
#define IDC_NODETM_4 1020
|
||||
#define IDC_NODETM_5 1021
|
||||
#define IDC_NODETM_6 1022
|
||||
#define IDC_NODETM_7 1023
|
||||
#define IDC_NODETM_8 1024
|
||||
#define IDC_NODETM_9 1025
|
||||
#define IDC_NODETM_10 1026
|
||||
#define IDC_NODETM_11 1027
|
||||
#define IDC_OBJOFFTM_0 1028
|
||||
#define IDC_OBJTM_0 1028
|
||||
#define IDC_OBJOFFTM_1 1029
|
||||
#define IDC_OBJTM_1 1029
|
||||
#define IDC_OBJOFFTM_2 1030
|
||||
#define IDC_OBJTM_2 1030
|
||||
#define IDC_OBJOFFTM_3 1031
|
||||
#define IDC_OBJTM_3 1031
|
||||
#define IDC_OBJOFFTM_4 1032
|
||||
#define IDC_OBJTM_4 1032
|
||||
#define IDC_OBJOFFTM_5 1033
|
||||
#define IDC_OBJTM_5 1033
|
||||
#define IDC_OBJOFFTM_6 1034
|
||||
#define IDC_OBJTM_6 1034
|
||||
#define IDC_OBJOFFTM_7 1035
|
||||
#define IDC_OBJTM_7 1035
|
||||
#define IDC_OBJOFFTM_8 1036
|
||||
#define IDC_OBJTM_8 1036
|
||||
#define IDC_OBJOFFTM_9 1037
|
||||
#define IDC_OBJTM_9 1037
|
||||
#define IDC_OBJOFFTM_10 1038
|
||||
#define IDC_OBJTM_10 1038
|
||||
#define IDC_OBJOFFTM_11 1039
|
||||
#define IDC_OBJTM_11 1039
|
||||
#define IDC_OBJOFF_ROT_X 1040
|
||||
#define IDC_OBJOFF_ROT_Y 1041
|
||||
#define IDC_OBJOFF_ROT_Z 1042
|
||||
#define IDC_OBJOFF_TRANS_X 1043
|
||||
#define IDC_OBJOFF_TRANS_Y 1044
|
||||
#define IDC_OBJOFF_TRANS_Z 1045
|
||||
#define IDC_OBJOFF_SCALE_X 1046
|
||||
#define IDC_OBJOFF_SCALE_Y 1047
|
||||
#define IDC_OBJOFF_SCALE_Z 1048
|
||||
#define IDC_OBJOFF_ROT_W 1049
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 119
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1017
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
350
Code/Tools/ViewTrans/viewtrans.cpp
Normal file
350
Code/Tools/ViewTrans/viewtrans.cpp
Normal file
@@ -0,0 +1,350 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* $Header: /Commando/Code/Tools/ViewTrans/viewtrans.cpp 3 7/06/98 6:28p Greg_h $ */
|
||||
/***********************************************************************************************
|
||||
*** Confidential - Westwood Studios ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : Trnasformation Viewer Utility *
|
||||
* *
|
||||
* File Name : VIEWTRANS.CPP *
|
||||
* *
|
||||
* Programmer : Greg Hjelstrom *
|
||||
* *
|
||||
* Start Date : 02/24/97 *
|
||||
* *
|
||||
* Last Update : February 25, 1997 [GH] *
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* UtilityDlgProc -- Dialog Proc to handle all of the dialog's windows messages *
|
||||
* TVU::TransViewerUtility -- Constructor *
|
||||
* TVU::OnInitDialog -- Initializes the custom controls. *
|
||||
* TVU::BeginEditParams -- Adds the rollup to the control panel *
|
||||
* TVU::EndEditParams -- Removes the rollup from the panel *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#include <MAX.H>
|
||||
#include <UTILAPI.H>
|
||||
#include "viewtrans.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
** Globals
|
||||
*/
|
||||
|
||||
HINSTANCE hInstance;
|
||||
TransViewerUtility TheUtility;
|
||||
UtilityClassDesc UtilityDesc;
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* UtilityDlgProc -- Dialog Proc to handle all of the dialog's windows messages *
|
||||
* *
|
||||
* INPUT: *
|
||||
* *
|
||||
* OUTPUT: *
|
||||
* *
|
||||
* WARNINGS: *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 02/25/1997 GH : Created. *
|
||||
*=============================================================================================*/
|
||||
BOOL CALLBACK UtilityDlgProc(HWND hDlg, UINT message, WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
TransViewerUtility *to = &TheUtility;
|
||||
|
||||
// Respond to the message type...
|
||||
switch (message) {
|
||||
|
||||
case WM_INITDIALOG:
|
||||
// Initialize all our Custom Controls
|
||||
TheUtility.OnInitDialog(hDlg, lParam);
|
||||
return TRUE;
|
||||
|
||||
case WM_DESTROY:
|
||||
// Release all our Custom Controls
|
||||
return FALSE;
|
||||
|
||||
case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE:
|
||||
// Pass these messages on to the RollupMouseMessage method
|
||||
// to allow 'hand cursor' scrolling with unused area of the
|
||||
// rollup page.
|
||||
to->ip->RollupMouseMessage(hDlg, message, wParam, lParam);
|
||||
break;
|
||||
|
||||
case WM_MOUSEACTIVATE:
|
||||
to->ip->RealizeParamPanel();
|
||||
return FALSE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* TVU::TransViewerUtility -- Constructor *
|
||||
* *
|
||||
* INPUT: *
|
||||
* *
|
||||
* OUTPUT: *
|
||||
* *
|
||||
* WARNINGS: *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 02/25/1997 GH : Created. *
|
||||
*=============================================================================================*/
|
||||
TransViewerUtility::TransViewerUtility(void)
|
||||
{
|
||||
iu = NULL;
|
||||
ip = NULL;
|
||||
hPanel = NULL;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* TVU::BeginEditParams -- Adds the rollup to the control panel *
|
||||
* *
|
||||
* INPUT: *
|
||||
* *
|
||||
* OUTPUT: *
|
||||
* *
|
||||
* WARNINGS: *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 02/25/1997 GH : Created. *
|
||||
*=============================================================================================*/
|
||||
void TransViewerUtility::BeginEditParams(Interface *ip, IUtil *iu)
|
||||
{
|
||||
this->iu = iu;
|
||||
this->ip = ip;
|
||||
|
||||
// Add the rollup page to the command panel.
|
||||
hPanel = ip->AddRollupPage(
|
||||
hInstance,
|
||||
MAKEINTRESOURCE(IDD_VIEWTRANS),
|
||||
UtilityDlgProc,
|
||||
ROLLUP_PAGE_TITLE,
|
||||
(LPARAM)this);
|
||||
|
||||
|
||||
// update the display
|
||||
SelectionSetChanged(ip,iu);
|
||||
}
|
||||
|
||||
/***********************************************************************************************
|
||||
* TVU::EndEditParams -- Removes the rollup from the panel *
|
||||
* *
|
||||
* INPUT: *
|
||||
* *
|
||||
* OUTPUT: *
|
||||
* *
|
||||
* WARNINGS: *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 02/25/1997 GH : Created. *
|
||||
*=============================================================================================*/
|
||||
void TransViewerUtility::EndEditParams(Interface *ip, IUtil *iu)
|
||||
{
|
||||
// Delete the rollup page
|
||||
ip->DeleteRollupPage(hPanel);
|
||||
|
||||
// The panel index is only valid within BeginEditParams and
|
||||
// EndEditParams. Set it to null for safety.
|
||||
hPanel = NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************************************
|
||||
* TVU::OnInitDialog -- Initializes the custom controls. *
|
||||
* *
|
||||
* INPUT: *
|
||||
* *
|
||||
* OUTPUT: *
|
||||
* *
|
||||
* WARNINGS: *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 02/25/1997 GH : Created. *
|
||||
*=============================================================================================*/
|
||||
void TransViewerUtility::OnInitDialog(HWND hDlg, LPARAM lParam)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void TransViewerUtility::SelectionSetChanged(Interface *ip,IUtil *iu)
|
||||
{
|
||||
// If there is not one and only one selected, clear
|
||||
// the display with zeros.
|
||||
if (ip->GetSelNodeCount() != 1) {
|
||||
Display_Data(
|
||||
Matrix3(1),
|
||||
Matrix3(1),
|
||||
Point3(0.0f,0.0f,0.0f),
|
||||
Quat(0.0f,0.0f,0.0f,0.0f),
|
||||
ScaleValue(Point3(1.0f,1.0f,1.0f))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get all sorts of info about this node!
|
||||
INode * node = ip->GetSelNode(0);
|
||||
Matrix3 nodetm = node->GetNodeTM(ip->GetTime());
|
||||
Matrix3 objtm = node->GetObjectTM(ip->GetTime());
|
||||
Point3 objoffpos = node->GetObjOffsetPos();
|
||||
Quat objoffrot = node->GetObjOffsetRot();
|
||||
ScaleValue objoffscl = node->GetObjOffsetScale();
|
||||
|
||||
// display on the panel
|
||||
Display_Data(nodetm,objtm,objoffpos,objoffrot,objoffscl);
|
||||
}
|
||||
|
||||
|
||||
void TransViewerUtility::Display_Data
|
||||
(
|
||||
Matrix3 &nodetm,
|
||||
Matrix3 &objtm,
|
||||
Point3 &objoffpos,
|
||||
Quat &objoffrot,
|
||||
ScaleValue &objoffscl
|
||||
)
|
||||
{
|
||||
char string[256];
|
||||
Point3 vect;
|
||||
|
||||
//////////////////////////////////////////
|
||||
// 3x3 sub-matrix of the ObjectTM
|
||||
//////////////////////////////////////////
|
||||
vect = objtm.GetRow(0);
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_0),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_1),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_2),string);
|
||||
|
||||
vect = objtm.GetRow(1);
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_3),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_4),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_5),string);
|
||||
|
||||
vect = objtm.GetRow(2);
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_6),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_7),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_8),string);
|
||||
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Translation portion of the ObjectTM
|
||||
///////////////////////////////////////////
|
||||
vect = objtm.GetTrans();
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_9),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_10),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJTM_11),string);
|
||||
|
||||
///////////////////////////////////////////
|
||||
// 3x3 sub-matrix of the NodeTM
|
||||
///////////////////////////////////////////
|
||||
vect = objtm.GetRow(0);
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_0),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_1),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_2),string);
|
||||
|
||||
vect = objtm.GetRow(1);
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_3),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_4),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_5),string);
|
||||
|
||||
vect = objtm.GetRow(2);
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_6),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_7),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_8),string);
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Translation portion of the NodeTM
|
||||
///////////////////////////////////////////
|
||||
vect = nodetm.GetTrans();
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_9),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_10),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_NODETM_11),string);
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Object-Offset translation:
|
||||
///////////////////////////////////////////
|
||||
vect = objoffpos;
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_TRANS_X),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_TRANS_Y),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_TRANS_Z),string);
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Object-Offset scaling:
|
||||
///////////////////////////////////////////
|
||||
vect = objoffscl.s;
|
||||
sprintf(string,"%5.3f",vect.x);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_SCALE_X),string);
|
||||
sprintf(string,"%5.3f",vect.y);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_SCALE_Y),string);
|
||||
sprintf(string,"%5.3f",vect.z);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_SCALE_Z),string);
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Object-Offset Quaternion:
|
||||
///////////////////////////////////////////
|
||||
sprintf(string,"%5.3f",objoffrot[0]);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_ROT_X),string);
|
||||
sprintf(string,"%5.3f",objoffrot[1]);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_ROT_Y),string);
|
||||
sprintf(string,"%5.3f",objoffrot[2]);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_ROT_Z),string);
|
||||
sprintf(string,"%5.3f",objoffrot[3]);
|
||||
SetWindowText(GetDlgItem(hPanel, IDC_OBJOFF_ROT_W),string);
|
||||
|
||||
|
||||
}
|
||||
8
Code/Tools/ViewTrans/viewtrans.def
Normal file
8
Code/Tools/ViewTrans/viewtrans.def
Normal file
@@ -0,0 +1,8 @@
|
||||
LIBRARY viewtrans
|
||||
EXPORTS
|
||||
LibDescription @1
|
||||
LibNumberClasses @2
|
||||
LibClassDesc @3
|
||||
LibVersion @4
|
||||
SECTIONS
|
||||
.data READ WRITE
|
||||
126
Code/Tools/ViewTrans/viewtrans.h
Normal file
126
Code/Tools/ViewTrans/viewtrans.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* $Header: /Commando/Code/Tools/ViewTrans/viewtrans.h 3 7/06/98 6:27p Greg_h $ */
|
||||
/***********************************************************************************************
|
||||
*** Confidential - Westwood Studios ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : Matrix Viewer Utility *
|
||||
* *
|
||||
* File Name : VIEWTRANS.H *
|
||||
* *
|
||||
* Programmer : Greg Hjelstrom *
|
||||
* *
|
||||
* Start Date : 02/25/97 *
|
||||
* *
|
||||
* Last Update : February 25, 1997 [GH] *
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
#ifndef VIEWTRANS_H
|
||||
#define VIEWTRANS_H
|
||||
|
||||
#include <Max.h>
|
||||
#include <Quat.h>
|
||||
#include <UTILAPI.H>
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
** Globals
|
||||
*/
|
||||
|
||||
class TransViewerUtility;
|
||||
class UtilityClassDesc;
|
||||
|
||||
extern HINSTANCE hInstance;
|
||||
extern TransViewerUtility TheUtility;
|
||||
extern UtilityClassDesc UtilityDesc;
|
||||
|
||||
#define CATEGORY_NAME _T("Westwood Tools")
|
||||
#define ROLLUP_PAGE_TITLE _T("Transformation Viewer")
|
||||
#define VIEWTRANS_CLASS_NAME _T("Transformation Viewer")
|
||||
#define VIEWTRANS_CLASS_ID Class_ID(0x4e607ad, 0x155612cc)
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Class declaration for TransViewerUtility.
|
||||
*
|
||||
* This utility simply displays the transformation matrices of the currently
|
||||
* selected node.
|
||||
*
|
||||
*****************************************************************************/
|
||||
class TransViewerUtility : public UtilityObj
|
||||
{
|
||||
public:
|
||||
|
||||
TransViewerUtility();
|
||||
void OnInitDialog(HWND hWnd, LPARAM lParam);
|
||||
void BeginEditParams(Interface *ip, IUtil *iu);
|
||||
void EndEditParams(Interface *ip, IUtil *iu);
|
||||
void SelectionSetChanged(Interface *ip,IUtil *iu);
|
||||
void DeleteThis() {}
|
||||
|
||||
void Display_Data
|
||||
(
|
||||
Matrix3 &nodetm,
|
||||
Matrix3 &objtm,
|
||||
Point3 &objoffpos,
|
||||
Quat &objoffrot,
|
||||
ScaleValue &objoffscl
|
||||
);
|
||||
|
||||
// Keep ahold of pointer to our interfaces to MAX.
|
||||
IUtil *iu;
|
||||
Interface *ip;
|
||||
|
||||
// Window handle to the dialog box.
|
||||
HWND hPanel;
|
||||
|
||||
private:
|
||||
|
||||
// windows Dialog Proc which manipulates this class's data.
|
||||
friend BOOL CALLBACK UtilityDlgProc(HWND hDlg, UINT message,
|
||||
WPARAM wParam, LPARAM lParam);
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Class Description
|
||||
*
|
||||
*****************************************************************************/
|
||||
class UtilityClassDesc : public ClassDesc
|
||||
{
|
||||
public:
|
||||
int IsPublic() {return 1;}
|
||||
void * Create(BOOL loading = FALSE) {return &TheUtility;}
|
||||
const TCHAR * ClassName() {return VIEWTRANS_CLASS_NAME;}
|
||||
SClass_ID SuperClassID() {return UTILITY_CLASS_ID;}
|
||||
Class_ID ClassID() {return VIEWTRANS_CLASS_ID;}
|
||||
const TCHAR* Category() {return CATEGORY_NAME;}
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*VIEWTRANS_H*/
|
||||
139
Code/Tools/ViewTrans/viewtrans.rc
Normal file
139
Code/Tools/ViewTrans/viewtrans.rc
Normal file
@@ -0,0 +1,139 @@
|
||||
//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
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_VIEWTRANS DIALOG DISCARDABLE 0, 0, 108, 323
|
||||
STYLE WS_CHILD | WS_VISIBLE
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "Node Transform",IDC_STATIC,1,101,103,89
|
||||
LTEXT "00.000",IDC_NODETM_0,11,124,23,8
|
||||
LTEXT "00.000",IDC_NODETM_1,40,124,23,8
|
||||
LTEXT "00.000",IDC_NODETM_2,71,124,23,8
|
||||
LTEXT "00.000",IDC_NODETM_3,11,135,23,8
|
||||
LTEXT "00.000",IDC_NODETM_4,40,135,23,8
|
||||
LTEXT "00.000",IDC_NODETM_5,71,135,23,8
|
||||
LTEXT "00.000",IDC_NODETM_6,11,146,23,8
|
||||
LTEXT "00.000",IDC_NODETM_7,40,146,23,8
|
||||
LTEXT "00.000",IDC_NODETM_8,71,146,23,8
|
||||
LTEXT "3x3 Sub-Matrix",IDC_STATIC,8,111,48,8
|
||||
LTEXT "Translation:",IDC_STATIC,8,161,38,8
|
||||
LTEXT "00.000",IDC_NODETM_9,11,172,23,8
|
||||
LTEXT "00.000",IDC_NODETM_10,40,172,23,8
|
||||
LTEXT "00.000",IDC_NODETM_11,71,172,23,8
|
||||
GROUPBOX "Object Transform",IDC_STATIC,1,5,103,89
|
||||
LTEXT "00.000",IDC_OBJTM_0,11,31,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_1,40,31,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_2,72,31,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_3,11,42,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_4,40,42,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_5,72,42,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_6,11,53,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_7,40,53,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_8,72,53,23,8
|
||||
LTEXT "3x3 Sub-Matrix",IDC_STATIC,9,18,48,8
|
||||
LTEXT "Translation:",IDC_STATIC,9,68,38,8
|
||||
LTEXT "00.000",IDC_OBJTM_9,12,79,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_10,41,79,23,8
|
||||
LTEXT "00.000",IDC_OBJTM_11,72,79,23,8
|
||||
GROUPBOX "Object Offset",IDC_STATIC,1,195,103,123
|
||||
LTEXT "Rotation Quaternion:",IDC_STATIC,5,257,69,8
|
||||
LTEXT "00.000",IDC_OBJOFF_ROT_X,38,267,23,8
|
||||
LTEXT "00.000",IDC_OBJOFF_ROT_Y,38,279,23,8
|
||||
LTEXT "00.000",IDC_OBJOFF_ROT_Z,38,291,23,8
|
||||
LTEXT "Translation:",IDC_STATIC,5,208,38,8
|
||||
LTEXT "00.000",IDC_OBJOFF_TRANS_X,8,219,23,8
|
||||
LTEXT "00.000",IDC_OBJOFF_TRANS_Y,37,219,23,8
|
||||
LTEXT "00.000",IDC_OBJOFF_TRANS_Z,68,219,23,8
|
||||
LTEXT "Scaling:",IDC_STATIC,5,233,38,8
|
||||
LTEXT "00.000",IDC_OBJOFF_SCALE_X,8,244,23,8
|
||||
LTEXT "00.000",IDC_OBJOFF_SCALE_Y,37,244,23,8
|
||||
LTEXT "00.000",IDC_OBJOFF_SCALE_Z,68,244,23,8
|
||||
LTEXT "00.000",IDC_OBJOFF_ROT_W,38,304,23,8
|
||||
LTEXT "x:",IDC_STATIC,18,267,8,8
|
||||
LTEXT "y:",IDC_STATIC,18,279,8,8
|
||||
LTEXT "z:",IDC_STATIC,18,291,8,8
|
||||
LTEXT "w:",IDC_STATIC,18,304,8,8
|
||||
END
|
||||
|
||||
|
||||
#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
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_VIEWTRANS, DIALOG
|
||||
BEGIN
|
||||
BOTTOMMARGIN, 134
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
Reference in New Issue
Block a user