Jump to content


Photo

BZFlag Port

- - - - -

  • Please log in to reply
No replies to this topic

#1
moonscapex

moonscapex

    Newbie

  • Members
  • Pip
  • 2 posts
Hello Everybody,

I was just playing BZFlag (BZFlag Website) when I thought that it would be great to have on my Mio.  The source code is freely available and written mostly in C++.  I am a software developer in other languages but I'm learning C and C++ soon, so I can't port it.

Heres some info about porting (taken from the source code).

PORTING guide for bzflagFollow these steps to port bzflag to a new platform.  Say thenew platform is named `foo'.  * in src/platform/:    * this step may be skipped if the platform you're porting to      supports SDL and you do not want to have native graphics/audio,      as there are preexisiting SDL* platform files.    * implement the following files, as necessary, using an appropriate      prefix instead of Foo.  it may be possible to use existing files      as is, or to reuse existing code (by copying).      * FooPlatformFactory      * FooDisplay      * FooMedia      * FooVisual      * FooWindow    * add the platform dependent files to Makefile.am with appropriate      'if' guards.  * try building    * modify configure.in for your platform - particularly      to set the proper CFLAGS/CXXFLAGS and to insure that needed      libraries (e.g. OpenGL, curses) can be found.    * fix errors.  errors are typically caused by missing include      files and a missing/different BSD sockets API.  make as few      changes as possible to avoid breaking other platforms.      avoid #if/#endif when you can.    * fix warnings.  (most) warnings are there for a reason.      listen to what they're saying and fix the code.  bzflag      should compile cleanly (zero warnings).  * in package:    * create a makefile to build a package for your platform.      a package includes all the files necessary for installing      bzflag on the platform.  some platforms provide a standard      software management tool (e.g. RPM on RedHat Linux and      swmgr on Irix);  ideally, the package is built for that      tool.  On UNIX, a gzipped tar file with an install shell      script may be sufficient.  The Win32 package is a self      extracting executable with a GUI front end.Most of the bzflag code is portable C++, but there are two API'sthat are not encapsulated:  OpenGL and BSD sockets.  The OpenGLAPI should not present a problem, unless you intend to port tosome other graphics API for some reason, since it's identicalon all platforms.  GL/gl.h provides a #define to identify theversion of OpenGL.  All OpenGL code that's not version 1.0compatible should be #ifdef/#endif guarded and, if possible,also implemented with version 1.0 code for platforms that don'tsupport the later versions.The BSD socket API may cause some trouble if you're not portingto some flavor of UNIX.  Encapsulating network code is on theto do list.Some platform differences are handled using #ifdef/#endifdirectives.  These are to be avoided when possible as they makethe code harder to read and can lead to platform differenceswhen code is updated for some, but not all, platforms.  Pleasemake use of autoconf's HAVE_* defines rather thanplatform-specific predefines...code for features, not forplatforms.Inherently non-portable code is under src/platform.  Itencapsulates windowing and audio subsystems.  (It also includescode to read image and audio files, for historical reasons.)




Is a port possible?

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users