Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#Actualparinho7

Posted 01 January 2013 - 10:20 PM

I hope this will help:

I am not familiar with the debugger, I think that the State instance doesn't have a value.
For some reason this doesn't work well

void CStateManager::change_state(GameStates *cur_state, int next_state){

if (next_state != STATE_NULL)
delete cur_state;

switch (next_state) {
case STATE_MAIN_MENU: cur_state = new State_Main_Menu(); break;
case STATE_EXIT: cur_state = new State_Exit(); break;
}
}

and it doesn't execute the cur_state = new State_Exit();

BUT, I have a cout at the constructor and I do get the output so the object is constructed.

#3parinho7

Posted 01 January 2013 - 10:19 PM

I hope this will help:

I am not familiar with the debugger, I think that the State instance doesn't have a value.
For some reason this doesn't work well

void CStateManager::change_state(GameStates *cur_state, int next_state){

if (next_state != STATE_NULL)
delete cur_state;

switch (next_state) {
case STATE_MAIN_MENU: cur_state = new State_Main_Menu(); break;
case STATE_EXIT: cur_state = new State_Exit(); break;
}
}

and it doesn't execute the cur_state = new State_Exit();

BUT, I have a cout at the constructor and I do get the output so the object is constructed.

#2parinho7

Posted 01 January 2013 - 10:19 PM

I hope this will help:

I am not familiar with the debugger, I think that the State instance doesn't have a value.
For some reason this doesn't work well

void CStateManager::change_state(GameStates *cur_state, int next_state){

if (next_state != STATE_NULL)
delete cur_state;

switch (next_state) {
case STATE_MAIN_MENU: cur_state = new State_Main_Menu(); break;
case STATE_EXIT: cur_state = new State_Exit(); break;
}
}

and it doesn't execute the cur_state = new State_Exit();

BUT, I have a cout at the constructor and I do get the output so the object is constructed.

#1parinho7

Posted 01 January 2013 - 10:13 PM

I hope this will help:

PARTNERS