Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[arm] merge arm-camelot into trunk, thanks to mcgeagh for all his har…

…d working getting arm platform rolling

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@30281 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
commit 07e5742b33364530dcb27835d7d62eeb84b07c95 1 parent 7c8f29a
davilla authored
Showing with 6,393 additions and 195 deletions.
  1. +27 −12 Makefile.in
  2. +274 −0 README.armel
  3. +57 −1 configure.in
  4. +11 −1 guilib/FrameBufferObject.cpp
  5. +6 −1 guilib/FrameBufferObject.h
  6. +27 −0 guilib/GUIFontTTF.cpp
  7. +1 −4 guilib/GUIFontTTF.h
  8. +37 −1 guilib/GUIFontTTFGL.cpp
  9. +0 −82 guilib/GUIFontTTFGLES.cpp
  10. +93 −0 guilib/GUIShader.cpp
  11. +35 −21 guilib/{GUIFontTTFGLES.h → GUIShader.h}
  12. +205 −6 guilib/GUITextureGLES.cpp
  13. +7 −2 guilib/GUITextureGLES.h
  14. +2 −1  guilib/Makefile.in
  15. +304 −0 guilib/MatrixGLES.cpp
  16. +69 −0 guilib/MatrixGLES.h
  17. +11 −5 guilib/Shader.cpp
  18. +12 −6 guilib/TextureGL.cpp
  19. +33 −0 guilib/system.h
  20. +1 −0  language/English/strings.xml
  21. +28 −0 system/shaders/guishader_frag.glsl
  22. +18 −0 system/shaders/guishader_vert.glsl
  23. +19 −0 system/shaders/yuv2rgb_basic_gles.glsl
  24. +35 −0 system/shaders/yuv2rgb_bob_gles.glsl
  25. +18 −0 system/shaders/yuv2rgb_vertex_gles.glsl
  26. +173 −0 tools/Linux/FEH-ARM.py
  27. +6 −0 tools/TexturePacker/XBMCTex.cpp
  28. +41 −0 tools/arm/arm-scripts/create-pkgsfile.sh
  29. +54 −0 tools/arm/arm-scripts/create-xbmcfile.sh
  30. +18 −0 tools/arm/arm-scripts/gcc4.5-paths.txt
  31. +61 −0 tools/arm/arm-scripts/install-pkgs.sh
  32. +70 −0 tools/arm/arm-scripts/pkg-paths.txt
  33. +1 −1  xbmc/Application.cpp
  34. +14 −0 xbmc/FileSystem/File.cpp
  35. +3 −0  xbmc/FileSystem/File.h
  36. +4 −1 xbmc/GUISettings.cpp
  37. +2 −0  xbmc/Makefile.in
  38. +5 −5 xbmc/MathUtils.h
  39. +4 −2 xbmc/MusicInfoTagLoaderMP3.cpp
  40. +2 −1  xbmc/RenderSystem.h
  41. +543 −0 xbmc/RenderSystemGLES.cpp
  42. +90 −0 xbmc/RenderSystemGLES.h
  43. +71 −1 xbmc/SlideShowPicture.cpp
  44. +7 −4 xbmc/Util.cpp
  45. +2 −1  xbmc/WinSystem.h
  46. +450 −0 xbmc/WinSystemEGL.cpp
  47. +77 −0 xbmc/WinSystemEGL.h
  48. +5 −0 xbmc/WindowingFactory.h
  49. +6 −0 xbmc/addons/AddonManager.cpp
  50. +1 −1  xbmc/cores/DllLoader/DllLoader.h
  51. +1 −1  xbmc/cores/DllLoader/ldt_keeper.c
  52. +1,581 −0 xbmc/cores/VideoRenderers/LinuxRendererGLES.cpp
  53. +241 −0 xbmc/cores/VideoRenderers/LinuxRendererGLES.h
  54. +1 −0  xbmc/cores/VideoRenderers/Makefile.in
  55. +2 −2 xbmc/cores/VideoRenderers/OverlayRenderer.cpp
  56. +124 −2 xbmc/cores/VideoRenderers/OverlayRendererGL.cpp
  57. +3 −1 xbmc/cores/VideoRenderers/OverlayRendererGL.h
  58. +4 −0 xbmc/cores/VideoRenderers/RenderManager.cpp
  59. +4 −0 xbmc/cores/VideoRenderers/RenderManager.h
  60. +6 −1 xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.cpp
  61. +1 −1  xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.h
  62. +39 −5 xbmc/cores/VideoRenderers/VideoShaders/YUV2RGBShader.cpp
  63. +35 −1 xbmc/cores/VideoRenderers/VideoShaders/YUV2RGBShader.h
  64. +11 −0 xbmc/cores/dvdplayer/Codecs/Makefile.in
  65. +12 −0 xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
  66. +1,089 −0 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp
  67. +114 −0 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecOpenMax.h
  68. +1 −0  xbmc/cores/dvdplayer/DVDCodecs/Video/Makefile.in
  69. +1 −1  xbmc/karaoke/karaokelyricscdg.cpp
  70. +8 −0 xbmc/lib/libPython/XBPython.cpp
  71. +8 −2 xbmc/lib/libPython/XBPythonDllFuncs.S
  72. +5 −1 xbmc/lib/libPython/linux/Makefile.in
  73. +4 −0 xbmc/lib/libsquish/Makefile.in
  74. +1 −1  xbmc/linux/PlatformDefs.h
  75. +39 −1 xbmc/utils/Atomics.cpp
  76. +1 −1  xbmc/utils/Atomics.h
  77. +9 −9 xbmc/utils/LockFree.cpp
  78. +2 −2 xbmc/utils/LockFree.h
  79. +1 −1  xbmc/utils/fastmemcpy.h
  80. +5 −2 xbmc/utils/log.cpp
View
39 Makefile.in
@@ -65,7 +65,7 @@ DVDPCODECS_DIRS= \
xbmc/cores/dvdplayer/Codecs/libdvd \
xbmc/cores/dvdplayer/Codecs/libbdnav
ifneq (@USE_EXTERNAL_LIBASS@,1)
- DVDPCODECS_DIRS+=lib/libass/xbmc
+DVDPCODECS_DIRS+=lib/libass/xbmc
endif
PAPCODECS_DIRS= \
@@ -162,7 +162,9 @@ configure: configure.in
# skin textures
skins: tools/TexturePacker/TexturePacker force
+ifneq (arm, $(ARCH))
$(MAKE) -C $(CONFLUENCE_MEDIA)
+endif
$(MAKE) -C $(PM3HD_MEDIA)
guilib/guilib.a: force
@@ -305,6 +307,7 @@ exports:
dllloader: exports
$(MAKE) xbmc/cores/DllLoader/dllloader.a
visualizations: exports
+ifneq (arm, $(ARCH))
$(MAKE) -C xbmc/visualizations/OpenGLSpectrum
$(MAKE) -C xbmc/visualizations/WaveForm
$(MAKE) -C xbmc/visualizations/XBMCProjectM
@@ -316,8 +319,11 @@ ifeq ($(or $(findstring powerpc-linux,$(ARCH)),$(findstring powerpc64-linux,$(AR
$(MAKE) -C xbmc/visualizations/Goom
endif
endif
+endif
screensavers: exports
+ifneq (arm, $(ARCH))
$(MAKE) -C xbmc/screensavers/rsxs-0.9/xbmc
+endif
libpython: dllloader
$(MAKE) -C xbmc/lib/libPython
$(MAKE) -C xbmc/lib/libPython/xbmcmodule
@@ -354,11 +360,11 @@ endif
$(MAKE) -C xbmc/cores/paplayer/SIDCodec
ifeq (@USE_ASAP_CODEC@,1)
ifneq ($(findstring osx,$(ARCH)), osx)
- $(MAKE) -C xbmc/cores/paplayer/asap asap-xbmc
+ $(MAKE) -C xbmc/cores/paplayer/asap asap-xbmc
endif
endif
$(MAKE) -C xbmc/cores/paplayer/YMCodec/StSoundLibrary
-ifeq ($(or $(findstring powerpc,$(ARCH)),$(findstring x86_64-linux,$(ARCH))),)
+ifeq ($(or $(findstring powerpc,$(ARCH)),$(findstring x86_64-linux,$(ARCH)),(arm, $(ARCH))),)
$(MAKE) -C xbmc/cores/paplayer/SPCCodec/SNES/SNESAPU
endif
imagelib: dllloader
@@ -418,7 +424,6 @@ OBJSXBMC= \
xbmc/FileSystem/MusicDatabaseDirectory/musicdatabasedirectory.a \
xbmc/FileSystem/VideoDatabaseDirectory/videodatabasedirectory.a \
xbmc/karaoke/karaoke.a \
- xbmc/lib/libhts/libhts.a \
xbmc/lib/libPython/xbmcmodule/xbmcmodule.a \
xbmc/lib/libRTMP/librtmp.a \
xbmc/lib/libscrobbler/scrobbler.a \
@@ -432,6 +437,7 @@ OBJSXBMC= \
xbmc/lib/sqLite/sqllite.a \
xbmc/lib/libsquish/libsquish-@ARCH@.a \
xbmc/lib/libapetag/.libs/libapetag.a \
+ lib/xbmc-dll-symbols/dll-symbols.a \
xbmc/settings/settings.a
ifeq (@HAVE_XBMC_NONFREE@,1)
@@ -440,13 +446,11 @@ OBJSXBMC+= \
xbmc/lib/UnrarXLib/UnrarXLib.a
endif
-DYNOBJSXBMC= \
- xbmc/lib/cmyth/libcmyth/libcmyth.a \
- xbmc/lib/cmyth/librefmem/librefmem.a \
- xbmc/linux/linux.a \
- xbmc/utils/utils.a \
- xbmc/cores/DllLoader/exports/util/exports_utils.a \
- xbmc/cores/DllLoader/exports/exports.a
+ifneq (arm, $(ARCH))
+# Can't include libhts for arm due to GPLv3
+OBJSXBMC+= \
+ xbmc/lib/libhts/libhts.a
+endif
# platform dependend objects
ifeq ($(findstring osx,$(ARCH)), osx)
@@ -460,7 +464,18 @@ OBJSXBMC += \
xbmc/posix/posix.a
endif
-OBJSXBMC += lib/xbmc-dll-symbols/dll-symbols.a
+DYNOBJSXBMC= \
+ xbmc/lib/cmyth/libcmyth/libcmyth.a \
+ xbmc/lib/cmyth/librefmem/librefmem.a \
+ xbmc/linux/linux.a \
+ xbmc/utils/utils.a \
+ xbmc/cores/DllLoader/exports/util/exports_utils.a \
+ xbmc/cores/DllLoader/exports/exports.a
+
+ifeq (arm, $(ARCH))
+# Force external python2.5 for now!
+LIBS +=-lpython2.5
+#endif
xbmc.bin: $(OBJSXBMC) $(DYNOBJSXBMC)
ifeq ($(findstring osx,$(ARCH)), osx)
View
274 README.armel
@@ -0,0 +1,274 @@
+TOC
+1. Introduction
+2. Using Scratchbox
+ 2.1 Automatic Installation
+ 2.2 Manual Installation
+ 2.3 Installation Continued for both Automatic and Manual Methods
+ 2.4 Setup Scratchbox
+3. Getting the source code
+4. Installing the required ARMEL packages
+5. Obtaining the SGX files
+6. How to compile
+ 6.1 Configure & Make
+ 6.2 Install
+7. How to run
+ 7.1 Obtaining the Packages
+ 7.2 Installing the Files
+ 7.3 Running XBMC
+8. Troubleshooting
+
+
+-----------------------------------------------------------------------------
+1. Introduction
+-----------------------------------------------------------------------------
+
+This is a port of XBMC for use on ARM Architecture.
+As this is not an official version of XBMC, in-depth testing on various setups has not been done. USE WITH CAUTION!
+For the purpose of this port, the following Hardware and Software was used.
+Software: Scratchbox (cross-compiler) on a Linux (Ubuntu) machine.
+Hardware: BeagleBoard (ARM Cortex-A8 with IMG POWERVR SGX).
+The source code is based on XBMC for Linux - version 9.11 (Camelot).
+
+All lines that are prefixed with the '$' character are commands that need to be typed into a standard linux terminal
+All lines that are prefixed with the '>' character are commands that need to be typed into scratchbox
+All lines that are prefixed with the '#' character are commands that need to be typed into a terminal on the beagleboard
+
+
+-----------------------------------------------------------------------------
+2. Using Scratchbox
+-----------------------------------------------------------------------------
+
+First, you need scratch box, along with some other packages.
+The easiest way is to do the following automatic installation.
+If you dont succeed, or want to do it manually, follow the next step instead.
+
+ -----------------------------------------------------------------------------
+ 2.1 Automatic Installation:
+ -----------------------------------------------------------------------------
+
+ $ sudo gedit /etc/apt/sources.list
+
+ Add this to the end of the file, then save and exit gedit:
+ deb http://scratchbox.org/debian stable main
+ deb http://scratchbox.org/debian legacy main
+
+ Now enter the following command:
+ $ sudo apt-get install scratchbox-core scratchbox-libs scratchbox-devkit-cputransp scratchbox-devkit-git scratchbox-devkit-mtd scratchbox-devkit-perl scratchbox-devkit-doctools scratchbox-toolchain-arm-linux-cs2007q3-51sb3 scratchbox-toolchain-host-gcc scratchbox-devkit-debian
+
+ -----------------------------------------------------------------------------
+ 2.2 Manual Installation:
+ -----------------------------------------------------------------------------
+
+ Go to the following website:
+ http://www.scratchbox.org/download/files/sbox-releases/stable/tarball/
+ and download the following files (Unless specified, choose latest version):
+ - core
+ - libs
+ - cputransp
+ - doctools
+ - git
+ - mtd
+ - perl
+ - toolchain (cs2007q3-51sb3)
+ - host-gcc
+ - debian
+
+ To install
+ $ cd /
+ $ sudo tar xvf /<location of files>/scratchbox-core.tar.gz
+
+ Repeat for all the downloaded files.
+
+ -----------------------------------------------------------------------------
+ 2.3 Installation Continued for both Automatic and Manual Methods:
+ -----------------------------------------------------------------------------
+
+ Now, a few changes needs to me made in order for it to work correctly:
+ $ sudo gedit /etc/sysctl.conf
+
+ Change/Add these variables:
+ vm.mmap_min_addr = 4096
+ vm.vdso_enabled = 0
+ Save and Close.
+
+ Add yourself to scratchbox:
+ $ sb-adduser <username>
+
+ Make sure it worked by doing the following command, and see if sbox is listed.
+ $ groups
+
+ If it isnt listed, restart and try again. If it still isnt listed, then do the following:
+ $ usermod -a -G sbox <username>
+
+ It should now list (possibly after another logout)
+ Now you have access to scratchbox.
+
+ -----------------------------------------------------------------------------
+ 2.4 Setup Scratchbox:
+ -----------------------------------------------------------------------------
+
+ Before setting up your target, you need a rootstrap. Obtain the latest rootstrap from:
+ http://linux.onarm.com/download/images/generic-X/
+ You want to download the file 'beagleboard-<date>-rootstrap.tar.gz'.
+
+ Do this every time you want to access scratchbox:
+ $ /scratchbox/login
+
+ Time to setup your target:
+ > sb-menu
+
+ A GUI will appear for the setup procedure.
+ - Choose Setup
+ - Create a NEW target, give it any name
+ - Select the compiler you downloaded (arm-linux-cs2007q3-51sb3)
+ - Select all development kits listed by highlighting each one and pressing enter, then Done and enter
+ - Select CPU transparency (qemu-arm-cvs-m)
+ - Yes to rootstrap. Locate the previously downloaded rootstrap to install.
+ - Yes to install files
+ - Only select DEVKIT and ETC. Remove all other files in list, then continue
+ - And finally Yes to selecting target.
+
+ Now scratchbox is setup
+
+
+-----------------------------------------------------------------------------
+3. Getting the source code
+-----------------------------------------------------------------------------
+
+ $ sudo apt-get install subversion
+ $ cd /scratchbox/users/<username>/home/<username>/
+ $ svn checkout https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/xbmc_on_arm
+
+
+-----------------------------------------------------------------------------
+4. Installing the required ARMEL packages
+-----------------------------------------------------------------------------
+
+There is a simple shell script that downloads a list of packages that are required and installs them into scratchbox.
+
+ > cd tools/arm/arm-scripts/
+ > ./install-pkgs.sh
+
+Please check the output files for any possible errors that may have occured.
+
+Note. You will need the headers and shared object files for EGL and GLESv2 to continue.
+
+
+-----------------------------------------------------------------------------
+5. Obtaining the SGX files
+-----------------------------------------------------------------------------
+
+In order to continue, you will need the SGX SDK from TI's website.
+Once you have installed said SDK on a standard Linux machine, copy the neccessary .h and .so files to the appropriate directories in scratchbox:
+e.g /scratchbox/users/<username>/targets/<target_name>/usr/include/EGL/egl.h
+These files will also need to be transferred over to the board eventually.
+NOTE: XBMC has only been tested with the following versions of the OMAP35x Graphics SDK:
+3.00.00.05, 3.00.00.06, 3.00.00.08, 3.00.00.09
+
+
+-----------------------------------------------------------------------------
+6. How to compile
+-----------------------------------------------------------------------------
+
+To create the XBMC executable manually perform these following steps:
+
+ -----------------------------------------------------------------------------
+ 6.1 Configure & Make:
+ -----------------------------------------------------------------------------
+
+ $ ./bootstrap
+ > ./configure --enable-gles
+
+ This will configure XBMC inside scratchbox ready for compilation on ARM.
+ Because the default is to build for OpenGL, we require the --enable-gles flag to be set for OpenGL ES 2.0.
+ (Note: No OpenGL ES 1.x available)
+ Now, build with the following:
+
+ > make
+
+ -----------------------------------------------------------------------------
+ 6.2 Install:
+ -----------------------------------------------------------------------------
+
+ There is no need to do 'make install' as we dont want it installed into scratchbox.
+ There is also the slight problem of the fact that scratchbox's 'find' command is outdated and wont execute xbmc's 'make install' correctly.
+ Instead, use the provided shell script:
+ > cd /tools/arm/arm-scripts/
+ > ./create-xbmcfile.sh
+
+ This will create a tar file tools/arm/arm-scripts/xbmc.tar.bz2 containing the xbmc files, ready for you to transfer to the board.
+
+
+-----------------------------------------------------------------------------
+7. How to run
+-----------------------------------------------------------------------------
+
+It is assumed you have a beagleboard with all the neccessary hardware installed.
+(e.g keyboard, mouse, and ethernet adapter)
+It is also assumed that you have it setup with either Angstrom or Ubuntu.
+
+ -----------------------------------------------------------------------------
+ 7.1 Obtaining the Packages:
+ -----------------------------------------------------------------------------
+
+ For Ubuntu: See README.linux for list of packages to install.
+ The known packages not to work are: libfaac-dev (use libfaad-dev instead)
+ If planning on not extracting the pkgs file, a few additional packages are required to be installed.
+ These are python and liblzo2
+
+ For Angstrom:
+ # opkg update
+ # opkg install subversion make g++ gcc gawk pmount libtool automake gperf unzip bison libsdl-1.2-dev libsdl-image-1.2-dev libsdl-gfx-dev libsdl-mixer-1.2-dev libfribidi-dev liblzo-dev libfreetype-dev libsqlite3-dev libasound2 python-sqlite3 libcurl4 xineramaproto-dev libxinerama-dev libxrandr-dev libxrender-dev libmad-dev libogg-dev libvorbis-dev libmysqlclient-dev libpcre-dev libdbus-glib-1-dev hal-dev libjasper-dev libfontconfig-dev boost-dev libfaac-dev libxt-dev libxmu-dev libpng-dev libjpeg-dev libsamplerate0-dev
+
+ Unfortunately this will only install the packages that are available through opkg. There will be further packages that need to be installed.
+ Either use the method mentioned below, or selectively find and install packages, mentioned at the bottom of this README.
+
+ Alternatively, do the following:
+ First make sure you have done section 4. then do the following:
+ > cd xbmc_on_arm/arm-scripts/
+ > ./create-pkgsfile.sh
+
+ This will create a tar file xbmc_on_arm/arm-scripts/pkgs.tar.bz2 containing the packages, ready for you to transfer to the board.
+
+ -----------------------------------------------------------------------------
+ 7.2 Installing the Files:
+ -----------------------------------------------------------------------------
+
+ Transfer the file(s), armel-pkgs.tar.bz2 (if using alternative method mentioned above) and xbmc.tar.bz2 to the beagleboard.
+ Do the following to extract them:
+ # tar xjf armel-pkgs.tar.bz2 -C /
+ # tar xjf xbmc.tar.bz2 -C /usr/
+
+ After this initial setup, during development, you should only need to replace /usr/share/xbmc/xbmc.bin with the newly created binary.
+
+ -----------------------------------------------------------------------------
+ 7.3 Running XBMC:
+ -----------------------------------------------------------------------------
+
+ Now, run XBMC by executing the binary:
+ # /usr/share/xbmc/xbmc.bin
+
+ Run the binary and not the script as the script will fail.
+
+
+-----------------------------------------------------------------------------
+8. Troubleshooting
+-----------------------------------------------------------------------------
+
+If it fails to run correctly, there are a few things to try out.
+First, is there any helpful output on the terminal?
+Check the log file, usually located ~/.xbmc/temp/xbmc.log
+It may have failed because of a missing package.
+If so, you will need to download the appropriate armel package from packages.debian.org,
+Extract the files with the command: dpkg-deb -x packagename.deb /path/to/extract/to
+Then tarball the extracted files: tar cjf pkg.tar.bz2 /path/to/extracted/files
+Then transfer them to the board, and extract: tar xjf pkg.tar.bz2
+This is because the .deb files cannot be extracted in Angstrom.
+
+If this is not the case, try various different parameters for xbmc.bin such as:
+xbmc.bin --standalone
+xbmc.bin -p
+xbmc.bin -fs
+Or build with debug for a more in-depth xbmc.log file by ommitting the line --disable-debug on configure.
+
+Feel free to contact me on mcgeagh@xbmc.org
View
58 configure.in
@@ -42,6 +42,8 @@ crystalhd_not_found="== Could not find libldil. CrystalHD support disabled. =="
crystalhd_disabled="== CrystalHD support manually disabled. =="
vdadecoder_enabled="== VDADecoder support enabled. =="
vdadecoder_disabled="== VDADecoder support manually disabled. =="
+openmax_disabled="== OpenMax support manually disabled. =="
+openmax_not_found="== Could not find libnvomx. OpenMax support disabled. =="
libass_using_internal="== External Libass not found, using internal. =="
ssh_not_found="== Could not find libssh. SSH FTP VFS support disabled. =="
@@ -87,6 +89,10 @@ case $host in
ARCH="powerpc64-linux"
AC_SUBST(ARCH_DEFINES, "-D_POWERPC64")
;;
+ arm*-*-linux-gnu*)
+ ARCH="arm"
+ AC_SUBST(ARCH_DEFINES, "-D_ARMEL")
+ ;;
*)
AC_MSG_ERROR(unsupported host ($host))
esac
@@ -146,6 +152,18 @@ AC_ARG_ENABLE([vdadecoder],
[use_vdadecoder=$enableval],
[use_vdadecoder=auto])
+AC_ARG_ENABLE([openmax],
+ [AS_HELP_STRING([--enable-openmax],
+ [enable OpenMax decoding (default is yes)])],
+ [use_openmax=$enableval],
+ [use_openmax=yes])
+
+AC_ARG_ENABLE([tegra],
+ [AS_HELP_STRING([--enable-tegra],
+ [enable Tegra2 arm (default is no)])],
+ [use_tegra=$enableval],
+ [use_tegra=no])
+
AC_ARG_ENABLE([profiling],
[AS_HELP_STRING([--enable-profiling],
[enable gprof profiling (default is no)])],
@@ -316,6 +334,17 @@ if test "$host_vendor" = "apple" ; then
LDFLAGS="$LDFLAGS -L/opt/local/lib"
LDFLAGS="$LDFLAGS -L/opt/local/lib/mysql5/mysql"
LDFLAGS="$LDFLAGS -L/opt/local/lib/samba3"
+elif expr "X$host_cpu" : 'Xarm.*' > /dev/null; then
+# Compile for ARMv7a architecture, CortexA8 cpu and NEON coprocessor
+ CFLAGS="$CFLAGS -mtune=cortex-a8 -mfloat-abi=softfp -mno-apcs-stack-check"
+ CXXFLAGS="$CXXFLAGS -mtune=cortex-a8 -mfloat-abi=softfp -mno-apcs-stack-check"
+ if test "x$use_tegra" = "xyes"; then
+ CFLAGS+=" -Wa,-march=armv6 -mthumb-interwork"
+ CXXFLAGS+=" -Wa,-march=armv6 -mthumb-interwork"
+ else
+ CFLAGS+=" -Wa,-march=armv7a -mcpu=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad"
+ CXXFLAGS+=" -Wa,-march=armv7a -mcpu=cortex-a8 -mfpu=neon -mvectorize-with-neon-quad"
+ fi
fi
# Add top source directory for all builds so we can use config.h
@@ -795,6 +824,23 @@ else
AC_MSG_NOTICE($vdadecoder_disabled)
fi
+# OpenMax
+if test "$host_vendor" = "apple" ; then
+ use_openmax="no"
+ AC_MSG_NOTICE($openmax_disabled)
+else
+ if test "x$use_openmax" = "xyes"; then
+ AC_CHECK_HEADER([OpenMAX/il/OMX_Types.h],
+ AC_DEFINE([HAVE_LIBOPENMAX], [1], [Define to 1 if you have the 'OpenMax' library.]),
+ use_openmax=no;AC_MSG_RESULT($openmax_not_found))
+ if test "x$use_openmax" = "xyes"; then
+ INCLUDES="$INCLUDES -I/usr/include/OpenMAX/il"
+ fi
+ else
+ AC_MSG_NOTICE($openmax_disabled)
+ fi
+fi
+
# platform specific bin utilities
if test "$host_vendor" != "apple" ; then
AC_CHECK_PROG(HAVE_GAWK,gawk,"yes","no",)
@@ -1405,7 +1451,15 @@ XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/ffmpeg], [
sed -i "" -e "s#libavfilter_VERSION_MAJOR=0#libavfilter_VERSION_MAJOR=0.4.0#" config.mak
else
+ if expr "X$host_cpu" : 'Xarm.*' > /dev/null; then
+ FFMPEG_EXTRACFLAGS="-mfloat-abi=softfp"
+ if test "x$use_tegra" != "xyes"; then
+ FFMPEG_EXTRACFLAGS+=" -mfpu=neon"
+ fi
+ fi
+
./configure \
+ `expr "X$host_cpu" : 'Xarm.*' > /dev/null && echo --arch=arm --cpu=cortex-a8` \
--disable-static \
`if test "$use_debug" = "no"; then echo --disable-debug; fi` \
`if test "$cross_compiling" = "yes"; then echo --enable-cross-compile; fi` \
@@ -1432,7 +1486,7 @@ XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/ffmpeg], [
--enable-libfaad \
--enable-protocol=http \
--enable-pthreads \
- `if test "$host_cpu" = "powerpc" || test "$host_cpu" = "powerpc64"; then echo --enable-pic; fi` \
+ `case $host_cpu in powerpc*|arm*) echo --enable-pic ;; esac` \
--cc="$CC"
fi
], [$USE_EXTERNAL_FFMPEG])
@@ -1642,6 +1696,7 @@ XB_CONFIG_MODULE([xbmc/visualizations/Goom/goom2k4-0],[
], [$BUILD_GOOM])
XB_CONFIG_MODULE([xbmc/screensavers/rsxs-0.9/], [
+if expr "X$host_cpu" : 'Xarm.*' > /dev/null; then :; else
if test "$host_vendor" = "apple" ; then
./configure \
CFLAGS="-fPIC -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4" \
@@ -1678,6 +1733,7 @@ XB_CONFIG_MODULE([xbmc/screensavers/rsxs-0.9/], [
--disable-lattice \
--disable-skyrocket
fi
+fi
], [0])
XB_CONFIG_MODULE([xbmc/cores/dvdplayer/Codecs/libbdnav/], [
View
12 guilib/FrameBufferObject.cpp
@@ -21,12 +21,22 @@
#include "system.h"
-#ifdef HAS_GL
+#if defined(HAS_GL) || HAS_GLES == 2
#include "../xbmc/Settings.h"
#include "WindowingFactory.h"
#include "FrameBufferObject.h"
#include "utils/log.h"
+#if HAS_GLES == 2
+// For OpenGL ES2.0, FBO are not extensions but part of the API.
+#define glGenFramebuffersEXT glGenFramebuffers
+#define glDeleteFramebuffersEXT glDeleteFramebuffers
+#define glFramebufferTexture2DEXT glFramebufferTexture2D
+#define glCheckFramebufferStatusEXT glCheckFramebufferStatus
+#define GL_COLOR_ATTACHMENT0_EXT GL_COLOR_ATTACHMENT0
+#define GL_FRAMEBUFFER_COMPLETE_EXT GL_FRAMEBUFFER_COMPLETE
+#endif
+
//////////////////////////////////////////////////////////////////////
// CFrameBufferObject
//////////////////////////////////////////////////////////////////////
View
7 guilib/FrameBufferObject.h
@@ -24,7 +24,7 @@
#include "system.h" // for HAS_GL
-#ifdef HAS_GL
+#if defined(HAS_GL) || HAS_GLES == 2
//
// CFrameBufferObject
@@ -45,6 +45,11 @@
// glBindTexture(GL_TEXTURE_2D, fbo->Texture());
//
+#if HAS_GLES == 2
+// For OpenGL ES2.0, FBO are not extensions but part of the API.
+#define glBindFramebufferEXT glBindFramebuffer
+#define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER
+#endif
class CFrameBufferObject
{
View
27 guilib/GUIFontTTF.cpp
@@ -673,6 +673,7 @@ void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *c
v[i].a = GET_A(color);
}
+#ifdef HAS_GL
v[0].u = tl;
v[0].v = tt;
v[0].x = x[0];
@@ -696,6 +697,32 @@ void CGUIFontTTFBase::RenderCharacter(float posX, float posY, const Character *c
v[3].x = x[3];
v[3].y = y4;
v[3].z = z4;
+#else
+ // GLES uses triangle strips, not quads, so have to rearrange the vertex order
+ v[0].u = tl;
+ v[0].v = tt;
+ v[0].x = x[0];
+ v[0].y = y1;
+ v[0].z = z1;
+
+ v[1].u = tl;
+ v[1].v = tb;
+ v[1].x = x[3];
+ v[1].y = y4;
+ v[1].z = z4;
+
+ v[2].u = tr;
+ v[2].v = tt;
+ v[2].x = x[1];
+ v[2].y = y2;
+ v[2].z = z2;
+
+ v[3].u = tr;
+ v[3].v = tb;
+ v[3].x = x[2];
+ v[3].y = y3;
+ v[3].z = z3;
+#endif
RenderInternal(v);
View
5 guilib/GUIFontTTF.h
@@ -159,12 +159,9 @@ class CGUIFontTTFBase
int m_referenceCount;
};
-#if defined(HAS_GL)
+#if defined(HAS_GL) || defined(HAS_GLES)
#include "GUIFontTTFGL.h"
#define CGUIFontTTF CGUIFontTTFGL
-#elif defined(HAS_GLES)
-#include "GUIFontTTFGLES.h"
-#define CGUIFontTTF CGUIFontTTFGLES
#elif defined(HAS_DX)
#include "GUIFontTTFDX.h"
#define CGUIFontTTF CGUIFontTTFDX
View
38 guilib/GUIFontTTFGL.cpp
@@ -27,6 +27,9 @@
#include "GraphicContext.h"
#include "gui3d.h"
#include "utils/log.h"
+#if HAS_GLES == 2
+#include "WindowingFactory.h"
+#endif
// stuff for freetype
#ifndef _LINUX
@@ -40,7 +43,7 @@
using namespace std;
-#ifdef HAS_GL
+#if defined(HAS_GL) || defined(HAS_GLES)
CGUIFontTTFGL::CGUIFontTTFGL(const CStdString& strFileName)
@@ -82,6 +85,8 @@ void CGUIFontTTFGL::Begin()
glEnable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, m_nTexture);
+
+#ifdef HAS_GL
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE);
glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_RGB,GL_REPLACE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_PRIMARY_COLOR);
@@ -93,6 +98,9 @@ void CGUIFontTTFGL::Begin()
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
VerifyGLState();
+#else
+ g_Windowing.EnableGUIShader(SM_FONTS);
+#endif
m_vertex_count = 0;
}
@@ -108,6 +116,7 @@ void CGUIFontTTFGL::End()
if (--m_nestedBeginCount > 0)
return;
+#ifdef HAS_GL
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
glColorPointer (4, GL_UNSIGNED_BYTE, sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, r));
@@ -118,6 +127,33 @@ void CGUIFontTTFGL::End()
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glDrawArrays(GL_QUADS, 0, m_vertex_count);
glPopClientAttrib();
+#else
+ GLint posLoc = g_Windowing.GUIShaderGetPos();
+ GLint colLoc = g_Windowing.GUIShaderGetCol();
+ GLint tex0Loc = g_Windowing.GUIShaderGetCoord0();
+
+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, 0, sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, x));
+ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, 0, sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, r));
+ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, 0, sizeof(SVertex), (char*)m_vertex + offsetof(SVertex, u));
+
+ glEnableVertexAttribArray(posLoc);
+ glEnableVertexAttribArray(colLoc);
+ glEnableVertexAttribArray(tex0Loc);
+
+ // GLES2 version
+ // As using triangle strips, have to do in sets of 4.
+ // This is due to limitations of ES, in that tex/col has to be same size as ver!
+ for (int i=0; i<m_vertex_count; i+=4)
@FernetMenta Collaborator

I am wondering if the limitation mentioned is still current. This loop takes more than a second to execute on the RPi. count was somewhat over 800. I removed the loop and changed to (not sure if this is right)
glDrawArrays(GL_TRIANGLE_STRIP, 0, m_count*4);

The sample runs fluent with this change.

Anyway we need to get rid of the loop.

@davilla Collaborator
davilla added a note

PR a replacement in so we can test on various GLES platforms, this original code was developed under tegra2, more than three years ago :)

@davilla Collaborator
davilla added a note

Ah, just looked at the current code and it's way different that what is here.

@theuni Owner
theuni added a note

Yep, this was fixed ages ago for exactly that reason :)

@FernetMenta Collaborator

sorry, I commented wrong section. It was still wrong in OverlayRenderer. pr sent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ {
+ glDrawArrays(GL_TRIANGLE_STRIP, i, 4);
+ }
+
+ glDisableVertexAttribArray(posLoc);
+ glDisableVertexAttribArray(colLoc);
+ glDisableVertexAttribArray(tex0Loc);
+
+ g_Windowing.DisableGUIShader();
+#endif
}
CBaseTexture* CGUIFontTTFGL::ReallocTexture(unsigned int& newHeight)
View
82 guilib/GUIFontTTFGLES.cpp
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2005-2008 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#include "system.h"
-#include "GUIFont.h"
-#include "GUIFontTTFGL.h"
-#include "GUIFontManager.h"
-#include "Texture.h"
-#include "GraphicContext.h"
-#include "gui3d.h"
-
-// stuff for freetype
-#ifndef _LINUX
-#include "ft2build.h"
-#else
-#include <ft2build.h>
-#endif
-#include FT_FREETYPE_H
-#include FT_GLYPH_H
-#include FT_OUTLINE_H
-
-using namespace std;
-
-#ifdef HAS_GLES
-
-CGUIFontTTFGLES::CGUIFontTTFGLES(const CStdString& strFileName)
-: CGUIFontTTFBase(strFileName)
-{
-
-}
-
-CGUIFontTTFGLES::~CGUIFontTTFGLES(void)
-{
-
-}
-
-void CGUIFontTTFGLES::Begin()
-{
- // TODO: GLES
-}
-
-void CGUIFontTTFGLES::End()
-{
- // TODO: GLES
-}
-
-CBaseTexture* CGUIFontTTFGLES::ReallocTexture(unsigned int& newHeight)
-{
- // TODO: GLES
- return NULL;
-}
-
-bool CGUIFontTTFGLES::CopyCharToTexture(FT_BitmapGlyph bitGlyph, Character* ch)
-{
- // TODO: GLES
- return false;
-}
-
-void CGUIFontTTFGLES::DeleteHardwareTexture()
-{
- // TODO: GLES
-}
-
-#endif
View
93 guilib/GUIShader.cpp
@@ -0,0 +1,93 @@
+/*
+* Copyright (C) 2005-2008 Team XBMC
+* http://www.xbmc.org
+*
+* This Program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2, or (at your option)
+* any later version.
+*
+* This Program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with XBMC; see the file COPYING. If not, write to
+* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+* http://www.gnu.org/copyleft/gpl.html
+*
+*/
+
+
+#include "system.h"
+
+#if HAS_GLES == 2
+
+#include "GUIShader.h"
+#include "MatrixGLES.h"
+#include "utils/log.h"
+
+CGUIShader::CGUIShader() : CGLSLShaderProgram("guishader_vert.glsl", "guishader_frag.glsl")
+{
+ // Initialise values
+ m_hTex0 = NULL;
+ m_hTex1 = NULL;
+ m_hMethod = NULL;
+ m_hProj = NULL;
+ m_hModel = NULL;
+ m_hPos = NULL;
+ m_hCol = NULL;
+ m_hCord0 = NULL;
+ m_hCord1 = NULL;
+
+ m_method = SM_DEFAULT;
+ m_proj = NULL;
+ m_model = NULL;
+}
+
+void CGUIShader::OnCompiledAndLinked()
+{
+ // This is called after CompileAndLink()
+
+ // Variables passed directly to the Fragment shader
+ m_hTex0 = glGetUniformLocation(ProgramHandle(), "m_samp0");
+ m_hTex1 = glGetUniformLocation(ProgramHandle(), "m_samp1");
+ m_hMethod = glGetUniformLocation(ProgramHandle(), "m_method");
+ // Variables passed directly to the Vertex shader
+ m_hProj = glGetUniformLocation(ProgramHandle(), "m_proj");
+ m_hModel = glGetUniformLocation(ProgramHandle(), "m_model");
+ m_hPos = glGetAttribLocation(ProgramHandle(), "m_attrpos");
+ m_hCol = glGetAttribLocation(ProgramHandle(), "m_attrcol");
+ m_hCord0 = glGetAttribLocation(ProgramHandle(), "m_attrcord0");
+ m_hCord1 = glGetAttribLocation(ProgramHandle(), "m_attrcord1");
+}
+
+bool CGUIShader::OnEnabled()
+{
+ // This is called after glUseProgram()
+
+ glUniform1i(m_hMethod, (int)m_method);
+ glUniformMatrix4fv(m_hProj, 1, GL_FALSE, g_matrices.GetMatrix(MM_PROJECTION));
+ glUniformMatrix4fv(m_hModel, 1, GL_FALSE, g_matrices.GetMatrix(MM_MODELVIEW));
+
+ if (m_method == SM_TEXTURE)
+ {
+ glUniform1i(m_hTex0, 0);
+ }
+ else if (m_method == SM_MULTI)
+ {
+ glUniform1i(m_hTex0, 0);
+ glUniform1i(m_hTex1, 1);
+ }
+
+ return true;
+}
+
+void CGUIShader::Free()
+{
+ // Do Cleanup here
+ CGLSLShaderProgram::Free();
+}
+
+#endif
View
56 guilib/GUIFontTTFGLES.h → guilib/GUIShader.h
@@ -19,38 +19,52 @@
*
*/
-/*!
-\file GUIFont.h
-\brief
-*/
+#ifndef GUI_SHADER_H
+#define GUI_SHADER_H
-#ifndef CGUILIB_GUIFONTTTF_GLES_H
-#define CGUILIB_GUIFONTTTF_GLES_H
#pragma once
+#include "Shader.h"
-#include "GUIFontTTF.h"
+using namespace Shaders;
+enum ESHADERMETHOD
+{
+ SM_DEFAULT = 0,
+ SM_TEXTURE = 1,
+ SM_MULTI = 2,
+ SM_FONTS = 3,
+};
-/*!
- \ingroup textures
- \brief
- */
-class CGUIFontTTFGLES : public CGUIFontTTFBase
+class CGUIShader : public CGLSLShaderProgram
{
public:
- CGUIFontTTFGLES(const CStdString& strFileName);
- virtual ~CGUIFontTTFGLES(void);
+ CGUIShader();
+ void OnCompiledAndLinked();
+ bool OnEnabled();
+ void Free();
- virtual void Begin();
- virtual void End();
+ void Setup(ESHADERMETHOD method) { m_method = method; }
+ GLint GetPosLoc() { return m_hPos; }
+ GLint GetColLoc() { return m_hCol; }
+ GLint GetCord0Loc() { return m_hCord0; }
+ GLint GetCord1Loc() { return m_hCord1; }
+
protected:
- virtual CBaseTexture* ReallocTexture(unsigned int& newHeight);
- virtual bool CopyCharToTexture(FT_BitmapGlyph bitGlyph, Character *ch);
- virtual void DeleteHardwareTexture();
- virtual void RenderInternal(SVertex* v) {}
+ GLint m_hTex0;
+ GLint m_hTex1;
+ GLint m_hMethod;
+ GLint m_hProj;
+ GLint m_hModel;
+ GLint m_hPos;
+ GLint m_hCol;
+ GLint m_hCord0;
+ GLint m_hCord1;
+ ESHADERMETHOD m_method;
+ GLfloat *m_proj;
+ GLfloat *m_model;
};
-#endif
+#endif // GUI_SHADER_H
View
211 guilib/GUITextureGLES.cpp
@@ -22,33 +22,232 @@
#include "system.h"
#include "GUITextureGLES.h"
#include "Texture.h"
+#include "utils/log.h"
+#include "WindowingFactory.h"
#if defined(HAS_GLES)
CGUITextureGLES::CGUITextureGLES(float posX, float posY, float width, float height, const CTextureInfo &texture)
: CGUITextureBase(posX, posY, width, height, texture)
{
- // TODO: OpenGLES
}
void CGUITextureGLES::Begin()
{
- // TODO: OpenGLES
+ CBaseTexture* texture = m_texture.m_textures[m_currentFrame];
+ glActiveTexture(GL_TEXTURE0);
+ texture->LoadToGPU();
+ if (m_diffuse.size())
+ m_diffuse.m_textures[0]->LoadToGPU();
+
+ glBindTexture(GL_TEXTURE_2D, texture->GetTextureObject());
+ glEnable(GL_TEXTURE_2D);
+
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND); // Turn Blending On
+
+ if (m_diffuse.size())
+ {
+ glActiveTexture(GL_TEXTURE1);
+ glBindTexture(GL_TEXTURE_2D, m_diffuse.m_textures[0]->GetTextureObject());
+ glEnable(GL_TEXTURE_2D);
+
+ g_Windowing.EnableGUIShader(SM_MULTI);
+ }
+ else
+ {
+ g_Windowing.EnableGUIShader(SM_TEXTURE);
+ }
+
+ GLint posLoc = g_Windowing.GUIShaderGetPos();
+ GLint colLoc = g_Windowing.GUIShaderGetCol();
+ GLint tex0Loc = g_Windowing.GUIShaderGetCoord0();
+
+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, 0, 0, m_vert);
+ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, 0, 0, m_col);
+ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, 0, 0, m_tex0);
+
+ glEnableVertexAttribArray(posLoc);
+ glEnableVertexAttribArray(colLoc);
+ glEnableVertexAttribArray(tex0Loc);
+
+ if (m_diffuse.size())
+ {
+ GLint tex1Loc = g_Windowing.GUIShaderGetCoord1();
+ glVertexAttribPointer(tex1Loc, 2, GL_FLOAT, 0, 0, m_tex1);
+ glEnableVertexAttribArray(tex1Loc);
+ }
}
void CGUITextureGLES::End()
{
- // TODO: OpenGLES
+ if (m_diffuse.size())
+ {
+ glDisable(GL_TEXTURE_2D);
+ glDisableVertexAttribArray(g_Windowing.GUIShaderGetCoord1());
+ glActiveTexture(GL_TEXTURE0);
+ }
+
+ glDisable(GL_TEXTURE_2D);
+ glDisableVertexAttribArray(g_Windowing.GUIShaderGetPos());
+ glDisableVertexAttribArray(g_Windowing.GUIShaderGetCol());
+ glDisableVertexAttribArray(g_Windowing.GUIShaderGetCoord0());
+
+ g_Windowing.DisableGUIShader();
}
void CGUITextureGLES::Draw(float *x, float *y, float *z, const CRect &texture, const CRect &diffuse, DWORD color, int orientation)
{
- // TODO: OpenGLES
+ GLubyte idx[4] = {0, 1, 3, 2}; //determines order of triangle strip
+
+ for (int i=0; i<4; i++)
+ {
+ // Setup vertex position values
+ m_vert[i][0] = x[i];
+ m_vert[i][1] = y[i];
+ m_vert[i][2] = z[i];
+
+ // Setup Colours
+ m_col[i][0] = (GLubyte)GET_R(color);
+ m_col[i][1] = (GLubyte)GET_G(color);
+ m_col[i][2] = (GLubyte)GET_B(color);
+ m_col[i][3] = (GLubyte)GET_A(color);
+ }
+
+ // Setup texture coordinates
+ //TopLeft
+ m_tex0[0][0] = texture.x1;
+ m_tex0[0][1] = texture.y1;
+ //TopRight
+ if (orientation & 4)
+ {
+ m_tex0[1][0] = texture.x1;
+ m_tex0[1][1] = texture.y2;
+ }
+ else
+ {
+ m_tex0[1][0] = texture.x2;
+ m_tex0[1][1] = texture.y1;
+ }
+ //BottomRight
+ m_tex0[2][0] = texture.x2;
+ m_tex0[2][1] = texture.y2;
+ //BottomLeft
+ if (orientation & 4)
+ {
+ m_tex0[3][0] = texture.x2;
+ m_tex0[3][1] = texture.y1;
+ }
+ else
+ {
+ m_tex0[3][0] = texture.x1;
+ m_tex0[3][1] = texture.y2;
+ }
+
+ if (m_diffuse.size())
+ {
+ //TopLeft
+ m_tex1[0][0] = diffuse.x1;
+ m_tex1[0][1] = diffuse.y1;
+ //TopRight
+ if (m_info.orientation & 4)
+ {
+ m_tex1[1][0] = diffuse.x1;
+ m_tex1[1][1] = diffuse.y2;
+ }
+ else
+ {
+ m_tex1[1][0] = diffuse.x2;
+ m_tex1[1][1] = diffuse.y1;
+ }
+ //BottomRight
+ m_tex1[2][0] = diffuse.x2;
+ m_tex1[2][1] = diffuse.y2;
+ //BottomLeft
+ if (m_info.orientation & 4)
+ {
+ m_tex1[3][0] = diffuse.x2;
+ m_tex1[3][1] = diffuse.y1;
+ }
+ else
+ {
+ m_tex1[3][0] = diffuse.x1;
+ m_tex1[3][1] = diffuse.y2;
+ }
+ }
+
+ glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, idx);
}
-void CGUITextureGLES::DrawQuad(const CRect &rect, DWORD color)
+void CGUITextureGLES::DrawQuad(const CRect &rect, color_t color, CBaseTexture *texture, const CRect *texCoords)
{
- // TODO: OpenGLES
+ if (texture)
+ {
+ glActiveTexture(GL_TEXTURE0);
+ texture->LoadToGPU();
+ glBindTexture(GL_TEXTURE_2D, texture->GetTextureObject());
+ glEnable(GL_TEXTURE_2D);
+ }
+ else
+ glDisable(GL_TEXTURE_2D);
+
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND); // Turn Blending On
+
+ VerifyGLState();
+
+ GLfloat col[4][4];
+ GLfloat ver[4][3];
+ GLfloat tex[4][2];
+ GLubyte idx[4] = {0, 1, 3, 2}; //determines order of triangle strip
+
+ g_Windowing.EnableGUIShader(SM_TEXTURE);
+
+ GLint posLoc = g_Windowing.GUIShaderGetPos();
+ GLint colLoc = g_Windowing.GUIShaderGetCol();
+ GLint tex0Loc = g_Windowing.GUIShaderGetCoord0();
+
+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, 0, 0, ver);
+ glVertexAttribPointer(colLoc, 4, GL_UNSIGNED_BYTE, 0, 0, col);
+ glVertexAttribPointer(tex0Loc, 2, GL_FLOAT, 0, 0, tex);
+
+ glEnableVertexAttribArray(posLoc);
+ glEnableVertexAttribArray(tex0Loc);
+ glEnableVertexAttribArray(colLoc);
+
+ for (int i=0; i<4; i++)
+ {
+ // Setup Colour Values
+ col[i][0] = (GLubyte)GET_R(color);
+ col[i][1] = (GLubyte)GET_G(color);
+ col[i][2] = (GLubyte)GET_B(color);
+ col[i][3] = (GLubyte)GET_A(color);
+ }
+
+ // Setup vertex position values
+ ver[0][3] = ver[1][3] = ver[2][3] = ver[3][3] = 0.0f;
+ ver[0][0] = ver[3][0] = rect.x1;
+ ver[0][1] = ver[1][1] = rect.y1;
+ ver[1][0] = ver[2][0] = rect.x2;
+ ver[2][1] = ver[3][1] = rect.y2;
+
+ // Setup texture coordinates
+ CRect coords = texCoords ? *texCoords : CRect(0.0f, 0.0f, 1.0f, 1.0f);
+ tex[0][0] = tex[3][0] = coords.x1;
+ tex[0][1] = tex[1][1] = coords.y1;
+ tex[1][0] = tex[2][0] = coords.x2;
+ tex[2][1] = tex[3][1] = coords.y2;
+
+ glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_BYTE, idx);
+
+ glDisableVertexAttribArray(posLoc);
+ glDisableVertexAttribArray(colLoc);
+ glDisableVertexAttribArray(tex0Loc);
+
+ g_Windowing.DisableGUIShader();
+
+ if (texture)
+ glDisable(GL_TEXTURE_2D);
}
#endif
View
9 guilib/GUITextureGLES.h
@@ -35,11 +35,16 @@ class CGUITextureGLES : public CGUITextureBase
{
public:
CGUITextureGLES(float posX, float posY, float width, float height, const CTextureInfo& texture);
- static void DrawQuad(const CRect &rect, DWORD color);
+ static void DrawQuad(const CRect &coords, color_t color, CBaseTexture *texture = NULL, const CRect *texCoords = NULL);
protected:
void Begin();
- void Draw(float *x, float *y, float *z, const CRect &texture, const CRect &diffuse, DWORD color, int orientation);
+ void Draw(float *x, float *y, float *z, const CRect &texture, const CRect &diffuse, color_t color, int orientation);
void End();
+
+ GLubyte m_col [4][4];
+ GLfloat m_vert[4][3];
+ GLfloat m_tex0[4][2];
+ GLfloat m_tex1[4][2];
};
#endif
View
3  guilib/Makefile.in
@@ -72,13 +72,14 @@ SRCS=AnimatedGif.cpp \
GUIColorManager.cpp \
FrameBufferObject.cpp \
Shader.cpp \
+ GUIShader.cpp \
+ MatrixGLES.cpp \
GUIListLabel.cpp \
GUIBorderedImage.cpp \
GUITextLayout.cpp \
GUIMultiSelectText.cpp \
GUIInfoTypes.cpp \
GUIFontTTFGL.cpp \
- GUIFontTTFGLES.cpp \
Texture.cpp \
TextureGL.cpp \
GUIControlProfiler.cpp \
View
304 guilib/MatrixGLES.cpp
@@ -0,0 +1,304 @@
+/*
+* Copyright (C) 2005-2008 Team XBMC
+* http://www.xbmc.org
+*
+* This Program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2, or (at your option)
+* any later version.
+*
+* This Program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with XBMC; see the file COPYING. If not, write to
+* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+* http://www.gnu.org/copyleft/gpl.html
+*
+*/
+
+
+#include "system.h"
+
+#if HAS_GLES == 2
+
+#include <cmath>
+#include "MatrixGLES.h"
+#include "utils/log.h"
+
+CMatrixGLES g_matrices;
+
+#define MODE_WITHIN_RANGE(m) ((m >= 0) && (m < (int)MM_MATRIXSIZE))
+
+CMatrixGLES::CMatrixGLES()
+{
+ for (int i=0; i<(int)MM_MATRIXSIZE; i++)
+ {
+ m_matrices[i].push_back(new GLfloat[16]);
+ MatrixMode((EMATRIXMODE)i);
+ LoadIdentity();
+ }
+ m_matrixMode = (EMATRIXMODE)-1;
+ m_pMatrix = NULL;
+}
+
+CMatrixGLES::~CMatrixGLES()
+{
+ for (int i=0; i<(int)MM_MATRIXSIZE; i++)
+ {
+ while (!m_matrices[i].empty())
+ {
+ m_matrices[i].pop_back();
+ }
+ }
+ m_matrixMode = (EMATRIXMODE)-1;
+ m_pMatrix = NULL;
+}
+
+GLfloat* CMatrixGLES::GetMatrix(EMATRIXMODE mode)
+{
+ if (MODE_WITHIN_RANGE(mode))
+ {
+ if (!m_matrices[mode].empty())
+ {
+ return m_matrices[mode].back();
+ }
+ }
+ return NULL;
+}
+
+void CMatrixGLES::MatrixMode(EMATRIXMODE mode)
+{
+ if (MODE_WITHIN_RANGE(mode))
+ {
+ m_matrixMode = mode;
+ m_pMatrix = m_matrices[mode].back();
+ }
+ else
+ {
+ m_matrixMode = (EMATRIXMODE)-1;
+ m_pMatrix = NULL;
+ }
+}
+
+void CMatrixGLES::PushMatrix()
+{
+ if (m_pMatrix && MODE_WITHIN_RANGE(m_matrixMode))
+ {
+ GLfloat *matrix = new GLfloat[16];
+ memcpy(matrix, m_pMatrix, sizeof(GLfloat)*16);
+ m_matrices[m_matrixMode].push_back(matrix);
+ }
+}
+
+void CMatrixGLES::PopMatrix()
+{
+ if (MODE_WITHIN_RANGE(m_matrixMode) && (m_matrices[m_matrixMode].size() > 1))
+ {
+ m_matrices[m_matrixMode].pop_back();
+ m_pMatrix = m_matrices[m_matrixMode].back();
+ }
+}
+
+void CMatrixGLES::LoadIdentity()
+{
+ if (m_pMatrix)
+ {
+ m_pMatrix[0] = 1.0f; m_pMatrix[4] = 0.0f; m_pMatrix[8] = 0.0f; m_pMatrix[12] = 0.0f;
+ m_pMatrix[1] = 0.0f; m_pMatrix[5] = 1.0f; m_pMatrix[9] = 0.0f; m_pMatrix[13] = 0.0f;
+ m_pMatrix[2] = 0.0f; m_pMatrix[6] = 0.0f; m_pMatrix[10] = 1.0f; m_pMatrix[14] = 0.0f;
+ m_pMatrix[3] = 0.0f; m_pMatrix[7] = 0.0f; m_pMatrix[11] = 0.0f; m_pMatrix[15] = 1.0f;
+ }
+}
+
+void CMatrixGLES::Ortho(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f)
+{
+ GLfloat u = 2.0f / (r - l);
+ GLfloat v = 2.0f / (t - b);
+ GLfloat w = -2.0f / (f - n);
+ GLfloat x = - (r + l) / (r - l);
+ GLfloat y = - (t + b) / (t - b);
+ GLfloat z = - (f + n) / (f - n);
+ GLfloat matrix[16] = { u, 0.0f, 0.0f, 0.0f,
+ 0.0f, v, 0.0f, 0.0f,
+ 0.0f, 0.0f, w, 0.0f,
+ x, y, z, 1.0f};
+ MultMatrixf(matrix);
+}
+
+void CMatrixGLES::Ortho2D(GLfloat l, GLfloat r, GLfloat b, GLfloat t)
+{
+ GLfloat u = 2.0f / (r - l);
+ GLfloat v = 2.0f / (t - b);
+ GLfloat x = - (r + l) / (r - l);
+ GLfloat y = - (t + b) / (t - b);
+ GLfloat matrix[16] = { u, 0.0f, 0.0f, 0.0f,
+ 0.0f, v, 0.0f, 0.0f,
+ 0.0f, 0.0f,-1.0f, 0.0f,
+ x, y, 0.0f, 1.0f};
+ MultMatrixf(matrix);
+}
+
+void CMatrixGLES::Frustum(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f)
+{
+ GLfloat u = (2.0f * n) / (r - l);
+ GLfloat v = (2.0f * n) / (t - b);
+ GLfloat w = (r + l) / (r - l);
+ GLfloat x = (t + b) / (t - b);
+ GLfloat y = - (f + n) / (f - n);
+ GLfloat z = - (2.0f * f * n) / (f - n);
+ GLfloat matrix[16] = { u, 0.0f, 0.0f, 0.0f,
+ 0.0f, v, 0.0f, 0.0f,
+ w, x, y,-1.0f,
+ 0.0f, 0.0f, z, 0.0f};
+ MultMatrixf(matrix);
+}
+
+void CMatrixGLES::Translatef(GLfloat x, GLfloat y, GLfloat z)
+{
+ GLfloat matrix[16] = {1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ x, y, z, 1.0f};
+ MultMatrixf(matrix);
+}
+
+void CMatrixGLES::Scalef(GLfloat x, GLfloat y, GLfloat z)
+{
+ GLfloat matrix[16] = { x, 0.0f, 0.0f, 0.0f,
+ 0.0f, y, 0.0f, 0.0f,
+ 0.0f, 0.0f, z, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f};
+ MultMatrixf(matrix);
+}
+
+void CMatrixGLES::Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
+{
+ GLfloat modulous = sqrt((x*x)+(y*y)+(z*z));
+ if (modulous != 0.0)
+ {
+ x /= modulous;
+ y /= modulous;
+ z /= modulous;
+ }
+ GLfloat cosine = cos(angle);
+ GLfloat sine = sin(angle);
+ GLfloat cos1 = 1 - cosine;
+ GLfloat a = (x*x*cos1) + cosine;
+ GLfloat b = (x*y*cos1) - (z*sine);
+ GLfloat c = (x*z*cos1) + (y*sine);
+ GLfloat d = (y*x*cos1) + (z*sine);
+ GLfloat e = (y*y*cos1) + cosine;
+ GLfloat f = (y*z*cos1) - (x*sine);
+ GLfloat g = (z*x*cos1) - (y*sine);
+ GLfloat h = (z*y*cos1) + (x*sine);
+ GLfloat i = (z*z*cos1) + cosine;
+ GLfloat matrix[16] = { a, d, g, 0.0f,
+ b, e, h, 0.0f,
+ c, f, i, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f};
+ MultMatrixf(matrix);
+}
+
+void CMatrixGLES::MultMatrixf(const GLfloat *matrix)
+{
+ if (m_pMatrix)
+ {
+ GLfloat a = (matrix[0] * m_pMatrix[0]) + (matrix[1] * m_pMatrix[4]) + (matrix[2] * m_pMatrix[8]) + (matrix[3] * m_pMatrix[12]);
+ GLfloat b = (matrix[0] * m_pMatrix[1]) + (matrix[1] * m_pMatrix[5]) + (matrix[2] * m_pMatrix[9]) + (matrix[3] * m_pMatrix[13]);
+ GLfloat c = (matrix[0] * m_pMatrix[2]) + (matrix[1] * m_pMatrix[6]) + (matrix[2] * m_pMatrix[10]) + (matrix[3] * m_pMatrix[14]);
+ GLfloat d = (matrix[0] * m_pMatrix[3]) + (matrix[1] * m_pMatrix[7]) + (matrix[2] * m_pMatrix[11]) + (matrix[3] * m_pMatrix[15]);
+ GLfloat e = (matrix[4] * m_pMatrix[0]) + (matrix[5] * m_pMatrix[4]) + (matrix[6] * m_pMatrix[8]) + (matrix[7] * m_pMatrix[12]);
+ GLfloat f = (matrix[4] * m_pMatrix[1]) + (matrix[5] * m_pMatrix[5]) + (matrix[6] * m_pMatrix[9]) + (matrix[7] * m_pMatrix[13]);
+ GLfloat g = (matrix[4] * m_pMatrix[2]) + (matrix[5] * m_pMatrix[6]) + (matrix[6] * m_pMatrix[10]) + (matrix[7] * m_pMatrix[14]);
+ GLfloat h = (matrix[4] * m_pMatrix[3]) + (matrix[5] * m_pMatrix[7]) + (matrix[6] * m_pMatrix[11]) + (matrix[7] * m_pMatrix[15]);
+ GLfloat i = (matrix[8] * m_pMatrix[0]) + (matrix[9] * m_pMatrix[4]) + (matrix[10] * m_pMatrix[8]) + (matrix[11] * m_pMatrix[12]);
+ GLfloat j = (matrix[8] * m_pMatrix[1]) + (matrix[9] * m_pMatrix[5]) + (matrix[10] * m_pMatrix[9]) + (matrix[11] * m_pMatrix[13]);
+ GLfloat k = (matrix[8] * m_pMatrix[2]) + (matrix[9] * m_pMatrix[6]) + (matrix[10] * m_pMatrix[10]) + (matrix[11] * m_pMatrix[14]);
+ GLfloat l = (matrix[8] * m_pMatrix[3]) + (matrix[9] * m_pMatrix[7]) + (matrix[10] * m_pMatrix[11]) + (matrix[11] * m_pMatrix[15]);
+ GLfloat m = (matrix[12] * m_pMatrix[0]) + (matrix[13] * m_pMatrix[4]) + (matrix[14] * m_pMatrix[8]) + (matrix[15] * m_pMatrix[12]);
+ GLfloat n = (matrix[12] * m_pMatrix[1]) + (matrix[13] * m_pMatrix[5]) + (matrix[14] * m_pMatrix[9]) + (matrix[15] * m_pMatrix[13]);
+ GLfloat o = (matrix[12] * m_pMatrix[2]) + (matrix[13] * m_pMatrix[6]) + (matrix[14] * m_pMatrix[10]) + (matrix[15] * m_pMatrix[14]);
+ GLfloat p = (matrix[12] * m_pMatrix[3]) + (matrix[13] * m_pMatrix[7]) + (matrix[14] * m_pMatrix[11]) + (matrix[15] * m_pMatrix[15]);
+ m_pMatrix[0] = a; m_pMatrix[4] = e; m_pMatrix[8] = i; m_pMatrix[12] = m;
+ m_pMatrix[1] = b; m_pMatrix[5] = f; m_pMatrix[9] = j; m_pMatrix[13] = n;
+ m_pMatrix[2] = c; m_pMatrix[6] = g; m_pMatrix[10] = k; m_pMatrix[14] = o;
+ m_pMatrix[3] = d; m_pMatrix[7] = h; m_pMatrix[11] = l; m_pMatrix[15] = p;
+ }
+}
+
+// gluLookAt implementation taken from Mesa3D
+void CMatrixGLES::LookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, GLfloat centerx, GLfloat centery, GLfloat centerz, GLfloat upx, GLfloat upy, GLfloat upz)
+{
+ GLfloat forward[3], side[3], up[3];
+ GLfloat m[4][4];
+
+ forward[0] = centerx - eyex;
+ forward[1] = centery - eyey;
+ forward[2] = centerz - eyez;
+
+ up[0] = upx;
+ up[1] = upy;
+ up[2] = upz;
+
+ GLfloat tmp = sqrt(forward[0]*forward[0] + forward[1]*forward[1] + forward[2]*forward[2]);
+ if (tmp != 0.0)
+ {
+ forward[0] /= tmp;
+ forward[1] /= tmp;
+ forward[2] /= tmp;
+ }
+
+ side[0] = forward[1]*up[2] - forward[2]*up[1];
+ side[1] = forward[2]*up[0] - forward[0]*up[2];
+ side[2] = forward[0]*up[1] - forward[1]*up[0];
+
+ tmp = sqrt(side[0]*side[0] + side[1]*side[1] + side[2]*side[2]);
+ if (tmp != 0.0)
+ {
+ side[0] /= tmp;
+ side[1] /= tmp;
+ side[2] /= tmp;
+ }
+
+ up[0] = side[1]*forward[2] - side[2]*forward[1];
+ up[1] = side[2]*forward[0] - side[0]*forward[2];
+ up[2] = side[0]*forward[1] - side[1]*forward[0];
+
+ m[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = 0.0f;
+ m[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = 0.0f;
+ m[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = 0.0f;
+ m[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;
+
+ m[0][0] = side[0];
+ m[1][0] = side[1];
+ m[2][0] = side[2];
+
+ m[0][1] = up[0];
+ m[1][1] = up[1];
+ m[2][1] = up[2];
+
+ m[0][2] = -forward[0];
+ m[1][2] = -forward[1];
+ m[2][2] = -forward[2];
+
+ MultMatrixf(&m[0][0]);
+ Translatef(-eyex, -eyey, -eyez);
+}
+
+void CMatrixGLES::PrintMatrix(void)
+{
+ for (int i=0; i<(int)MM_MATRIXSIZE; i++)
+ {
+ GLfloat *m = GetMatrix((EMATRIXMODE)i);
+ CLog::Log(LOGDEBUG, "MatrixGLES - Matrix:%d", i);
+ CLog::Log(LOGDEBUG, "%f %f %f %f", m[0], m[4], m[8], m[12]);
+ CLog::Log(LOGDEBUG, "%f %f %f %f", m[1], m[5], m[9], m[13]);
+ CLog::Log(LOGDEBUG, "%f %f %f %f", m[2], m[6], m[10], m[14]);
+ CLog::Log(LOGDEBUG, "%f %f %f %f", m[3], m[7], m[11], m[15]);
+ }
+}
+
+#endif
View
69 guilib/MatrixGLES.h
@@ -0,0 +1,69 @@
+/*
+* Copyright (C) 2005-2008 Team XBMC
+* http://www.xbmc.org
+*
+* This Program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2, or (at your option)
+* any later version.
+*
+* This Program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with XBMC; see the file COPYING. If not, write to
+* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+* http://www.gnu.org/copyleft/gpl.html
+*
+*/
+
+#ifndef MATRIX_GLES_H
+#define MATRIX_GLES_H
+
+#pragma once
+
+#include <vector>
+
+using namespace std;
+
+enum EMATRIXMODE
+{
+ MM_PROJECTION = 0,
+ MM_MODELVIEW,
+ MM_TEXTURE,
+ MM_MATRIXSIZE // Must be last! used for size of matrices
+};
+
+class CMatrixGLES
+{
+public:
+ CMatrixGLES();
+ ~CMatrixGLES();
+
+ GLfloat* GetMatrix(EMATRIXMODE mode);
+
+ void MatrixMode(EMATRIXMODE mode);
+ void PushMatrix();
+ void PopMatrix();
+ void LoadIdentity();
+ void Ortho(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
+ void Ortho2D(GLfloat l, GLfloat r, GLfloat b, GLfloat t);
+ void Frustum(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
+ void Translatef(GLfloat x, GLfloat y, GLfloat z);
+ void Scalef(GLfloat x, GLfloat y, GLfloat z);
+ void Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+ void MultMatrixf(const GLfloat *matrix);
+ void LookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, GLfloat centerx, GLfloat centery, GLfloat centerz, GLfloat upx, GLfloat upy, GLfloat upz);
+ void PrintMatrix(void);
+
+protected:
+ vector<GLfloat*> m_matrices[(int)MM_MATRIXSIZE];
+ GLfloat *m_pMatrix;
+ EMATRIXMODE m_matrixMode;
+};
+
+extern CMatrixGLES g_matrices;
+
+#endif // MATRIX_GLES_H
View
16 guilib/Shader.cpp
@@ -48,8 +48,12 @@ bool CShader::LoadSource(const string& filename, const string& prefix)
CLog::Log(LOGERROR, "CYUVShaderGLSL::CYUVShaderGLSL - failed to open file %s", filename.c_str());
return false;
}
-
+#ifdef _ARMEL
+ CLog::Log(LOGDEBUG, "Shader - Loading shader file %s", filename.c_str());
+ m_source.assign(file.ReadFile());
+#else
getline(file, m_source, '\0');
+#endif
m_source.insert(0, prefix);
return true;
}
@@ -81,7 +85,7 @@ bool CGLSLVertexShader::Compile()
if (params[0]!=GL_TRUE)
{
GLchar log[LOG_SIZE];
- CLog::Log(LOGERROR, "GL: Error compiling shader");
+ CLog::Log(LOGERROR, "GL: Error compiling vertex shader");
glGetShaderInfoLog(m_vertexShader, LOG_SIZE, NULL, log);
CLog::Log(LOGERROR, "%s", log);
m_lastLog = log;
@@ -90,7 +94,7 @@ bool CGLSLVertexShader::Compile()
else
{
GLchar log[LOG_SIZE];
- CLog::Log(LOGDEBUG, "GL: Shader compilation log:");
+ CLog::Log(LOGDEBUG, "GL: Vertex Shader compilation log:");
glGetShaderInfoLog(m_vertexShader, LOG_SIZE, NULL, log);
CLog::Log(LOGDEBUG, "%s", log);
m_lastLog = log;
@@ -190,7 +194,7 @@ bool CGLSLPixelShader::Compile()
if (params[0]!=GL_TRUE)
{
GLchar log[LOG_SIZE];
- CLog::Log(LOGERROR, "GL: Error compiling shader");
+ CLog::Log(LOGERROR, "GL: Error compiling pixel shader");
glGetShaderInfoLog(m_pixelShader, LOG_SIZE, NULL, log);
CLog::Log(LOGERROR, "%s", log);
m_lastLog = log;
@@ -199,7 +203,7 @@ bool CGLSLPixelShader::Compile()
else
{
GLchar log[LOG_SIZE];
- CLog::Log(LOGDEBUG, "GL: Shader compilation log:");
+ CLog::Log(LOGDEBUG, "GL: Pixel Shader compilation log:");
glGetShaderInfoLog(m_pixelShader, LOG_SIZE, NULL, log);
CLog::Log(LOGDEBUG, "%s", log);
m_lastLog = log;
@@ -311,6 +315,7 @@ bool CGLSLShaderProgram::CompileAndLink()
CLog::Log(LOGERROR, "GL: Error compiling vertex shader");
return false;
}
+ CLog::Log(LOGDEBUG, "GL: Vertex Shader compiled successfully");
// compile pixel shader
if (!m_pFP->Compile())
@@ -319,6 +324,7 @@ bool CGLSLShaderProgram::CompileAndLink()
CLog::Log(LOGERROR, "GL: Error compiling fragment shader");
return false;
}
+ CLog::Log(LOGDEBUG, "GL: Fragment Shader compiled successfully");
// create program object
if (!(m_shaderProgram = glCreateProgram()))
View
18 guilib/TextureGL.cpp
@@ -87,7 +87,6 @@ void CGLTexture::LoadToGPU()
CLog::Log(LOGERROR, "GL: Image width %d too big to fit into single texture unit, truncating to %u", m_textureWidth, maxSize);
#ifndef HAS_GLES
glPixelStorei(GL_UNPACK_ROW_LENGTH, m_textureWidth);
-#endif
m_textureWidth = maxSize;
}
@@ -107,11 +106,7 @@ void CGLTexture::LoadToGPU()
break;
case XB_FMT_A8R8G8B8:
default:
-#ifdef HAS_GL
format = GL_BGRA;
-#elif HAS_GLES
- format = GL_BGRA_EXT;
-#endif
break;
}
@@ -127,8 +122,19 @@ void CGLTexture::LoadToGPU()
m_textureWidth, m_textureHeight, 0, GetPitch() * GetRows(), m_pixels);
}
-#ifndef HAS_GLES
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+#else // GLES version
+ m_textureWidth = maxSize;
+ }
+
+#if HAS_GLES == 1
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, m_textureWidth, m_textureHeight, 0,
+ GL_BGRA_EXT, GL_UNSIGNED_BYTE, m_pixels);
+#elif HAS_GLES == 2
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_textureWidth, m_textureHeight, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, m_pixels);
+#endif
+
#endif
VerifyGLState();
View
33 guilib/system.h
@@ -196,6 +196,32 @@
#include "PlatformInclude.h"
#endif
+// ARM does not support certain features... disable them here!
+#ifdef _ARMEL
+#undef HAS_AVAHI
+#undef HAS_ZEROCONF
+#undef HAS_VISUALISATION
+#undef HAS_FILESYSTEM_HTSP
+#endif
+
+// EGL detected. Dont use GLX!
+#ifdef HAVE_LIBEGL
+#undef HAS_GLX
+#define HAS_EGL
+#endif
+
+// GLES2.0 detected. Dont use GL!
+#ifdef HAVE_LIBGLESV2
+#undef HAS_GL
+#define HAS_GLES 2
+#endif
+
+// GLES1.0 detected. Dont use GL!
+#ifdef HAVE_LIBGLES
+#undef HAS_GL
+#define HAS_GLES 1
+#endif
+
#ifdef HAS_GL
#ifdef _WIN32
#include "GL/glew.h"
@@ -212,9 +238,16 @@
#endif
#if HAS_GLES == 2
+#ifdef _ARMEL // PowerVR SGX Header
+// not sure about this one tg2 (arm) does not have gl2extimg.h
+//#include <GLES2/gl2extimg.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#else
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#endif
+#endif
#define SAFE_DELETE(p) { delete (p); (p)=NULL; }
#define SAFE_DELETE_ARRAY(p) { delete[] (p); (p)=NULL; }
View
1  language/English/strings.xml
@@ -1223,6 +1223,7 @@
<string id="13427">Allow hardware acceleration (DXVA2)</string>
<string id="13428">Allow hardware acceleration (CrystalHD)</string>
<string id="13429">Allow hardware acceleration (VDADecoder)</string>
+ <string id="13430">Allow hardware acceleration (OpenMax)</string>
<string id="13500">A/V sync method</string>
<string id="13501">Audio clock</string>
View
28 system/shaders/guishader_frag.glsl
@@ -0,0 +1,28 @@
+precision mediump float;
+uniform sampler2D m_samp0;
+uniform sampler2D m_samp1;
+varying vec4 m_cord0;
+varying vec4 m_cord1;
+varying vec4 m_colour;
+uniform int m_method;
+
+void main ()
+{
+ if (m_method == 3) /*SM_FONTS*/
+ {
+ gl_FragColor = m_colour;
+ gl_FragColor.a = texture2D(m_samp0, m_cord0.xy).a;
+ }
+ else if (m_method == 1) /*SM_TEXTURE*/
+ {
+ gl_FragColor.rgba = texture2D(m_samp0, m_cord0.xy).bgra;
+ }
+ else if (m_method == 2) /*SM_MULTI*/
+ {
+ gl_FragColor.rgba = (texture2D(m_samp0, m_cord0.xy) * texture2D(m_samp1, m_cord1.xy)).bgra;
+ }
+ else /*SM_DEFAULT*/
+ {
+ gl_FragColor = m_colour;
+ }
+}
View
18 system/shaders/guishader_vert.glsl
@@ -0,0 +1,18 @@
+attribute vec4 m_attrpos;
+attribute vec4 m_attrcol;
+attribute vec4 m_attrcord0;
+attribute vec4 m_attrcord1;
+varying vec4 m_cord0;
+varying vec4 m_cord1;
+varying vec4 m_colour;
+uniform mat4 m_proj;
+uniform mat4 m_model;
+
+void main ()
+{
+ mat4 mvp = m_proj * m_model;
+ gl_Position = mvp * m_attrpos;
+ m_colour = m_attrcol;
+ m_cord0 = m_attrcord0;
+ m_cord1 = m_attrcord1;
+}
View
19 system/shaders/yuv2rgb_basic_gles.glsl
@@ -0,0 +1,19 @@
+precision mediump float;
+uniform sampler2D m_sampY;
+uniform sampler2D m_sampU;
+uniform sampler2D m_sampV;
+varying vec2 m_cordY;
+varying vec2 m_cordU;
+varying vec2 m_cordV;
+uniform float m_alpha;
+uniform mat4 m_yuvmat;
+
+void main()
+{
+ vec4 yuv, rgb;
+ yuv.rgba = vec4(texture2D(m_sampY, m_cordY).r, texture2D(m_sampU, m_cordU).r, texture2D(m_sampV, m_cordV).r, 1.0);
+
+ rgb = m_yuvmat * yuv;
+ rgb.a = m_alpha;
+ gl_FragColor = rgb;
+}
View
35 system/shaders/yuv2rgb_bob_gles.glsl
@@ -0,0 +1,35 @@
+precision mediump float;
+uniform sampler2D m_sampY;
+uniform sampler2D m_sampU;
+uniform sampler2D m_sampV;
+varying vec2 m_cordY;
+varying vec2 m_cordU;
+varying vec2 m_cordV;
+uniform float m_alpha;
+uniform mat4 m_yuvmat;
+uniform float m_stepX;
+uniform float m_stepY;
+uniform int m_field;
+
+void main()
+{
+ vec4 yuv, rgb;
+
+ vec2 offsetY;
+ vec2 offsetU;
+ vec2 offsetV;
+ float temp1 = mod(m_cordY.y, 2*m_stepY);
+
+ offsetY = m_cordY;
+ offsetU = m_cordU;
+ offsetV = m_cordV;
+
+ offsetY.y -= (temp1 - m_stepY/2 + float(m_field)*m_stepY);
+ offsetU.y -= (temp1 - m_stepY/2 + float(m_field)*m_stepY)/2;
+ offsetV.y -= (temp1 - m_stepY/2 + float(m_field)*m_stepY)/2;
+
+ yuv.rgba = vec4(texture2D(m_sampY, offsetY).r, texture2D(m_sampU, offsetU).r, texture2D(m_sampV, offsetV).r, 1.0);
+ rgb = m_yuvmat * yuv;
+ rgb.a = m_alpha;
+ gl_FragColor = rgb;
+}
View
18 system/shaders/yuv2rgb_vertex_gles.glsl
@@ -0,0 +1,18 @@
+attribute vec4 m_attrpos;
+attribute vec2 m_attrcordY;
+attribute vec2 m_attrcordU;
+attribute vec2 m_attrcordV;
+varying vec2 m_cordY;
+varying vec2 m_cordU;
+varying vec2 m_cordV;
+uniform mat4 m_proj;
+uniform mat4 m_model;
+
+void main ()
+{
+ mat4 mvp = m_proj * m_model;
+ gl_Position = mvp * m_attrpos;
+ m_cordY = m_attrcordY;
+ m_cordU = m_attrcordU;
+ m_cordV = m_attrcordV;
+}
View
173 tools/Linux/FEH-ARM.py
@@ -0,0 +1,173 @@
+import os
+import sys
+import re
+
+AvailableOutputs = []
+Output = None
+
+try:
+ from qt import *
+ AvailableOutputs.append("--error-output=Qt")
+except:
+ pass
+try:
+ import pygtk
+ pygtk.require('2.0')
+ import gtk
+ AvailableOutputs.append("--error-output=GTK")
+except:
+ pass
+try:
+ import pygame
+ import datetime
+ AvailableOutputs.append("--error-output=SDL")
+except:
+ pass
+
+def error(errorLine):
+ if Output == "--error-output=Qt":
+ createQt(errorLine)
+ elif Output == "--error-output=GTK":
+ createGTK(errorLine)
+ elif Output == "--error-output=SDL":
+ createSDL(errorLine)
+ else:
+ print errorLine
+
+ exit(1)
+
+def createQt(errorLine):
+ app = QApplication(sys.argv)
+ QObject.connect(app, SIGNAL('lastWindowClosed()')
+ , app
+ , SLOT('quit()')
+ )
+
+ dialog = QDialog(None, "Error", 0, 0)
+ dialog.setCaption(dialog.tr("Error"))
+ layout=QVBoxLayout(dialog)
+ layout.setSpacing(6)
+ layout.setMargin(5)
+
+ label=QLabel(errorLine, dialog)
+
+ layout.addWidget(label)
+
+ bnExit=QPushButton("Quit", dialog, "add")
+ dialog.connect(bnExit, SIGNAL("clicked()"), qApp, SLOT("quit()"))
+
+ layout.addWidget(bnExit)
+
+ app.setMainWidget(dialog)
+ dialog.show()
+ app.exec_loop()
+
+def createGTK(errorLine):
+ window = gtk.Window(gtk.WINDOW_TOPLEVEL)
+ window.connect("destroy", lambda w: gtk.main_quit())
+
+ window.set_title("Error")
+ vbox = gtk.VBox(False, 5)
+ window.add(vbox)
+ window.set_border_width(5)
+
+ frame = gtk.Frame()
+ frame.set_shadow_type(gtk.SHADOW_NONE)
+ label = gtk.Label(errorLine)
+ frame.add(label)
+ vbox.pack_start(frame, False, False, 0)
+
+ button = gtk.Button("Quit")
+ button.connect_object("clicked", gtk.Widget.destroy, window)
+
+ vbox.pack_start(button, False, False, 0)
+
+ window.show_all ()
+
+ gtk.main()
+
+def createSDL(errorLine):
+ pygame.init()
+ pygame.font.init()
+ pygame.display.set_caption("Error")
+
+ size = width, height = 800, 600
+ speed = [2, 2]
+ black = 0, 0, 0
+
+ screen = pygame.display.set_mode(size)
+ font = pygame.font.Font(None, 32)
+
+ autoQuit = 10
+ start = datetime.datetime.now()
+ finish = datetime.datetime.now()
+ delta = finish - start
+ while delta.seconds < autoQuit:
+ for event in pygame.event.get():
+ if event.type == pygame.QUIT or event.type == pygame.KEYDOWN:
+ sys.exit()
+
+ screen.fill(black)
+
+ place = [200, 200]
+ for line in errorLine.split('\n'):
+ text = font.render(line, 1, (255,255,255) )
+ place[1] += font.size(line)[1]
+ screen.blit(text, text.get_rect().move(place))
+
+
+ quitline = "Press any button to continue ("
+ quitline += str(autoQuit - delta.seconds)
+ quitline += ")"
+ text = font.render(quitline, 1, (255,255,255) )
+ screen.blit(text, text.get_rect().move(200,400))
+
+ pygame.display.flip()
+
+ finish = datetime.datetime.now()
+ delta = finish - start
+
+def badDirectRendering():
+ out = os.popen("glxinfo | grep \"direct rendering\"", 'r')
+ line = out.read()
+ direct = "Yes" not in line
+ out.close()
+
+ return direct
+
+def badColorDepth():
+ out = os.popen('xdpyinfo | grep "depth of root"', 'r')
+
+ p = re.compile("([0-9]*) planes")
+ for line in out.readlines():
+ match = p.search(line)
+ if (match is not None):
+ if int(match.group(1)) >= 16:
+ bitDepth = False
+ else:
+ bitDepth = True
+ out.close()
+
+ return bitDepth
+
+def possibleOutput(text):
+ return text in sys.argv and text in AvailableOutputs
+
+if __name__=="__main__":
+ if len(AvailableOutputs) > 0:
+ Output = AvailableOutputs[0]
+ else:
+ Output = None
+
+ for text in sys.argv:
+ if possibleOutput(text):
+ Output = text
+
+ if "--no-test" in sys.argv:
+ exit(0)
+
+ if (badDirectRendering()):
+ error("XBMC needs hardware accelerated OpenGL rendering.\nInstall an appropriate graphics driver.\n\nPlease consult XBMC Wiki for supported hardware\nhttp://xbmc.org/wiki/?title=Supported_hardware")
+
+ if (badColorDepth()):
+ error("XBMC cannot run unless the\nscreen color depth is atleast 24 bit.\n\nPlease reconfigure your screen.")
View
6 tools/TexturePacker/XBMCTex.cpp
@@ -235,6 +235,7 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
unsigned int format = 0;
double colorMSE, alphaMSE;
squish::u8* argb = (squish::u8 *)argbImage->pixels;
+#ifndef __arm__
unsigned int compressedSize = squish::GetStorageRequirements(image->w, image->h, squish::kDxt5);
squish::u8* compressed = new squish::u8[compressedSize];
// first try DXT1, which is only 4bits/pixel
@@ -289,6 +290,11 @@ CXBTFFrame createXBTFFrame(SDL_Surface* image, CXBTFWriter& writer, double maxMS
delete[] compressed;
SDL_FreeSurface(argbImage);
return frame;
+#else // For ARM, dont use DXT compression!!!
+ CXBTFFrame frame = appendContent(writer, image->w, image->h, argb, image->w * image->h * 4, XB_FMT_A8R8G8B8, flags);
+ SDL_FreeSurface(argbImage);
+ return frame;
+#endif
}
void Usage()
View
41 tools/arm/arm-scripts/create-pkgsfile.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# This will create a tar file that contains all the armel packages already extracted.
+
+# Dont go further if there are no packages, i.e install-pkgs.sh was not run!
+if [ ! -e pkgs ]
+then
+ echo "install-pkgs.sh was not run!!! Exiting!"
+ exit
+fi
+
+# Cleanup
+if [ -e pkgs-output.txt ]
+then
+ rm pkgs-output.txt
+fi
+
+# Cleanup
+if [ -e pkgs.tar.bz2 ]
+then
+ rm pkgs.tar.bz2
+fi
+
+# Extract all deb packages into a temporary directory.
+# Keep the output log, incase something went wrong.
+cd pkgs
+mkdir tmp
+
+echo "Collecting all package data... please wait"
+for i in `ls *.deb`
+do
+ dpkg-deb -x $i tmp/ >> ../pkgs-output.txt 2>&1
+done
+echo "Please check pkgs-output.txt for any errors that may have been encountered!"
+
+echo "Creating tar file... please wait"
+cd tmp
+tar cjf ../../pkgs.tar.bz2 ./
+cd ../
+rm -r tmp
+echo "Done! Output: pkgs.tar.bz2"
View
54 tools/arm/arm-scripts/create-xbmcfile.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# A re-write of original XBMC Makefile install proceedure that will work with scratchbox.
+
+filename=xbmc.tar.bz2
+prefix=tools/arm/arm-scripts/usr
+cd ../../../
+mkdir -p $prefix
+
+# Install Binaries
+echo "Copying XBMC binary to $prefix/share/xbmc/xbmc.bin"
+install -D xbmc.bin $prefix/share/xbmc/xbmc.bin
+install -D xbmc-xrandr $prefix/share/xbmc/xbmc-xrandr
+# Install Scripts
+install -D tools/Linux/xbmc.sh $prefix/bin/xbmc
+install -D tools/Linux/xbmc-standalone.sh $prefix/bin/xbmc-standalone
+install -D -m 0644 tools/Linux/FEH-ARM.py $prefix/share/xbmc/FEH.py
+install -D -m 0644 tools/Linux/xbmc-xsession.desktop $prefix/share/xsessions/XBMC.desktop
+# Arch dependent files
+find system screensavers visualisations -type f -not -iregex ".*\(svn.*\|win32\(dx\)?\.vis\|osx\.vis\)" -iregex ".*\(arm.*\|\.vis\|\.xbs\)" -exec install -D "{}" $prefix/share/xbmc/"{}" \; -printf " -- %-75.75f\r"
+# Install Datas
+echo "Copying support and legal files..."
+for FILE in `ls README.linux README.armel LICENSE.GPL *.txt`
+do
+ install -D -m 0644 "$FILE" $prefix/share/xbmc/"$FILE"
+done
+echo "Done!"
+echo "Copying system files to $prefix/share/xbmc"
+# Arch independent files
+find language media scripts sounds userdata visualisations system -type f -not -iregex ".*\(svn.*\|\.so\|\.dll\|\.pyd\|python/.*\.zlib\|\.vis\)" -exec install -D -m 0644 "{}" $prefix/share/xbmc/"{}" \; -printf " -- %-75.75f\r"
+# Skins
+find skin -type f -not -iregex ".*\(svn.*\|^skin/[^/]*/media/.*[^x][^b][^t]\)" -exec install -D -m 0644 '{}' $prefix/share/xbmc/'{}' \; -printf " -- %-75.75f\r"
+# Icons and links
+mkdir -p $prefix/share/applications $prefix/share/pixmaps
+cp -a tools/Linux/xbmc.png $prefix/share/pixmaps/
+cp -a tools/Linux/xbmc.desktop $prefix/share/applications/
+# Install Web
+mkdir -p $prefix/share/xbmc/web
+cp -r web/Project_Mayhem_III/* $prefix/share/xbmc/web
+find $prefix/share/xbmc/web -depth -name .svn -exec rm -rf {} \;
+echo "...Complete!"
+
+cd arm-scripts
+
+# Cleanup
+if [ -e $filename ]
+then
+ rm $filename
+fi
+
+echo "Creating tar file... please wait"
+tar cjf $filename usr
+rm -r usr
+echo "Done! Output: $filename"
View
18 tools/arm/arm-scripts/gcc4.5-paths.txt
@@ -0,0 +1,18 @@
+http://ftp.debian.org/debian/pool/main/b/binutils_2.20.51.20100418-1_armel.deb
+http://ftp.debian.org/debian/pool/main/c/cloog-ppl/libcloog-ppl0_0.15.9-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gcc-4.5/cpp-4.5_4.5-20100321-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gcc-4.5/g++-4.5_4.5-20100321-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gcc-4.5/gcc-4.5_4.5-20100321-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gcc-4.5/gcc-4.5-base_4.5-20100321-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libgcc1_4.5-20100321-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libgomp1_4.5-20100321-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libstdc++6_4.5-20100321-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gcc-4.5/libstdc++6-4.5-dev_4.5-20100321-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gmpc/gmpc_0.20.0-1_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gmp/libgmp10_5.0.1+dfsg-2_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gmp/libgmpxx4ldbl_5.0.1+dfsg-2_armel.deb
+http://ftp.debian.org/debian/pool/main/g/gmp/libmp3_5.0.1+dfsg-2_armel.deb
+http://ftp.debian.org/debian/pool/main/libe/libelf/libelfg0_0.8.13-1_armel.deb
+http://ftp.debian.org/debian/pool/main/m/mpclib/libmpc2_0.8.1-1_armel.deb
+http://ftp.debian.org/debian/pool/main/p/ppl/libppl7_0.10.2-6_armel.deb
+http://ftp.debian.org/debian/pool/main/p/ppl/libppl-c2_0.10.2-6_armel.deb
View
61 tools/arm/arm-scripts/install-pkgs.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# A simple script that will automatically download a predefined list of packages,
+# skipping over those already downloaded, and then extracting them to root folder /
+
+echo "#### Beginning Downloads ####"
+
+# If the temporary pkgs folder has not been created, create it
+if [ ! -e pkgs ]
+then
+ mkdir pkgs
+fi
+
+cd pkgs
+# Make a copy of the pkg paths text file for manipulation
+cp ../pkg-paths.txt ./
+
+# Remove lines in the text file that we have already obtained
+for i in *.deb
+do
+ sed "/$i/d" pkg-paths.txt > tmpfile
+ mv tmpfile pkg-paths.txt
+done
+
+# If theres packages left to download, do so. Otherwise, do nothing
+if test `cat pkg-paths.txt | wc -l` -gt 0
+then
+ echo "Downloading:"
+ cat pkg-paths.txt
+ wget -i pkg-paths.txt -o ../wget-output.txt
+else
+ echo "#### Nothing to Download or Extract!!! Exiting... ####"
+ exit
+fi
+
+echo "#### Downloads Complete! Please check wget-output.txt for any errors that may have been encountered! ####"
+echo
+echo
+echo "#### Extracting Packages ####"
+# Only install if running from scratchbox!!! (or arm in general)
+if test `uname -m` = "arm"
+then
+ # Remove dpkg logfile
+ if [ -e ../dpkg-output.txt ]
+ then
+ rm ../dpkg-output.txt
+ fi
+
+ for i in `cat pkg-paths.txt`
+ do
+ # For each .deb package just downloaded,
+ # extract the contents to / and redirect the output!
+ j=`basename $i`
+ echo "Extracting $j..."
+ dpkg-deb -x $j / >> ../dpkg-output.txt 2>&1
+ done
+ echo "#### Extraction Complete! Please check dpkg-output.txt for any errors that may have been encountered! ####"
+else
+ echo "#### Extraction FAILED: Did not extract as not running in scratchbox! ####"
+fi
+
View
70 tools/arm/arm-scripts/pkg-paths.txt
@@ -0,0 +1,70 @@
+http://ftp.uk.debian.org/debian/pool/main/b/boost/libboost-dev_1.34.1-14_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libm/libmad/libmad0-dev_0.15.1b-4_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libs/libsamplerate/libsamplerate0-dev_0.1.4-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libs/libsamplerate/libsamplerate0_0.1.4-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libv/libvorbis/libvorbis-dev_1.2.0.dfsg-3.1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libv/libvorbis/libvorbisfile3_1.2.0.dfsg-3.1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libv/libvorbis/libvorbis0a_1.2.0.dfsg-3.1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/f/fribidi/libfribidi-dev_0.10.9-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/m/mysql-dfsg-5.0/libmysqlclient15-dev_5.0.51a-24+lenny1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/p/pcre3/libpcre3-dev_7.6-2.1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/l/lzo2/liblzo2-dev_2.03-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/l/lzo2/liblzo2-2_2.03-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libc/libcdio/libcdio-dev_0.78.2+dfsg1-3_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libs/libsdl1.2/libsdl1.2-dev_1.2.13-2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libs/libsdl1.2/libsdl1.2debian_1.2.13-2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libs/libsdl1.2/libsdl1.2debian-all_1.2.13-2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/a/arts/libartsc0_1.5.9-2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/e/esound/libesd0_0.2.36-3_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/a/audiofile/libaudiofile0_0.2.6-7_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/p/pulseaudio/libpulse-dev_0.9.10-3+lenny1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/p/pulseaudio/libpulse0_0.9.10-3+lenny1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/n/nas/libaudio2_1.9.1-5_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/d/directfb/libdirectfb-1.0-0_1.0.1-11_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/a/aalib/libaa1_1.4p5-37+b1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libc/libcap/libcap1_1.10-14_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/liba/libasyncns/libasyncns0_0.3-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libncurses5-dev_5.7+20081213-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/n/ncurses/libncurses5_5.7+20081213-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/s/slang2/libslang2_2.1.3-3_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/g/gpm/libgpm2_1.20.4-3.1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/s/sdl-mixer1.2/libsdl-mixer1.2-dev_1.2.8-4_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/s/sdl-mixer1.2/libsdl-mixer1.2_1.2.8-4_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libm/libmikmod/libmikmod2_3.1.11-a-6_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/s/smpeg/libsmpeg0_0.4.5+cvs20030824-2.2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/e/enca/libenca-dev_1.9-6_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/e/enca/libenca0_1.9-6_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/j/jasper/libjasper-dev_1.900.1-5.1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libm/libmms/libmms-dev_0.4-2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libm/libmms/libmms0_0.4-2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libx/libxinerama/libxinerama-dev_1.0.3-2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/x/x11proto-xinerama/x11proto-xinerama-dev_1.1.2-5_all.deb
+http://ftp.uk.debian.org/debian/pool/main/c/curl/libcurl4-gnutls-dev_7.18.2-8lenny3_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/c/curl/libcurl3-gnutls_7.18.2-8lenny3_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libi/libidn/libidn11_1.8+20080606-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/o/openldap/libldap-2.4-2_2.4.11-1_armel.deb
+http://security.debian.org/debian-security/pool/updates/main/g/gnutls26/libgnutls26_2.4.2-6+lenny2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libt/libtasn1-3/libtasn1-3_1.4-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/c/cyrus-sasl2/libsasl2-2_2.1.22.dfsg1-23+lenny1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/k/krb5/libkrb53_1.6.dfsg.4~beta1-5lenny1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/k/keyutils/libkeyutils1_1.2-9_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/e/e2fsprogs/libcomerr2_1.41.3-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/c/cmake/cmake_2.6.0-6_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/n/nasm/nasm_2.03.01-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libj/libjpeg6b/libjpeg62-dev_6b-14_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libj/libjpeg6b/libjpeg62_6b-14_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/t/tiff/libtiff4_3.8.2-11_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/p/python2.5/python2.5-dev_2.5.2-15_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/p/python2.5/python2.5_2.5.2-15_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/s/sdl-image1.2/libsdl-image1.2-dev_1.2.6-3_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/s/sdl-image1.2/libsdl-image1.2_1.2.6-3_armel.deb
+http://security.debian.org/debian-security/pool/updates/main/s/samba/libsmbclient-dev_3.2.5-4lenny7_armel.deb
+http://security.debian.org/debian-security/pool/updates/main/s/samba/libsmbclient_3.2.5-4lenny7_armel.deb
+http://security.debian.org/debian-security/pool/updates/main/s/samba/libwbclient0_3.2.5-4lenny7_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/t/talloc/libtalloc1_1.2.0~git20080616-1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/f/faad2/libfaad-dev_2.6.1-3.1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/f/faad2/libfaad0_2.6.1-3.1_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/f/flac/libflac-dev_1.2.1-1.2_armel.deb
+http://ftp.uk.debian.org/debian/pool/main/libc/libcdio/libiso9660-dev_0.78.2+dfsg1-3_armel.deb
+http://security.debian.org/debian-security/pool/updates/main/d/dbus/libdbus-1-dev_1.2.1-5+lenny1_armel.deb
+http://security.debian.org/debian-security/pool/updates/main/d/dbus/libdbus-1-3_1.2.1-5+lenny1_armel.deb
View
2  xbmc/Application.cpp
@@ -531,7 +531,7 @@ bool CApplication::Create()
uint32_t sdlFlags = 0;