Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
68 user(s) are online (36 user(s) are browsing Forums)

Members: 0
Guests: 68

more...

Support us!

Headlines

 
  Register To Post  

FHeroes2 V1.0 Heroes of Might and Magic II OS4 Port Help
Not too shy to talk
Not too shy to talk


See User information
@all

I have compiled Beworld's port fheroes2 V1.0.0 (Heroes of Might and Magic II engine). Thanks to Beworld, I made BigEndian fixes.

However after starting the game , game shutdowns itself with these error in CLI windows:

"Expection 'basic_sting::M_create' occured during application time

I looked at sources and basic_string is only used here.

What may be wrong ?

maps_fileinfo.cpp:

namespace
{
    const 
size_t mapNameLength 16;
    const 
size_t mapDescriptionLength 200;

    
template <typename CharType>
    
bool CaseInsensitiveCompare( const std::basic_string<CharType> & lhs, const std::basic_string<CharType> & rhs )
    {
        
typename std::basic_string<CharType>::const_iterator li lhs.begin();
        
typename std::basic_string<CharType>::const_iterator ri rhs.begin();

        while ( 
li != lhs.end() && ri != rhs.end() ) {
            const 
CharType lc std::tolower( *listd::locale() );
            const 
CharType rc std::tolower( *ristd::locale() );

            ++
li;
            ++
ri;

            if ( 
lc rc ) {
                return 
true;
            }
            if ( 
lc rc ) {
                return 
false;
            }
            
// the chars are "equal", so proceed to check the next pair
        
}

        
// we came to the end of either (or both) strings, left is "smaller" if it was shorter:
        
return li == lhs.end() && ri != rhs.end();
    }

    
uint8_t ByteToColor( const int byte )
    {
        switch ( 
byte ) {
        case 
0:
            return 
Color::BLUE;
        case 
1:
            return 
Color::GREEN;
        case 
2:
            return 
Color::RED;
        case 
3:
            return 
Color::YELLOW;
        case 
4:
            return 
Color::ORANGE;
        case 
5:
            return 
Color::PURPLE;

        default:
            break;
        }

        return 
Color::NONE;
    }

    
int ByteToRace( const int byte )
    {
        switch ( 
byte ) {
        case 
0x00:
            return 
Race::KNGT;
        case 
0x01:
            return 
Race::BARB;
        case 
0x02:
            return 
Race::SORC;
        case 
0x03:
            return 
Race::WRLK;
        case 
0x04:
            return 
Race::WZRD;
        case 
0x05:
            return 
Race::NECR;
        case 
0x06:
            return 
Race::MULT;
        case 
0x07:
            return 
Race::RAND;

        default:
            break;
        }

        return 
Race::NONE;
    }
}

Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: FHeroes2 V1.0 Heroes of Might and Magic II OS4 Port Help
Amigans Defender
Amigans Defender


See User information
Could be that you receive nulls in lhs and rhs.
Did you check that parameters?

i'm really tired...
Go to top
Re: FHeroes2 V1.0 Heroes of Might and Magic II OS4 Port Help
Not too shy to talk
Not too shy to talk


See User information
@afxgroup

I am still a beginner in C++.

There is no mention lhs or rhs anywhere in the code..

Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: FHeroes2 V1.0 Heroes of Might and Magic II OS4 Port Help
Amigans Defender
Amigans Defender


See User information
You should see where CaseInsensitiveCompare is called and see what is passed to the function

i'm really tired...
Go to top
Re: FHeroes2 V1.0 Heroes of Might and Magic II OS4 Port Help
Not too shy to talk
Not too shy to talk


See User information
@all

I'm stuck with this error
"Expection 'basic_sting::M_create' occured during application time
when running the game.
If anyone wants to check the sources.
Here it is

https://drive.google.com/file/d/1eAzw_ ... AbKeM/view?usp=share_link

Sinan - AmigaOS4 Beta-Tester
- AmigaOne X5000
- AmigaOne A1222
- Sam460ex
Go to top
Re: FHeroes2 V1.0 Heroes of Might and Magic II OS4 Port Help
Just can't stay away
Just can't stay away


See User information
@SinanSam460

basic_string sources are in gcc:include/c++. You might be able to generate a stack trace by inserting asm("trap"); inside M_create before throw. I suppose the file is basic_string.tcc.

You should then rebuild your binary with debug flags, like -gstabs. You can build a helloworld app first, add trap there and test what you get.

EDIT: changed debug flag.


Edited by Capehill on 2023/3/15 17:52:42
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project