Help on port GL-117 Combat flight sim


Farox

Certified Guru
Joined
Jan 8, 2009
Messages
2,430
Age
56
Location
Italy
Website
rbnet.it
Here is my new port attempt : GL-117 a combat flight simulator game ...http://www.heptargon.de/gl-117/gl-117.html


Some shots of the game:


sshot3_092_700.jpg



i have choosed it for the low HW request and because i think it's a good game for the Pandora.


Some info on the port:


The game originally can be compiled with the use of this libs:


GLUT only (but no sound is supported )


SDL+GL (and glut) this is the standard version with all the feature enabled .


Now i managed to build 3 version of this:


Pandora with use glutes lib (no SDL at all) that partially work.


Pandora with SDL and EGL (gles) libs (this run and music is working...but segfault after some seconds).


Win32 with SDL and gles code of the Pandora to test it...it work under winxp but if you move the mouse it exit.


Now i don't have completed my work of GL-->GLES convertion...so remain little chunks of code to translate.


If someone want to help me finish the port, i'm at a point where don't know what to do more.


Here is my sources (with a codeblock project), and binary of my attempts, plus the original sources and the Win32 binary


http://filesmelt.com/dl/gl-117-1.3_.2_.zip
 
Awesome! I have played this game a bit on my main Linux workstation, and the idea of it coming to Pandora is very appealing. I hope you can make some progress!


One thing: why not set up a free github account for this project, and use it instead of .zip files of sources being passed around? I'd find it a bit easier to help out if there were a repo supporting it.. just my .2c worth ..
 
uhmm i'm not used to github and svn...never used it...but in a spare time i could try...
 
I wont have time to help you on this in a long time (I struggle to find free time to finish that darkplaces port, then I have 2-3 others ports in progress).


I just had a quick look and you have many GL-List in that code. If I were you I would go with that new gl->gles wrapper which provide you these glNewList and glEndList and your EGL implementation looks good otherwise.


CSmoke::drawElemHQ wont work. You need either to separate the 2 quads or use GL_TRIANGLES instead (and add the missing points).


Same goes for Flash::draw.


Else you have already put too much effort in this to give up ;)
 
thanks to all


@ Sebt3 where i find those new gl->gles wrapper ? some hint ?


I have splitted in two the quads....



Code:
#ifdef HAVE_GLES

  // to check

  float myzoom = smokezoom [time [n]];

  GLfloat vtx1[] = {

	  v [n].x - myzoom, v [n].y + myzoom, v [n].z,

	  v [n].x + myzoom, v [n].y + myzoom, v [n].z,

	  v [n].x + myzoom, v [n].y - myzoom, v [n].z,

	  v [n].x - myzoom, v [n].y - myzoom, v [n].z

	  };

  GLfloat vtx2[] = {

	  v [n].x, v [n].y + myzoom, v [n].z - myzoom,

	  v [n].x, v [n].y + myzoom, v [n].z + myzoom,

	  v [n].x, v [n].y - myzoom, v [n].z + myzoom,

	  v [n].x, v [n].y - myzoom, v [n].z - myzoom

	    };

  GLfloat tex1[] = {

	  0,0,

	  1,0,

	  1,1,

	  0,1

    };

  GLfloat tex2[] = {

	  0,0,

	  1,0,

	  1,1,

	  0,1

    };

  glColor4ub (255, 255, 255, time [n] * 10 + 55);

  glEnableClientState(GL_VERTEX_ARRAY);

  glEnableClientState(GL_TEXTURE_COORD_ARRAY);

  glVertexPointer(3, GL_FLOAT, 0, vtx1);

  glTexCoordPointer(2, GL_FLOAT, 0, tex1);

  glDrawArrays(GL_TRIANGLE_FAN,0, 4); 

  glVertexPointer(3, GL_FLOAT, 0, vtx2);

  glTexCoordPointer(2, GL_FLOAT, 0, tex2);

  glDrawArrays(GL_TRIANGLE_FAN,0, 4);

  glDisableClientState(GL_VERTEX_ARRAY);

  glDisableClientState(GL_TEXTURE_COORD_ARRAY);

  #else

is this correct ?



and another thing...is correct to split also the LINES ?





Code:
if (showcollision)

  {

    glPushMatrix ();

    glScalef (cubex, cubey, cubez);

    #ifdef HAVE_GLES

    // to check

    GLfloat vtx1[] = {

	    1, 1, 1,

	    1, 1, -1,

	    1, -1, -1,

	    1, -1, 1,

	    1, 1, 1

    };

    GLfloat vtx2[] = {

	    -1, 1, 1,

	    -1, 1, -1,

	    -1, -1, -1,

	    -1, -1, 1,

	    -1, 1, 1

    };

    GLfloat vtx3[] = { 1, 1, 1, -1, 1, 1 };

    GLfloat vtx4[] = { 1, -1, -1, -1, -1, -1 };

    GLfloat vtx5[] = { 1, -1, 1, -1, -1, 1 };

    GLfloat vtx6[] = { 1, 1, -1, -1, 1, -1 };

    glColor4ub (255, 0, 0, 1);

    glEnableClientState(GL_VERTEX_ARRAY);

    glVertexPointer(3, GL_FLOAT, 0, vtx1);

    glDrawArrays(GL_LINE_STRIP,0, 5);

    glVertexPointer(3, GL_FLOAT, 0, vtx2);

    glDrawArrays(GL_LINE_STRIP,0, 5);

    glVertexPointer(3, GL_FLOAT, 0, vtx3);

    glVertexPointer(3, GL_FLOAT, 0, vtx4);

    glVertexPointer(3, GL_FLOAT, 0, vtx5);

    glVertexPointer(3, GL_FLOAT, 0, vtx6);

    glDrawArrays(GL_LINES,0, 2); 

    glDisableClientState(GL_VERTEX_ARRAY);

    #else

    glColor3ub (255, 0, 0);

    glBegin (GL_LINE_STRIP);

    glVertex3f (1, 1, 1);

    glVertex3f (1, 1, -1);

    glVertex3f (1, -1, -1);

    glVertex3f (1, -1, 1);

    glVertex3f (1, 1, 1);

    glEnd ();

    glBegin (GL_LINE_STRIP);

    glVertex3f (-1, 1, 1);

    glVertex3f (-1, 1, -1);

    glVertex3f (-1, -1, -1);

    glVertex3f (-1, -1, 1);

    glVertex3f (-1, 1, 1);

    glEnd ();

    glBegin (GL_LINES);

    glVertex3f (1, 1, 1);

    glVertex3f (-1, 1, 1);

    glVertex3f (1, -1, -1);

    glVertex3f (-1, -1, -1);

    glVertex3f (1, -1, 1);

    glVertex3f (-1, -1, 1);

    glVertex3f (1, 1, -1);

    glVertex3f (-1, 1, -1);

    glEnd ();

    #endif
 
The wrapper is jwzgles. You can download it with the latest xscreensaver source package.


It is not complete, but it seems to handle displaylists quite good.


Sebt3 and I used it for Polly-B-Gone.


It just contains of two headerfiles and a cpp file.


You have to include the jwzgles header and in it, include the gles headers of the Pandora and comment the other ones.


Then you still need to define HAVE_JWZGLES.


if there is any offending code in the jwzgles wrapper, that interferes with stuff you already handle with your own conversion, comment that too.


Then compile the jwzgles.cpp into your executable.


You can have a look at the polly sources http://sebt3.openpandora.org/private/polly-src.tar.gz
 
Last edited by a moderator:
I've been keeping an eye on this project for years so I'm really pleased to see a port being worked on.


Shame that the projects not still active as It's a very unique project. It doesn't seem to have anything comparable to it in the open source world; not what I've been able to find so far anyway.


Good luck :)
 
is this correct ?
yes that's good.

and another thing...is correct to split also the LINES ?
Yes but this wont work :
Code:
glVertexPointer(3, GL_FLOAT, 0, vtx3);

glVertexPointer(3, GL_FLOAT, 0, vtx4);

glVertexPointer(3, GL_FLOAT, 0, vtx5);

glVertexPointer(3, GL_FLOAT, 0, vtx6);

glDrawArrays(GL_LINES,0, 2);
this way only vtx6 is drawn as you cannot "stack" them, you need a glDrawArrays per array ;)


I for one would try to put all these lines in one array and try (because it should do what you want)
 
Last edited by a moderator:
I have build a new version with this JWZ_GLES wrapper but segmentation fault appear at the same point ... :(


I'm now back to the sources searching for a bug......
 
The textures are power of 2?
Yes they are loaded correctly i think (also for fonts and models) this is the debug info i got from the terminal :

Info: Entering debug level 5


Info: Found gl-117 data directory /media/TRANSCEND16/pandora/gl-117/


Info: Startup ./jwztest.bin, V1.3 ...


Debug: Getting directory locations


Info: Loading ./.gl-117/conf


Info: Saving ./.gl-117/conf


Info: Loading ./.gl-117/conf.interface


Info: Saving ./.gl-117/conf.interface


Debug: Creating/Loading pilots list


Warning: Could not load saves/pilots


Warning: Could not load pilot


Info: Using SDL and GLES


EGL Opening X11 display


EGL Getting EGL display


EGL Initializing


EGL_VENDOR: Imagination Technologies


EGL_VERSION: 1.4 build 1.4.14.2616


EGL_EXTENSIONS: EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_IMG_context_priority


EGL Found 2 available configs


EGL Config 0


EGL Binding API


EGL Creating Context


EGL Creating window surface


EGL Making Current


EGL Complete


Debug: Setting SDL caption


Debug: Creating sound system


Info: Using SDL_mixer


Debug: Playing startup music


Debug: Calling main initialization method


Debug: Creating calculation tables


Debug: Creating advanced OpenGL methods


Debug: Loading textures


Debug: Loading Fonts


Debug: Loading 3ds models:


Debug: * gl-16.3ds


Debug: * gl-15.3ds


Debug: * gl-14c.3ds


Debug: * gl-14d.3ds


Debug: * gl-21b.3ds


Debug: * gl-21.3ds


Debug: * gl-14b.3ds


Debug: * gl-14.3ds


Debug: * gl-29.3ds


Debug: * gl-50.3ds


Debug: * transp2.3ds


Debug: * transp4.3ds


Debug: * cannon1.3ds


Debug: * cannon1b.3ds


Debug: * cannon2.3ds


Debug: * cannon2b.3ds


Debug: * flare1.3ds


Debug: * chaff1.3ds


Debug: * missile1.3ds


Debug: * missile2.3ds


Debug: * missile3.3ds


Debug: * missile4.3ds


Debug: * missile5.3ds


Debug: * missile6.3ds


Debug: * missile7.3ds


Debug: * missile8.3ds


Debug: * flak2.3ds


Debug: * flarak1.3ds


Debug: * ship1.3ds


Debug: * tent1.3ds


Debug: * gl-117.3ds


Debug: * tank1.3ds


Debug: * container1.3ds


Debug: * ship2.3ds


Debug: * truck1.3ds


Debug: * truck2.3ds


Debug: * trsam.3ds


Debug: * pickup1.3ds


Debug: * pickup2.3ds


Debug: * tank2.3ds


Debug: * tent4.3ds


Debug: * hall1.3ds


Debug: * hall2.3ds


Debug: * oilrig.3ds


Debug: * egg.3ds


Debug: * radar.3ds


Debug: * mine1.3ds


Debug: * aster1.3ds


Debug: * base1.3ds


Debug: * barrier.3ds


Debug: * rubble.3ds


Debug: * depot1.3ds


Debug: Setting up world geometry


Debug: Querying joystick


Info: No joystick found


Debug: Create Menu DONE. <<< added by me on Debug info...


Debug: Entering SDL main loop (GLUT emulation)


./runjwzegl.sh: line 4: 2012 Segmentation fault ./jwztest.bin -d5
 
I have build a new version with this JWZ_GLES wrapper but segmentation fault appear at the same point ...
What does say gdb ?


Also are you building with -fsigned-char ?


Still getting a seg-fault with less optimization (aka test with -O2 instead of -O3) ?
 
gdb not used atm..


I have build with -O2 -g and nothing else...i will test with -fsigned-char....thanks
 
quick rebuild...and nothing changed ... :( ....Segmentation fault

now i try your gdb info...thanks
 
with gdb my prog don't find the libGLUES_CM.so that i have in the same dir....how to pass it ?


this is my .sh file



Code:
#!/bin/bash

export LD_LIBRARY_PATH=LD_LIBRARY_PATH:.

export HOME=.

./jwztest.bin -d5
 
Last edited by a moderator:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.


gdb jwztest.bin


> set args -d5


> run


...


...segfault


> bt


[usefull stack infos]


I forgot to add the export for LD_LIBRARY_PATH first (note that $ in red in the line that should be here)
 
ok load of shared libs work...but now the game exit complaining that didn't find the DATAs


structure of the dirs in my SD are:


/media/TRANSCEND16/pandora/gl-117/ ----main dir


/media/TRANSCEND16/pandora/gl-117/bin/ where jwztest.bin and shared libs are.


/media/TRANSCEND16/pandora/gl-117/maps/ ----maps of the game


/media/TRANSCEND16/pandora/gl-117/models/ -----models of the game


/media/TRANSCEND16/pandora/gl-117/music/ ---- music


/media/TRANSCEND16/pandora/gl-117/sounds/ ---- sounds


/media/TRANSCEND16/pandora/gl-117/textures/ ---- textures of the game


/media/TRANSCEND16/pandora/gl-117/saves/ ----- saves
 
tryed with


export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.


export HOME=/media/TRANSCEND16/pandora/gl-117/


gdb jwztest.bin


> set args -d5


> run


...


...segfault


> bt


[usefull stack infos]


but without luck ...
 
Back
Top