A little tapdancing to fix a missing symbol at link time.

This commit is contained in:
Ryan C. Gordon 2016-03-31 12:40:11 -04:00
parent 2668cdc44f
commit ed527eb29e
6 changed files with 26 additions and 17 deletions

View File

@ -16,7 +16,7 @@ static char THIS_FILE[] = __FILE__;
// CDlgPlayerControls dialog // CDlgPlayerControls dialog
CDlgPlayerControls::CDlgPlayerControls(CControls &ctrlControls, CWnd* pParent /*=NULL*/) CDlgPlayerControls::CDlgPlayerControls(CControls &ctrlControls, CWnd* pParent /*=NULL*/)
: CDialog(CDlgPlayerControls::IDD, pParent), m_ctrlControls(_pGame->gm_ctrlControlsExtra) : CDialog(CDlgPlayerControls::IDD, pParent), m_ctrlControls(*_pGame->gm_ctrlControlsExtra)
{ {
// make copy of the controls, we will change them // make copy of the controls, we will change them
m_ctrlControls = ctrlControls; m_ctrlControls = ctrlControls;

View File

@ -125,7 +125,7 @@ BOOL CDlgPlayerSettings::OnInitDialog()
void CDlgPlayerSettings::OnEditControls() void CDlgPlayerSettings::OnEditControls()
{ {
CControls &ctrlControls = _pGame->gm_ctrlControlsExtra; CControls &ctrlControls = *_pGame->gm_ctrlControlsExtra;
// try to // try to
try try
{ {

View File

@ -74,6 +74,13 @@ EXPORTABLE CGame *GAME_Create(void)
} // extern "C" } // extern "C"
// Just working around a symbol reference in a shared library that isn't
// available in SeriousSam by turning gm_ctrlControlsExtra into a pointer
// instead of a full object. Messy; sorry! --ryan.
CGame::CGame() : gm_ctrlControlsExtra(new CControls) {}
CGame::~CGame() { delete gm_ctrlControlsExtra; }
// recorded profiling stats // recorded profiling stats
static CTimerValue _tvDemoStarted; static CTimerValue _tvDemoStarted;
static CTimerValue _tvLastFrame; static CTimerValue _tvLastFrame;

View File

@ -150,6 +150,8 @@ public:
*/ */
class CGame { class CGame {
public: public:
CGame();
virtual ~CGame();
enum ConsoleState gm_csConsoleState; enum ConsoleState gm_csConsoleState;
enum ConsoleState gm_csComputerState; enum ConsoleState gm_csComputerState;
@ -167,7 +169,7 @@ public:
CPlayerCharacter gm_apcPlayers[8]; CPlayerCharacter gm_apcPlayers[8];
CControls gm_actrlControls[8]; CControls gm_actrlControls[8];
CControls gm_ctrlControlsExtra; CControls *gm_ctrlControlsExtra;
INDEX gm_iSinglePlayer; INDEX gm_iSinglePlayer;
INDEX gm_iWEDSinglePlayer; INDEX gm_iWEDSinglePlayer;

View File

@ -171,7 +171,7 @@ void ControlsMenuOn()
{ {
_pGame->SavePlayersAndControls(); _pGame->SavePlayersAndControls();
try { try {
_pGame->gm_ctrlControlsExtra.Load_t(_fnmControlsToCustomize); _pGame->gm_ctrlControlsExtra->Load_t(_fnmControlsToCustomize);
} catch( char *strError) { } catch( char *strError) {
WarningMessage(strError); WarningMessage(strError);
} }
@ -180,13 +180,13 @@ void ControlsMenuOn()
void ControlsMenuOff() void ControlsMenuOff()
{ {
try { try {
if (_pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count()>0) { if (_pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions.Count()>0) {
_pGame->gm_ctrlControlsExtra.Save_t(_fnmControlsToCustomize); _pGame->gm_ctrlControlsExtra->Save_t(_fnmControlsToCustomize);
} }
} catch( char *strError) { } catch( char *strError) {
FatalError(strError); FatalError(strError);
} }
FORDELETELIST( CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itAct) { FORDELETELIST( CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itAct) {
delete &itAct.Current(); delete &itAct.Current();
} }
_pGame->LoadPlayersAndControls(); _pGame->LoadPlayersAndControls();
@ -1477,7 +1477,7 @@ BOOL LSLoadControls(const CTFileName &fnm)
{ {
try { try {
ControlsMenuOn(); ControlsMenuOn();
_pGame->gm_ctrlControlsExtra.Load_t(fnm); _pGame->gm_ctrlControlsExtra->Load_t(fnm);
ControlsMenuOff(); ControlsMenuOff();
} catch (char *strError) { } catch (char *strError) {
CPrintF("%s", strError); CPrintF("%s", strError);
@ -4280,7 +4280,7 @@ void CControlsMenu::EndMenu(void)
void CControlsMenu::ObtainActionSettings(void) void CControlsMenu::ObtainActionSettings(void)
{ {
CControls &ctrls = _pGame->gm_ctrlControlsExtra; CControls &ctrls = *_pGame->gm_ctrlControlsExtra;
mgControlsSensitivity.mg_iMinPos = 0; mgControlsSensitivity.mg_iMinPos = 0;
mgControlsSensitivity.mg_iMaxPos = 50; mgControlsSensitivity.mg_iMaxPos = 50;
@ -4301,7 +4301,7 @@ void CControlsMenu::ObtainActionSettings(void)
void CControlsMenu::ApplyActionSettings(void) void CControlsMenu::ApplyActionSettings(void)
{ {
CControls &ctrls = _pGame->gm_ctrlControlsExtra; CControls &ctrls = *_pGame->gm_ctrlControlsExtra;
FLOAT fSensitivity = FLOAT fSensitivity =
FLOAT(mgControlsSensitivity.mg_iCurPos-mgControlsSensitivity.mg_iMinPos) / FLOAT(mgControlsSensitivity.mg_iCurPos-mgControlsSensitivity.mg_iMinPos) /
@ -4587,8 +4587,8 @@ void CCustomizeKeyboardMenu::FillListItems(void)
BOOL bHasLast = FALSE; BOOL bHasLast = FALSE;
// set diks to key buttons // set diks to key buttons
INDEX iLabel=0; INDEX iLabel=0;
INDEX ctLabels = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count(); INDEX ctLabels = _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions.Count();
FOREACHINLIST( CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itAct) FOREACHINLIST( CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itAct)
{ {
INDEX iInMenu = iLabel-gm_iListOffset; INDEX iInMenu = iLabel-gm_iListOffset;
if( (iLabel>=gm_iListOffset) && if( (iLabel>=gm_iListOffset) &&
@ -4654,7 +4654,7 @@ void CCustomizeKeyboardMenu::StartMenu(void)
{ {
ControlsMenuOn(); ControlsMenuOn();
gm_iListOffset = 0; gm_iListOffset = 0;
gm_ctListTotal = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count(); gm_ctListTotal = _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions.Count();
gm_iListWantedItem = 0; gm_iListWantedItem = 0;
CGameMenu::StartMenu(); CGameMenu::StartMenu();
} }
@ -4736,7 +4736,7 @@ void CCustomizeAxisMenu::Initialize_t(void)
void CCustomizeAxisMenu::ObtainActionSettings(void) void CCustomizeAxisMenu::ObtainActionSettings(void)
{ {
ControlsMenuOn(); ControlsMenuOn();
CControls &ctrls = _pGame->gm_ctrlControlsExtra; CControls &ctrls = *_pGame->gm_ctrlControlsExtra;
INDEX iSelectedAction = mgAxisActionTrigger.mg_iSelected; INDEX iSelectedAction = mgAxisActionTrigger.mg_iSelected;
INDEX iMountedAxis = ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_iAxisAction; INDEX iMountedAxis = ctrls.ctrl_aaAxisActions[ iSelectedAction].aa_iAxisAction;
@ -4765,7 +4765,7 @@ void CCustomizeAxisMenu::ObtainActionSettings(void)
void CCustomizeAxisMenu::ApplyActionSettings(void) void CCustomizeAxisMenu::ApplyActionSettings(void)
{ {
CControls &ctrls = _pGame->gm_ctrlControlsExtra; CControls &ctrls = *_pGame->gm_ctrlControlsExtra;
INDEX iSelectedAction = mgAxisActionTrigger.mg_iSelected; INDEX iSelectedAction = mgAxisActionTrigger.mg_iSelected;
INDEX iMountedAxis = mgAxisMountedTrigger.mg_iSelected; INDEX iMountedAxis = mgAxisMountedTrigger.mg_iSelected;
FLOAT fSensitivity = FLOAT fSensitivity =

View File

@ -1756,7 +1756,7 @@ void CMGKeyDefinition::SetBindingNames(BOOL bDefining)
// find the button // find the button
INDEX ict=0; INDEX ict=0;
INDEX iDik=0; INDEX iDik=0;
FOREACHINLIST( CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itba) { FOREACHINLIST( CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itba) {
if( ict == mg_iControlNumber) { if( ict == mg_iControlNumber) {
CButtonAction &ba = *itba; CButtonAction &ba = *itba;
// get the current bindings and names // get the current bindings and names
@ -1814,7 +1814,7 @@ void CMGKeyDefinition::DefineKey(INDEX iDik)
{ {
// for each button in controls // for each button in controls
INDEX ict=0; INDEX ict=0;
FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itba) { FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itba) {
CButtonAction &ba = *itba; CButtonAction &ba = *itba;
// if it is this one // if it is this one
if (ict == mg_iControlNumber) { if (ict == mg_iControlNumber) {