Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

Crash: null m_Backdrop at lostalife state (?)


Crash: null m_Backdrop at lostalife state (?)

Postby Vander » Oct 16, 2002 @ 6:11pm

When I use

Code: Select all

  ChangeState( GAME_STATE_LOSTALIFE );
1 lines; 0 keywds; 0 nums; 3 ops; 0 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  


the game crashes inside LostALifeImpl.cpp:

Code: Select all









10 
11 
12 
13 
14 
15 
16 
17 
void LostALifeImpl::Initialize()
{
    ScopedPtr< IniFile > ini( GetFactory()->NewIniFile( "ini/game.ini" ) );
    CIString s;
    ini->GetStringValue( "lostalife", "backdrop", s );
    if (!= "") m_Backdrop.Reset( GetFactory()->NewSurface( s.c_str() ) );

    // CRASHES HERE (m_Backdrop is null)
    m_Backdrop->CopyTo( GetApi()->GetSecondary() );

    ini->GetStringValue( "lostalife", "font", s );
    if (!= "") m_Font.Reset( GetFactory()->NewFont( GetFactory()->NewSurface( s.c_str() ), "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ) );
    ini->GetStringValue( "lostalife", "text", s );
    int texty = ini->GetIntValue( "lostalife", "texty" );
    if (!= "") m_Font->Centre( s.c_str(), 120, texty );
    while (GetApi()->Clicked());
}
17 lines; 6 keywds; 1 nums; 121 ops; 13 strs; 1 coms    Syntactic Coloring v0.4 - Dan East  


I am trying to find why it is happening. The backdrop file exists at the specified directory ("graphics/lostalife.tga"). Any ideas?

Thanks
Vander
pm Member
 
Posts: 21
Joined: May 21, 2002 @ 11:03am
Location: Brazil


Postby Rhino123 » Oct 17, 2002 @ 4:08pm

hmm weird. The only thing I can come up with is that the location in the inifile is not correct. But as I understand you coreectly you have checked that right?

R
User avatar
Rhino123
pm Member
 
Posts: 66
Joined: Jul 2, 2002 @ 2:58pm
Location: Amsterdam


Postby Vander » Oct 17, 2002 @ 4:39pm

Yes, I checked. "s" contains "graphics/lostalife.tga" and the file is there. I even replaced the file with the original that comes with the library.

The snippet:

Code: Select all









10 
11 
.
.
.
[lostalife]
backdrop = "graphics/lostalife.tga"
font = "graphics/smallfont.tga"
text = "ARRRGHHH!!!"
texty = 25
.
.
.
11 lines; 0 keywds; 1 nums; 12 ops; 3 strs; 0 coms    Syntactic Coloring v0.4 - Dan East  


I compared to the CaveRunner sample, I don't see any difference.

I still can't understand the reason for the crash, but anyways, I won't use the default lostalife for the final game, so that's ok. For now it would be nice to use the default one, because I'm working on other things, but well, fine. 8)

Thanks
Vander
pm Member
 
Posts: 21
Joined: May 21, 2002 @ 11:03am
Location: Brazil


Return to Phantom's Forum


Sort


Forum Description

Discuss any of Phantom's projects here (Operation Nutcracker, etc.)

Moderators:

sponge, RICoder, Phantom

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron