IPB Style© Fisana

Jump to content


Android port


  • Please log in to reply
227 replies to this topic

#101 Sonarpulse

Sonarpulse

  • Community Members
    PipPip

  • Sesquiplicarius
    (161 posts)

Posted 12 February 2012 - 01:54 AM

View Postafeder, on 11 February 2012 - 03:15 PM, said:

I'll be trying to commit any hacks I make here as I go along: https://github.com/afeder/0ad-android

Might you want to remake that as a fork of the official git mirror? https://github.com/0ad/0ad
Posted ImagePosted ImagePosted Image

#102 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 12 February 2012 - 02:14 AM

View PostSonarpulse, on 12 February 2012 - 01:54 AM, said:

Might you want to remake that as a fork of the official git mirror? https://github.com/0ad/0ad
I was unsure how often that repo actually updates? I figured it would be incovenient if e.g. Ykkrosh pushes a change to SVN and there then is a lag before it hits Github.

#103 Sonarpulse

Sonarpulse

  • Community Members
    PipPip

  • Sesquiplicarius
    (161 posts)

Posted 12 February 2012 - 02:46 AM

You could configure git to ignore ".svn/*" (very easy, just dump that in a text file called .gitignore). Then you can continue to use svn to update if the official repositories get out of sync, without confusing git. in addition, because of git's hashed based versioning, if both git repositories endup with the same version separately, git should take note.
Posted ImagePosted ImagePosted Image

#104 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 12 February 2012 - 04:30 AM

View PostSonarpulse, on 12 February 2012 - 02:46 AM, said:

You could configure git to ignore ".svn/*" (very easy, just dump that in a text file called .gitignore). Then you can continue to use svn to update if the official repositories get out of sync, without confusing git. in addition, because of git's hashed based versioning, if both git repositories endup with the same version separately, git should take note.
Okay, I've forked the official repo and cloned the fork repo to a directory on my local machine. How do I now pull the latest SVN revision into this directory? Doing svn co as normal fails with an error saying that the directory already exists.

#105 Echelon9

Echelon9

  • Donator

  • Discens
    (54 posts)

Posted 12 February 2012 - 07:11 AM

"svn up"

#106 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 12 February 2012 - 07:56 AM

View PostEchelon9, on 12 February 2012 - 07:11 AM, said:

"svn up"
This fails because it doesn't know which URL to pull from.

Currently trying to do a git svn clone, but darn - is it taking a while (it's cloning the whole revision history).

#107 Sonarpulse

Sonarpulse

  • Community Members
    PipPip

  • Sesquiplicarius
    (161 posts)

Posted 12 February 2012 - 08:49 AM

I don;t know about git svn clone, but that sounds like a git to svn converter. I would
  • git clone your fork
  • copy past the svn over the git,
  • add .svn/* and .svn to .gitignore (one per line)
  • try pushing to git hub.
Then copy in your android hacks+commit. whether you want to pop 'em all in, or make a "fake history" and commit in changes is up to you. If SVN adds anything else besides ".svn/*", I would copy that too.
Posted ImagePosted ImagePosted Image

#108 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 12 February 2012 - 08:56 AM

Yes, that might have been a more sensible approach. I guess git-svn converts the svn revision history to git. Anyhow - in the meantime, it completed.

#109 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 12 February 2012 - 04:43 PM

An auto-updated Git mirror would be handy so it's always in sync - it's easy to get the SVN server run a script after every commit to do whatever extra updates are needed.

I've been continuing to commit various GLES compatibility fixes, mostly trying to fix things in a permanent way (not just disabling code temporarily). The basic strategy is that any fixed-function multitexture setup code (glTexEnvi etc) should be moved to ShaderProgramFFP.cpp, and the rendering code should load it via g_Renderer.GetShaderManager().LoadEffect(...), so that we can easily add a GLSL-based implementation of the shader later. Then the rendering code should replace calls to glVertexPointer(...) etc with shader->VertexPointer(...) (which translates the fixed-function arrays into generic vertex attributes for GLES-compatible GLSL). Then replace all glBegin/glVertex3f/etc drawing with vertex arrays and glDrawArrays. Then replace the GL global matrix stuff with client-side computation of the model-view-projection matrix, and pass it to the shader with shader->Uniform("transform", m). I think the shader API provides everything that's needed for this now, so the remaining work is mostly just mechanical translation.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#110 Sonarpulse

Sonarpulse

  • Community Members
    PipPip

  • Sesquiplicarius
    (161 posts)

Posted 12 February 2012 - 09:10 PM

View Postafeder, on 12 February 2012 - 08:56 AM, said:

Yes, that might have been a more sensible approach. I guess git-svn converts the svn revision history to git. Anyhow - in the meantime, it completed.

Well, a git checkout downloads all history too, so you probably wouldn't have saved on download times. Just make sure the conversion didn't get rid of .svn (or can git update+convert too?) and if you "push --force" to your forked repo on github it might be able to make some sense of it. Good luck!

Edited by Sonarpulse, 12 February 2012 - 09:11 PM.

Posted ImagePosted ImagePosted Image

#111 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 13 February 2012 - 09:02 PM

As of r11065, I can build and start the game with Mesa's GLESv2 implementation - there's no text on the menu screen, and it crashes when you start a match, but that should be enough to test the Android port.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#112 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 13 February 2012 - 09:23 PM

Great. Going to try pushing it to my device ASAP!

#113 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 13 February 2012 - 10:15 PM

View PostYkkrosh, on 13 February 2012 - 09:02 PM, said:

As of r11065, I can build and start the game with Mesa's GLESv2 implementation - there's no text on the menu screen, and it crashes when you start a match, but that should be enough to test the Android port.
I'm getting this (severely reduced) error output. The GL related errors I assume are related to NVTT and/or FCollada, so I'll #if that out. The others seem platform-specific and I'd better fix those.

#114 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 14 February 2012 - 12:06 AM

r11068 fixes some. With the GL errors: What version of the NDK are you using? I'm testing with android-ndk-r7-crystax-4 and those symbols (GL_BGRA_EXT etc) are defined in platforms/*/*/usr/include/GLES2/gl2ext.h.

After some fiddling with libraries and Premake and environment variables etc, I can get it to compile against the NDK and get far enough for the linker to complain about mostly-legitimate missing symbols. I've been writing a script to automatically build all the libraries based on the steps in the wiki, so I'll try to get that working and upload it some time tomorrow.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#115 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 14 February 2012 - 01:03 AM

View PostYkkrosh, on 14 February 2012 - 12:06 AM, said:

r11068 fixes some. With the GL errors: What version of the NDK are you using? I'm testing with android-ndk-r7-crystax-4 and those symbols (GL_BGRA_EXT etc) are defined in platforms/*/*/usr/include/GLES2/gl2ext.h.

After some fiddling with libraries and Premake and environment variables etc, I can get it to compile against the NDK and get far enough for the linker to complain about mostly-legitimate missing symbols. I've been writing a script to automatically build all the libraries based on the steps in the wiki, so I'll try to get that working and upload it some time tomorrow.
With the latest revision it's down to this. I use android-ndk-r5-crystax-2 because I weren't able to get android-ndk-r7-crystax-4 to compile Boost. Were you?

#116 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 14 February 2012 - 12:10 PM

I patched the Boost build script with

--- MysticTreeGames-Boost-for-Android-70838fc/build-android.sh  2011-10-16 14:34:17.000000000 +0100
+++ MysticTreeGames-Boost-for-Android-70838fc/build-android.sh  2012-01-29 13:06:37.289820841 +0000
@@ -104,19 +104,19 @@
         ;;
     windows|cygwin)
         Platfrom=windows-x86
         ;;
     *)  # let's play safe here
         Platfrom=linux-x86
 esac
 
-CXXPATH=$AndroidNDKRoot/build/prebuilt/$Platfrom/arm-eabi-4.4.0/bin/arm-eabi-g++
-CXXFLAGS=-I$AndroidNDKRoot/build/platforms/android-8/arch-arm/usr/include
-TOOLSET=gcc-androidR4
+CXXPATH=$AndroidNDKRoot/bin/arm-linux-androideabi-g++
+CXXFLAGS=-I$AndroidNDKRoot/sysroot/usr/include
+TOOLSET=gcc-androidR5
 if [ -n "$NDK_R5" ]; then
        CXXPATH=$AndroidNDKRoot/toolchains/arm-linux-androideabi-4.4.3/prebuilt/$Platfrom/bin/arm-linux-androideabi-g++
        CXXFLAGS="-I$AndroidNDKRoot/platforms/android-8/arch-arm/usr/include \
                                -I$AndroidNDKRoot/sources/cxx-stl/gnu-libstdc++/include \
                                -I$AndroidNDKRoot/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include \
                                -I$AndroidNDKRoot/sources/wchar-support/include"
        TOOLSET=gcc-androidR5
 fi
then passed it the toolchain path instead of NDK path when running it, which seemed to be enough to get it building with the latest NDK.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#117 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 15 February 2012 - 02:50 AM

After a load of disgusting hacks, and after giving up on the emulator since it seems to complain when executing certain instructions (blx) in the Crystax NDK, I can get the code to start running on the real device. Currently the only data file is the hwdetect.js script which lets it report some hardware details like
{
 "os_unix": 1,
 "os_linux": 1,
 "os_macosx": 0,
 "os_win": 0,
 "arch_ia32": 0,
 "arch_amd64": 0,
 "build_debug": 1,
 "build_opengles": 1,
 "build_datetime": "Feb 15 2012 01:13:30",
 "build_revision": "custom build",
 "build_msc": 0,
 "build_icc": 0,
 "build_gcc": 404,
 "gfx_card": "ARM Mali-400 MP",
 "gfx_drv_ver": "OpenGL OpenGL ES 2.0",
 "gfx_mem": 0,
 "snd_card": "",
 "snd_drv_ver": "",
 "GL_VERSION": "OpenGL ES 2.0",
 "GL_VENDOR": "ARM",
 "GL_RENDERER": "Mali-400 MP",
 "GL_EXTENSIONS": "GL_OES_texture_npot GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture GL_OES_packed_depth_stencil ",
 "GL_SUBPIXEL_BITS": 4,
 "GL_MAX_TEXTURE_SIZE": 4096,
 "GL_MAX_CUBE_MAP_TEXTURE_SIZE": 1024,
 "GL_MAX_VIEWPORT_DIMS[0]": 4096,
 "GL_MAX_VIEWPORT_DIMS[1]": 4096,
 "GL_ALIASED_POINT_SIZE_RANGE[0]": 0.25,
 "GL_ALIASED_POINT_SIZE_RANGE[1]": 100,
 "GL_ALIASED_LINE_WIDTH_RANGE[0]": 0.25,
 "GL_ALIASED_LINE_WIDTH_RANGE[1]": 100,
 "GL_SAMPLE_BUFFERS": 0,
 "GL_SAMPLES": 0,
 "GL_RED_BITS": 5,
 "GL_GREEN_BITS": 6,
 "GL_BLUE_BITS": 5,
 "GL_ALPHA_BITS": 0,
 "GL_DEPTH_BITS": 0,
 "GL_STENCIL_BITS": 0,
 "GL_SHADING_LANGUAGE_VERSION": "OpenGL ES GLSL ES 1.00",
 "GL_MAX_VERTEX_ATTRIBS": 16,
 "GL_MAX_VERTEX_UNIFORM_VECTORS": 128,
 "GL_MAX_VARYING_VECTORS": 12,
 "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS": 8,
 "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS": 0,
 "GL_MAX_FRAGMENT_UNIFORM_VECTORS": 1024,
 "GL_MAX_TEXTURE_IMAGE_UNITS": 8,
 "GL_MAX_RENDERBUFFER_SIZE": 4096,
 "video_xres": 320,
 "video_yres": 483,
 "video_bpp": 32,
 "video_desktop_xres": 800,
 "video_desktop_yres": 480,
 "video_desktop_bpp": 32,
 "video_desktop_freq": 0,
 "uname_sysname": "Linux",
 "uname_release": "2.6.35.7-I9100XWKJ1-CL647431",
 "uname_version": "#2 SMP PREEMPT Tue Oct 11 16:42:43 KST 2011",
 "uname_machine": "armv7l",
 "cpu_identifier": "unknown",
 "cpu_frequency": -1,
 "cpu_pagesize": 4096,
 "cpu_largepagesize": 0,
 "cpu_numprocs": 1,
 "numa_numnodes": 1,
 "numa_factor": 1,
 "numa_interleaved": false,
 "ram_total": 836,
 "ram_total_os": 836,
 "ram_free": 20,
 "timer_resolution": 1e-9
}
and then it dies because it can't find the rest of the data files. Need to make the hacks less disgusting, then I'll try uploading my changes, and then need to get it to load all the other data files to display the GUI screen, and see what else breaks.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#118 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 15 February 2012 - 02:53 AM

Very cool Posted Image I'm trying to get the android-ndk-r7-crystax-4 toolchain to work. Looking forward to your upload.

#119 Guest_afeder_*

Guest_afeder_*

  • Guests

Posted 15 February 2012 - 09:44 AM

I've made it to the linker stage with android-ndk-r7-crystax-4:

/home/afeder/android/toolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status
make[1]: *** [../../../binaries/system/pyrogenesis_dbg] Error 1
make[1]: Target `all' not remade because of errors.
make: *** [pyrogenesis] Error 2

Edited by afeder, 15 February 2012 - 09:45 AM.


#120 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 15 February 2012 - 01:30 PM

Posted Image

(Apologies for poor image quality - using a phone to take a photo of itself is seemingly not a good idea.)
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users