Egoboo Community Forum

The Legend of Egoboo Sporks of Yore
It is currently Sat Nov 18, 2017 4:29 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Mon Feb 21, 2011 11:32 pm 
Offline
Acid Blob (New member)
Acid Blob (New member)

Joined: Tue Sep 09, 2008 8:45 pm
Posts: 4
I compiled the current SVN (1510) on Linux (Suse 11.3/64bit) to get around the movement problem in 2.8.1 already reported
http://egoboo.sourceforge.net/forum/viewtopic.php?t=1177

For this I had to made some adjustments to get the code compiled:

- strupr() is missing in Linux.
For strlwr() there is already an implementation in game.c, but it does not follow the man-page:
Quote:
char * strlwr (char * s)
Convert a string to lower case.
Returns:
The strlwr() function returns a pointer to the converted string.

The current code returns an integer and will make some problems if used like in wawalite_file.c
Can be changed to something like:
Code:
char* strlwr( char * str )
{
  char *ret = str;
    if ( NULL != str )
    {
      while ( CSTR_END != *str )
      {
          *str = tolower( *str );
          str++;
      }
    }
    return ret;
}


You get strupr() if you replace tolower with toupper ;).


- Function sys_popup in platform/sys_linux.c is somehow broken. I commented the body, as it was in 2.8.1.

- AStar_find_path and AStar_get_path are missing. I just included AStar.c in script_functins.c


Finally I didn't get Egoboo working yet - but I'm still optimistic.
I guess I have to fiddle with the resource files.

Does someone know if the original problem (move characters using keyboard on Linux) is fixed in the current SVN version?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 22, 2011 1:42 pm 
Offline
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
User avatar

Joined: Wed Jul 23, 2008 1:27 am
Posts: 3818
Location: Norway
Thanks for your input. I have applied your fixes to the svn.

I am not sure what causes the keyboard problem yet (could be a SDL issue?), but I have rewritten much of the input controller code since 2.8.1 - I might have fixed the problem. (I did replace those bool to float math operations)

I think it complained about AStar.c since it wasn't added to the makefile. I've added it now.

[edit]
By the way, I have implemented a new version of the message box that tries to use different solutions. I can't test if it works properly or if it compiles since I don't use linux.

New message box function for linux:
[spoiler]
Code:
//--------------------------------------------------------------------------------------------
void sys_popup( const char * popup_title, const char * warning, const char * format, va_list args )
{
    //ZF> Basic untested implementation of error messaging in Linux
    // @TODO: It has been reported that this doesn't work (22.02.2011)

    STRING message, buffer;
    bool_t tried[DIALOG_PROGRAM_END] = { bfalse };
    int i, type = DIALOG_PROGRAM_BEGIN;
    const char *session = getenv( "DESKTOP_SESSION" );

    //Ready the message
    snprintf( message, SDL_arraysize( message ), warning );
    vsnprintf( buffer, SDL_arraysize( buffer ), format, args );
    strcat( message, buffer );
    strcat( message, "\n Press OK to exit." );

    //Figure out if there is a method we prefer
    if  ( 0 == strcmp( session, "gnome" ) ) type = ZENITY;
    else if( 0 == strcmp session, "kde" ) ) type = KDIALOG;

    while( btrue )
    {
        //Ready the command
        switch( type )
        {
            case ZENITY:   sprintf( buffer, "zenity --error --text=\"%s\" --title=\"%s\"", message, popup_title ); break;
            case KDIALOG:  sprintf( buffer, "kdialog %s \"--error\" --title \"%s\"", message, popup_title ); break;
            case XMESSAGE: sprintf( buffer, "xmessage -center \"%s\"", message ); break;
        }

        //Did we succeed?
        if( 0 <= system(cmd) ) break;

        //Nope, try the next solution
        tried[type] = btrue;

        for( i = DIALOG_PROGRAM_BEGIN; i < DIALOG_PROGRAM_END; i++ )
        {
            if( tried[type] ) continue;
            type = i;
        }

        //Did everything fail? If so we just give up
        if( i == DIALOG_PROGRAM_END ) break;
    }

}

[/spoiler]

[/edit]

_________________
http://egoboo.sourceforge.net
Image

Coder


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 22, 2011 10:38 pm 
Offline
Acid Blob (New member)
Acid Blob (New member)

Joined: Tue Sep 09, 2008 8:45 pm
Posts: 4
Thanks.

I still don't get the SVN version working.
It just exits when I select a module to start - also the mouse cursor is broken (showing a square only).

So finally I went back to 1.8.1 code and applied the suggested fix from the thread mentioned above. Basically in set_one_player_latch() I replaced
Code:
joy_pos.x = ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_RIGHT ) - control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_LEFT ) );
joy_pos.y = ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_DOWN ) - control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_UP ) );

in the keyboard handling, into
Code:
joy_pos.x = 0;
if ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_RIGHT ) ) joy_pos.x = 1;
if ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_LEFT ) ) joy_pos.x = -1;;
joy_pos.y = 0;
if ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_DOWN ) ) joy_pos.y = 1;
if ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_UP ) ) joy_pos.y = -1;

which now works nicely.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 22, 2011 11:11 pm 
Offline
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
User avatar

Joined: Wed Jul 23, 2008 1:27 am
Posts: 3818
Location: Norway
OK. I had applied the exact same fix in the SVN.

I am not sure why you are having issues with the cursor or picking modules though, they work fine on windows. (is the cursor a complete white box btw?)

_________________
http://egoboo.sourceforge.net
Image

Coder


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 23, 2011 12:13 am 
Offline
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)

Joined: Wed Jul 23, 2008 4:22 am
Posts: 1864
Location: Minnesota, USA
Code:
joy_pos.x = 0;
if ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_RIGHT ) ) joy_pos.x += 1;
if ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_LEFT ) ) joy_pos.x -= 1;

joy_pos.y = 0;
if ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_DOWN ) ) joy_pos.y += 1;
if ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_UP ) ) joy_pos.y -= 1;


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 23, 2011 12:58 am 
Offline
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
User avatar

Joined: Wed Jul 23, 2008 1:27 am
Posts: 3818
Location: Norway
There already is a clear_2fvect() function in the beginning ;)

_________________
http://egoboo.sourceforge.net
Image

Coder


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 23, 2011 1:37 am 
Offline
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)

Joined: Wed Jul 23, 2008 4:22 am
Posts: 1864
Location: Minnesota, USA
"+= 1" and "-= 1", not "= 1" or "= -1"


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 23, 2011 2:31 am 
Offline
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
User avatar

Joined: Wed Jul 23, 2008 1:27 am
Posts: 3818
Location: Norway
Ah yes that is also the way it's already in the SVN. ;) The code he posted was his own version of the fix.

_________________
http://egoboo.sourceforge.net
Image

Coder


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 23, 2011 8:23 am 
Offline
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)

Joined: Wed Jul 23, 2008 4:22 am
Posts: 1864
Location: Minnesota, USA
very good. ;)

Otherwise, the - control would always override the + control...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 23, 2011 11:27 pm 
Offline
Acid Blob (New member)
Acid Blob (New member)

Joined: Tue Sep 09, 2008 8:45 pm
Posts: 4
Well, you should not send the poor guy to left and right at the same time ;)...

Ok, agreed.


The mouse shows up as white box. Same size as cursor and fully functional.

In the meantime I found the place where game stops for me.
The error message is: "There are not enought :'s in mp_data/wawalite.txt"

I traced it down to read_wawalight_fog where it reads fog.bottom.
Here's the stack trace:



[spoiler]
(gdb) where
#0 sys_popup (popup_title=<value optimized out>, warning=<value optimized out>, format=0x49b9d0 "There are not enough %c's in file! (%s)\n", args=<value optimized out>) at platform/sys_linux.c:76
#1 0x0000000000451b19 in log_error (format=0x49b9d0 "There are not enough %c's in file! (%s)\n") at log.c:155
#2 0x0000000000429791 in goto_delimiter (buffer=0x0, fileread=0x2b0ca80, delim=58 ':', optional=bfalse) at egoboo_fileutil.c:145
#3 0x000000000042a4e6 in fget_next_float (fileread=0x2b0ca80) at egoboo_fileutil.c:872
#4 0x0000000000493487 in read_wawalite_fog (filename=<value optimized out>, pdata=0x1ad04d0) at file_formats/wawalite_file.c:310
#5 read_wawalite_file_vfs (filename=<value optimized out>, pdata=0x1ad04d0) at file_formats/wawalite_file.c:368
#6 0x0000000000438e75 in read_wawalite () at game.c:4825
#7 0x0000000000439198 in game_load_module_assets (modname=0x7fff301bf3d0 "mp_modules/advent.mod/") at game.c:3161
#8 0x000000000043927a in game_load_module_data (modname=0x1b004e0 "mp_modules/advent.mod", seed=1298501898) at game.c:3221
#9 game_begin_module (modname=0x1b004e0 "mp_modules/advent.mod", seed=1298501898) at game.c:3468
#10 0x000000000043b3e2 in do_game_proc_begin (gproc=0x18cb3a0, frameDuration=<value optimized out>) at game.c:1070
#11 do_game_proc_run (gproc=0x18cb3a0, frameDuration=<value optimized out>) at game.c:1334
#12 0x0000000000487348 in do_ego_proc_running (argc=<value optimized out>, argv=<value optimized out>) at egoboo.c:304
#13 SDL_main (argc=<value optimized out>, argv=<value optimized out>) at egoboo.c:435
#14 0x00007fec6f63ab7d in __libc_start_main () from /lib64/libc.so.6
#15 0x0000000000406529 in _start () at ../sysdeps/x86_64/elf/start.S:113
[/spoiler]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 24, 2011 12:10 am 
Offline
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
User avatar

Joined: Wed Jul 23, 2008 1:27 am
Posts: 3818
Location: Norway
Your datafiles are out of date :) Egoboo reads a new format of wavalite.txt. The newest data files for Egoboo can be found also in the SVN. (branches/install)

_________________
http://egoboo.sourceforge.net
Image

Coder


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Get Egoboo at SourceForge.net. Fast, secure and Free Open Source software downloads