#174285 - Azenris - Wed May 26, 2010 8:25 pm
A little confused why I can't have this. Currently I get the error shown below
CState_TitleScreen inherits from IState where the MoveToState function exists. I thought I could use a pointer to the base, i did with with all my entities. They become players, enemies, object, special effects and all in a list of the base entity class.
Is it something to do with the function being apart of the base class? Hmm this is confusing me :(
EDIT: I changed it slighly moving control from the state to the statemanager but its still the same problem
EDIT: here is some more info incase I didnt provide enough
state_splashscreen.h
state_manager.h
state_manager.cpp
game.h
game.cpp
the error call
_________________
<Robert Morley>
My Homebrew Games
Last edited by Azenris on Wed May 26, 2010 9:14 pm; edited 1 time in total
Code: |
1>c:/Users/Azenris/Desktop/RedTemple/RedTemple/arm9/source/state_titlescreen.cpp(120): error: no matching function for call to 'CState_TitleScreen::MoveToState(CState_NewGame*)'
1>../nexlib_dir/include/state.h(74): note: candidates are: void IState::MoveToState(IState*, bool, int) |
CState_TitleScreen inherits from IState where the MoveToState function exists. I thought I could use a pointer to the base, i did with with all my entities. They become players, enemies, object, special effects and all in a list of the base entity class.
Is it something to do with the function being apart of the base class? Hmm this is confusing me :(
EDIT: I changed it slighly moving control from the state to the statemanager but its still the same problem
Code: |
1>c:/Users/Azenris/Desktop/RedTemple/RedTemple/arm9/source/state_splashscreen.cpp: In member function 'virtual void CState_SplashScreen::OnUpdate()':
1>c:/Users/Azenris/Desktop/RedTemple/RedTemple/arm9/source/state_splashscreen.cpp(68): error: no matching function for call to 'CStateManager::MoveToState(CState_TitleScreen*, bool, int)' 1>../nexlib_dir/include/state_manager.h(41): note: candidates are: void CStateManager::MoveToState(IState*, bool, int) |
EDIT: here is some more info incase I didnt provide enough
state_splashscreen.h
Code: |
// =================================================================================
// CLASS: CState_SplashScreen class CState_SplashScreen : public IState { // other stuff } |
state_manager.h
Code: |
// ================================================================================
// CLASS: CStateManager class CStateManager : public IManager { // other stuff void MoveToState(IState *pNewState, bool fade = true, int speed = 8); } |
state_manager.cpp
Code: |
// ================================================================================
// MoveToState // @ pNewState: state to go next // @ fade: whether or not to fade out // @ speed: speed to fade out void CStateManager::MoveToState(IState *pNewState, bool fade, int speed) { m_pStateToMove = pNewState; if (fade) { m_pCurrentState->FadeOut(SCREEN_MAIN, FADE_BLACK, speed); m_pCurrentState->FadeOut(SCREEN_SUB, FADE_BLACK, speed); } else { m_pCurrentState->SetMoveOn(); } } |
game.h
Code: |
class CState_SplashScreen;
class CGame { // other stuff CState_TitleScreen *GetState_TitleScreen(void) const; } |
game.cpp
Code: |
#include "state_splashscreen.h"
CState_TitleScreen *CGame::GetState_TitleScreen(void) const {return m_pState_TitleScreen;} |
the error call
Code: |
g_pGame->GetStateManager()->MoveToState(g_pGame->GetState_TitleScreen(), true, 4); |
_________________
<Robert Morley>
My Homebrew Games
Last edited by Azenris on Wed May 26, 2010 9:14 pm; edited 1 time in total