Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
Master update 7
Browse files Browse the repository at this point in the history
Added "disable scale" tracks option.
Added keyboard shortcuts for dialogs.
Changed first dialog item focus on process buttons.
  • Loading branch information
PredatorCZ committed Jul 28, 2019
1 parent 81bed19 commit 0170275
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 49 deletions.
6 changes: 4 additions & 2 deletions src/HavokImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,13 @@ void HavokImport::LoadAnimation(const hkaAnimation *ani, const hkaAnimationBindi
Quat &rots = reinterpret_cast<Quat &>(trans.rotation);
cMat.SetRotate(rots.Conjugate());
cMat.SetTrans(reinterpret_cast<Point3 &>(trans.position) * IDC_EDIT_SCALE_value);
cMat.Scale(reinterpret_cast<Point3 &>(trans.scale));

if (!flags[IDC_CH_DISABLE_SCALE_checked])
cMat.Scale(reinterpret_cast<Point3 &>(trans.scale));

if (node->GetParentNode()->IsRootNode())
cMat *= corMat;
else
else if (!flags[IDC_CH_DISABLE_SCALE_checked])
{
Matrix3 pAbsMat = node->GetParentTM(SecToTicks(t));
Point3 nScale = { pAbsMat.GetRow(0).Length(), pAbsMat.GetRow(1).Length(), pAbsMat.GetRow(2).Length() };
Expand Down
4 changes: 4 additions & 0 deletions src/HavokMax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ void HavokMax::LoadCFG()
GetCFGChecked(IDC_CH_ANIMATION);
GetCFGChecked(IDC_CH_ANISKELETON);
GetCFGChecked(IDC_CH_ANIOPTIMIZE);
GetCFGChecked(IDC_CH_DISABLE_SCALE);
GetCFGEnabled(IDC_CH_ANISKELETON);
GetCFGEnabled(IDC_CH_ANIOPTIMIZE);
GetCFGEnabled(IDC_EDIT_ANIEND);
Expand Down Expand Up @@ -300,6 +301,7 @@ void HavokMax::SaveCFG()
SetCFGChecked(IDC_CH_ANIMATION);
SetCFGChecked(IDC_CH_ANISKELETON);
SetCFGChecked(IDC_CH_ANIOPTIMIZE);
SetCFGChecked(IDC_CH_DISABLE_SCALE);
SetCFGEnabled(IDC_CH_ANISKELETON);
SetCFGEnabled(IDC_CH_ANIOPTIMIZE);
SetCFGEnabled(IDC_EDIT_ANIEND);
Expand Down Expand Up @@ -533,6 +535,8 @@ INT_PTR CALLBACK DialogCallbacksMain(HWND hWnd, UINT message, WPARAM wParam, LPA

MSGCheckbox(IDC_CH_ANIOPTIMIZE); break;

MSGCheckbox(IDC_CH_DISABLE_SCALE); break;

MSGCheckbox(IDC_CH_ANISKELETON);
MSGEnableEnabled(IDC_CH_ANISKELETON, IDC_CH_ANIOPTIMIZE);
break;
Expand Down
5 changes: 3 additions & 2 deletions src/HavokMax.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include <vector>
#include "HavokXMLApi.hpp"

#define HAVOKMAX_VERSION 1.8
#define HAVOKMAX_VERSIONINT 180
#define HAVOKMAX_VERSION 1.9
#define HAVOKMAX_VERSIONINT 190

extern TCHAR *GetString(int id);
extern HINSTANCE hInstance;
Expand All @@ -57,6 +57,7 @@ class HavokMax
IDConfigBool(IDC_CH_ANIMATION),
IDConfigBool(IDC_CH_ANISKELETON),
IDConfigBool(IDC_CH_ANIOPTIMIZE),
IDConfigBool(IDC_CH_DISABLE_SCALE),
IDConfigVisible(IDC_CH_ANISKELETON),
IDConfigVisible(IDC_CH_ANIOPTIMIZE),
IDConfigVisible(IDC_EDIT_ANIEND),
Expand Down
85 changes: 43 additions & 42 deletions src/HavokMax.rc
Original file line number Diff line number Diff line change
Expand Up @@ -193,81 +193,82 @@ BEGIN
LTEXT "Toolset:",IDC_STATIC,7,9,26,8
END

IDD_IMPORT_NEW DIALOGEX 0, 0, 123, 159
IDD_IMPORT_NEW DIALOGEX 0, 0, 123, 175
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
FONT 8, "MS Sans Serif", 400, 0, 0xEE
BEGIN
CONTROL "",IDC_EDIT_SCALE,"CustEdit",WS_TABSTOP,45,6,35,10
PUSHBUTTON "&Import",IDC_BT_DONE,6,155,45,14
PUSHBUTTON "&Cancel",IDC_BT_CANCEL,72,155,45,14
PUSHBUTTON "?",IDC_BT_ABOUT,54,155,15,14
CONTROL "&s",IDC_EDIT_SCALE,"CustEdit",WS_TABSTOP,45,6,35,10
CONTROL "&m",IDC_EDIT_MOTIONID,"CustEdit",WS_TABSTOP,45,20,35,10
CONTROL "Invert &Top",IDC_CH_INVERT_TOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,63,44,10
CONTROL "- &B",IDC_CH_INVERT_BACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,57,79,15,8
COMBOBOX IDC_CB_BACK,72,76,36,50,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "- &R",IDC_CH_INVERT_RIGHT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,57,98,15,8
COMBOBOX IDC_CB_RIGHT,72,94,36,50,CBS_DROPDOWNLIST | WS_TABSTOP
COMBOBOX IDC_CB_PRESET,6,131,111,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "+",IDC_BT_ADDPRESET,9,113,18,14
PUSHBUTTON "-",IDC_BT_DELETEPRESET,30,113,18,14
CONTROL "",IDC_SPIN_SCALE,"SpinnerControl",0x0,81,6,7,10
LTEXT "Scale:",IDC_STATIC,9,6,21,8
COMBOBOX IDC_CB_PRESET,6,115,111,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Save",IDC_BT_SAVEPRESET,51,97,39,14,NOT WS_VISIBLE
PUSHBUTTON "+",IDC_BT_ADDPRESET,9,97,18,14
PUSHBUTTON "Import",IDC_BT_DONE,6,139,45,14
PUSHBUTTON "Cancel",IDC_BT_CANCEL,72,139,45,14
PUSHBUTTON "?",IDC_BT_ABOUT,54,139,15,14
PUSHBUTTON "-",IDC_BT_DELETEPRESET,30,97,18,14
CONTROL IDB_BITMAP2,IDC_STATIC,"Static",SS_BITMAP,9,56,24,31
CONTROL "Invert Top",IDC_CH_INVERT_TOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,47,44,10
GROUPBOX "Coords setup",IDC_STATIC,3,36,114,60
CONTROL IDB_BITMAP3,IDC_PC_INVERT_ERROR,"Static",SS_BITMAP | NOT WS_VISIBLE,56,45,3,10
CONTROL IDB_BITMAP3,IDC_PC_REMAP_ERROR2,"Static",SS_BITMAP | NOT WS_VISIBLE,110,62,3,10
CONTROL IDB_BITMAP3,IDC_PC_REMAP_ERROR1,"Static",SS_BITMAP | NOT WS_VISIBLE,110,81,3,10
COMBOBOX IDC_CB_BACK,72,60,36,50,CBS_DROPDOWNLIST | WS_TABSTOP
LTEXT "Back:",IDC_STATIC,36,63,20,8
LTEXT "Right:",IDC_STATIC,36,81,20,8
COMBOBOX IDC_CB_RIGHT,72,78,36,50,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "-",IDC_CH_INVERT_BACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,57,63,15,8
CONTROL "-",IDC_CH_INVERT_RIGHT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,57,82,15,8
CONTROL "",IDC_EDIT_MOTIONID,"CustEdit",WS_TABSTOP,45,20,35,10
PUSHBUTTON "Save",IDC_BT_SAVEPRESET,51,113,39,14,NOT WS_VISIBLE | NOT WS_TABSTOP
CONTROL IDB_BITMAP2,IDC_STATIC,"Static",SS_BITMAP,9,73,24,31
GROUPBOX "Coords setup",IDC_STATIC,3,52,114,60
CONTROL IDB_BITMAP3,IDC_PC_INVERT_ERROR,"Static",SS_BITMAP | NOT WS_VISIBLE,56,62,3,10
CONTROL IDB_BITMAP3,IDC_PC_REMAP_ERROR2,"Static",SS_BITMAP | NOT WS_VISIBLE,110,78,3,10
CONTROL IDB_BITMAP3,IDC_PC_REMAP_ERROR1,"Static",SS_BITMAP | NOT WS_VISIBLE,110,97,3,10
LTEXT "Back:",IDC_STATIC,36,79,20,8
LTEXT "Right:",IDC_STATIC,36,97,20,8
CONTROL "",IDC_SPIN_MOTIONID,"SpinnerControl",0x0,81,20,7,10
LTEXT "Motion ID:",IDC_STATIC,9,20,34,8
CONTROL "&Disable scale",IDC_CH_DISABLE_SCALE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,36,58,10
END

IDD_EXPORT_NEW DIALOGEX 0, 0, 229, 159
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
CONTROL "",IDC_EDIT_SCALE,"CustEdit",WS_TABSTOP,47,24,35,10
PUSHBUTTON "&Export",IDC_BT_DONE,126,140,45,14
PUSHBUTTON "&Cancel",IDC_BT_CANCEL,177,140,45,14
PUSHBUTTON "About",IDC_BT_ABOUT,3,140,45,14
COMBOBOX IDC_CB_TOOLSET,48,4,60,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "&s",IDC_EDIT_SCALE,"CustEdit",WS_TABSTOP,47,24,35,10
CONTROL "Invert &Top",IDC_CH_INVERT_TOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,50,44,10
CONTROL "- &b",IDC_CH_INVERT_BACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63,69,15,8
COMBOBOX IDC_CB_BACK,79,66,36,50,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "- &r",IDC_CH_INVERT_RIGHT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63,88,15,8
COMBOBOX IDC_CB_RIGHT,79,85,36,50,CBS_DROPDOWNLIST | WS_TABSTOP
PUSHBUTTON "+",IDC_BT_ADDPRESET,11,102,18,14
PUSHBUTTON "-",IDC_BT_DELETEPRESET,33,102,18,14
COMBOBOX IDC_CB_PRESET,11,120,111,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Export &animation",IDC_CH_ANIMATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,135,16,68,10
CONTROL "&Include skeleton",IDC_CH_ANISKELETON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,28,68,10
CONTROL "&Optimize tracks",IDC_CH_ANIOPTIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,147,41,64,10
CONTROL "&f",IDC_EDIT_CAPTUREFRAME,"CustEdit",WS_TABSTOP,135,72,35,10
CONTROL "&g",IDC_EDIT_ANISTART,"CustEdit",WS_TABSTOP,168,100,35,10
CONTROL "&h",IDC_EDIT_ANIEND,"CustEdit",WS_TABSTOP,168,112,35,10
CONTROL "",IDC_SPIN_SCALE,"SpinnerControl",0x0,83,24,7,10
LTEXT "Scale:",IDC_STATIC,12,25,21,8
COMBOBOX IDC_CB_PRESET,11,120,111,150,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Save",IDC_BT_SAVEPRESET,57,102,39,14,NOT WS_VISIBLE
PUSHBUTTON "+",IDC_BT_ADDPRESET,11,102,18,14
PUSHBUTTON "Export",IDC_BT_DONE,126,140,45,14
PUSHBUTTON "Cancel",IDC_BT_CANCEL,177,140,45,14
PUSHBUTTON "About",IDC_BT_ABOUT,3,140,45,14
PUSHBUTTON "-",IDC_BT_DELETEPRESET,33,102,18,14
COMBOBOX IDC_CB_TOOLSET,48,4,60,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Toolset:",IDC_STATIC,12,6,26,8
CONTROL IDB_BITMAP2,IDC_STATIC,"Static",SS_BITMAP,15,60,24,31
CONTROL IDB_BITMAP3,IDC_PC_REMAP_ERROR1,"Static",SS_BITMAP | NOT WS_VISIBLE,117,67,3,10
CONTROL IDB_BITMAP3,IDC_PC_REMAP_ERROR2,"Static",SS_BITMAP | NOT WS_VISIBLE,117,86,3,10
CONTROL "Invert Top",IDC_CH_INVERT_TOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,50,44,10
COMBOBOX IDC_CB_BACK,79,66,36,50,CBS_DROPDOWNLIST | WS_TABSTOP
LTEXT "Back:",IDC_STATIC,43,69,20,8
LTEXT "Right:",IDC_STATIC,43,87,20,8
COMBOBOX IDC_CB_RIGHT,79,85,36,50,CBS_DROPDOWNLIST | WS_TABSTOP
GROUPBOX "Coords setup",IDC_STATIC,9,40,114,60
CONTROL "-",IDC_CH_INVERT_BACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63,69,15,8
CONTROL "-",IDC_CH_INVERT_RIGHT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63,88,15,8
CONTROL IDB_BITMAP3,IDC_PC_INVERT_ERROR,"Static",SS_BITMAP | NOT WS_VISIBLE,63,49,3,10
GROUPBOX "Animation",IDC_STATIC,126,4,96,128
CONTROL "",IDC_EDIT_CAPTUREFRAME,"CustEdit",WS_TABSTOP,135,72,35,10
CONTROL "",IDC_SPIN_CAPTUREFRAME,"SpinnerControl",0x0,171,72,7,10
LTEXT "Skeleton capture frame:",IDC_STATIC,135,60,76,8
CONTROL "",IDC_EDIT_ANISTART,"CustEdit",WS_TABSTOP,168,100,35,10
CONTROL "",IDC_SPIN_ANISTART,"SpinnerControl",0x0,204,100,7,10
LTEXT "Start:",IDC_STATIC,135,100,18,8
LTEXT "End:",IDC_STATIC,135,112,16,8
CONTROL "",IDC_EDIT_ANIEND,"CustEdit",WS_TABSTOP,168,112,35,10
CONTROL "",IDC_SPIN_ANIEND,"SpinnerControl",0x0,204,112,7,10
LTEXT "Animation capture range:",IDC_STATIC,135,88,80,8
CONTROL "Export animation",IDC_CH_ANIMATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,135,16,68,10
CONTROL "Include skeleton",IDC_CH_ANISKELETON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,28,68,10
CONTROL "Optimize tracks",IDC_CH_ANIOPTIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,147,41,64,10
END


Expand Down Expand Up @@ -300,7 +301,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 116
TOPMARGIN, 7
BOTTOMMARGIN, 152
BOTTOMMARGIN, 168
END

IDD_EXPORT_NEW, DIALOG
Expand Down
9 changes: 6 additions & 3 deletions src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define IDB_BITMAP3 110
#define IDC_CLOSEBUTTON 1000
#define IDC_DOSTUFF 1000
#define IDC_CH_FIX_SCALE 1000
#define IDC_RB_ZX 1001
#define IDC_RB_ZY 1002
#define IDC_RB_ZZ 1003
Expand Down Expand Up @@ -54,27 +55,29 @@
#define IDC_CH_ANISKELETON 1039
#define IDC_CH_ANIOPTIMIZE 1040
#define IDC_CH_INVERT_RIGHT2 1041
#define IDC_CH_DISABLE_SCALE 1041
#define IDC_CHECK2 1042
#define IDC_COLOR 1456
#define IDC_EDIT 1490
#define IDC_EDIT_SCALE 1490
#define IDC_EDIT_CAPTUREFRAME 1491
#define IDC_EDIT_MOTIONID 1501
#define IDC_EDIT_ANISTART 1492
#define IDC_EDIT_ANIEND 1493
#define IDC_SPIN 1496
#define IDC_SPIN_SCALE 1496
#define IDC_SPIN_CAPTUREFRAME 1497
#define IDC_SPIN_MOTIONID 1500
#define IDC_SPIN_ANISTART 1498
#define IDC_SPIN_ANIEND 1499
#define IDC_SPIN_MOTIONID 1500
#define IDC_EDIT_MOTIONID 1501

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 112
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1041
#define _APS_NEXT_CONTROL_VALUE 1043
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

0 comments on commit 0170275

Please sign in to comment.