removed all maemo stuff
This commit is contained in:
parent
358af4e537
commit
9c29a2dd63
13 changed files with 5 additions and 599 deletions
|
@ -38,11 +38,6 @@ Create ubuntu dsc packages:
|
|||
sed "0,/(\(.*\)ubuntu.*) $release;/s//(\1) unstable;/" -i debian/changelog; \
|
||||
done
|
||||
|
||||
Create maemo dsc package:
|
||||
sed "0,/(\(.*\)) unstable;/s//(\1maemo1~fremantle) fremantle;/" -i debian/changelog
|
||||
bzr builddeb -S --builder="debuild -sa"
|
||||
sed "0,/(\(.*\)maemo.*) fremantle;/s//(\1) unstable;/" -i debian/changelog
|
||||
|
||||
Create win32 installer + sign:
|
||||
rm -rf build && mkdir build && cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/path/to/win32/toolchain/file -DENABLE_STATIC=ON -DENABLE_NSIS=ON -DENABLE_UPX=ON -DENABLE_STRIP=ON ..
|
||||
|
@ -64,9 +59,6 @@ Upload orig tarball and windows installers with signatures:
|
|||
Upload ubuntu dsc packages to stratagus PPA:
|
||||
dput ppa:stratagus/ppa ../stratagus_*ubuntu*_source.changes
|
||||
|
||||
Upload maemo dsc package to Maemo Extras-devel:
|
||||
scp ../stratagus_*.orig.tar.gz ../stratagus_*maemo*.debian.tar.gz ../stratagus_*maemo*_source.changes ../stratagus_*maemo*.dsc drop.maemo.org:/var/www/extras-devel/incoming-builder/fremantle/
|
||||
|
||||
Example of cmake win32 toolchain file for windows:
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
|
||||
|
|
|
@ -2,15 +2,12 @@
|
|||
# Once done this will define
|
||||
#
|
||||
# SDLGLES_FOUND - system has gles support in SDL
|
||||
# SDLGLES_TYPE - Native, Maemo or EGL
|
||||
# SDLGLES_TYPE - Native or EGL
|
||||
# SDLGLES_INCLUDE_DIR - include directory for SDL gles (can be empty)
|
||||
# SDLGLES_LIBRARY - library for SDL gles (can be empty)
|
||||
|
||||
# Types:
|
||||
# Native - support is in SDL, program only needs to add SDL_OPENGLES flag to SDL_SetVideoMode
|
||||
# Maemo - support using SDL_gles library which was created for Maemo but should work with other systems too
|
||||
# program needs to call SDL_GLES_Init, SDL_GLES_CreateContext and SDL_GLES_MakeCurrent
|
||||
# More info on https://garage.maemo.org/projects/sdlhildon and https://wiki.maemo.org/User:Javispedro/SDL-GLES
|
||||
# EGL - support using directly EGL library, see http://pandorawiki.org/Combining_OpenGL_ES_1.1_and_SDL_to_create_a_window_on_the_Pandora
|
||||
# program needs to initialize EGL and GLES manually
|
||||
|
||||
|
@ -43,22 +40,6 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT SDLGLES_FOUND)
|
||||
# Check for Maemo support
|
||||
find_path(SDLGLES_INCLUDE_DIR SDL_gles.h PATH_SUFFIXES SDL include/SDL)
|
||||
find_library(SDLGLES_LIBRARY NAMES SDL_gles)
|
||||
|
||||
if(SDLGLES_INCLUDE_DIR AND SDLGLES_LIBRARY)
|
||||
set(SDLGLES_FOUND true)
|
||||
set(SDLGLES_TYPE "Maemo")
|
||||
message(STATUS "Found Maemo SDL gles: ${SDLGLES_LIBRARY}")
|
||||
else()
|
||||
unset(SDLGLES_INCLUDE_DIR)
|
||||
unset(SDLGLES_LIBRARY)
|
||||
message(STATUS "Could not find Maemo SDL gles")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT SDLGLES_FOUND)
|
||||
# Check for EGL support
|
||||
find_package(OpenGLES)
|
||||
|
|
29
debian/rules
vendored
29
debian/rules
vendored
|
@ -27,8 +27,6 @@
|
|||
#
|
||||
#
|
||||
|
||||
MAEMO := $(shell if pkg-config maemo-version 1>/dev/null 2>&1 || test -f "/etc/maemo_version" || osso-product-info -q OSSO_PRODUCT_INFO_RELEASE_NAME 2>/dev/null | grep -q -i maemo; then echo YES; fi)
|
||||
|
||||
%:
|
||||
dh $@ --parallel
|
||||
|
||||
|
@ -55,30 +53,3 @@ override_dh_shlibdeps:
|
|||
|
||||
override_dh_strip:
|
||||
dh_strip --dbg-package=stratagus-dbg
|
||||
|
||||
ifdef MAEMO
|
||||
|
||||
override_dh_fixperms:
|
||||
mkdir -p debian/stratagus/opt/stratagus/bin
|
||||
mkdir -p debian/stratagus/opt/man/man6
|
||||
mv debian/stratagus/usr/games/stratagus debian/stratagus/opt/stratagus/bin/
|
||||
mv debian/stratagus/usr/share/man/man6/stratagus.6.gz debian/stratagus/opt/man/man6/
|
||||
ln -s /opt/stratagus/bin/stratagus debian/stratagus/usr/games/stratagus
|
||||
ln -s /opt/man/man6/stratagus.6.gz debian/stratagus/usr/share/man/man6/stratagus.6.gz
|
||||
dh_fixperms
|
||||
|
||||
override_dh_gencontrol:
|
||||
dh_gencontrol
|
||||
cp debian/stratagus/DEBIAN/control debian/stratagus/DEBIAN/control.orig
|
||||
sed -n -e "1,/^Depends:.*$$/p" -i debian/stratagus/DEBIAN/control
|
||||
echo "Bugtracker: https://bugs.launchpad.net/stratagus" >> debian/stratagus/DEBIAN/control
|
||||
echo "Maemo-Display-Name: Stratagus" >> debian/stratagus/DEBIAN/control
|
||||
echo "Maemo-Icon-26:" >> debian/stratagus/DEBIAN/control
|
||||
for line in $(shell convert src/win32/stratagus.ico -resize 48x48 png:- | uuencode -m - | tail -n +2 | head -n -1); do \
|
||||
echo " $$line" >> debian/stratagus/DEBIAN/control; \
|
||||
done
|
||||
sed -n -e "/^Depends:.*$$/,\$$p" debian/stratagus/DEBIAN/control.orig | tail -n +2 >> debian/stratagus/DEBIAN/control
|
||||
sed "s/Section: .*/Section: user\/games/" -i debian/stratagus/DEBIAN/control
|
||||
rm -f debian/stratagus/DEBIAN/control.orig
|
||||
|
||||
endif
|
||||
|
|
|
@ -1528,7 +1528,6 @@ PREDEFINED = USE_ZLIB \
|
|||
USE_BSD \
|
||||
USE_BEOS \
|
||||
USE_MAC \
|
||||
USE_MAEMO \
|
||||
WIN32 \
|
||||
DOXYGEN
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
<h2>Software Requirements</h2>
|
||||
<ul>
|
||||
<li><b>A supported operating system:</b> Linux, Linux Maemo based devices, Mac OS X, BSD,
|
||||
<li><b>A supported operating system:</b> Linux, Mac OS X, BSD,
|
||||
Possibly any other Unix/POSIX OS.<br>
|
||||
Microsoft Windows 98 SE, or higher.
|
||||
<font color=red>NOTE: some features of Winsock2 (WS2_32.DLL) are used. So even
|
||||
|
@ -58,7 +58,6 @@
|
|||
<li><a href="http://www.gzip.org/zlib/">zlib</a> (required).<p>
|
||||
<li><a href="http://www.lua.org/">Lua 5.1</a> (required).<p>
|
||||
<li><a href="http://www.codenix.com/~tolua/">Tolua++</a> (required).<p>
|
||||
<li><a href="https://maemo.gitorious.org/maemo-af/libosso/">LibOSSO</a> - part of Maemo SDK (required on Maemo).<p>
|
||||
<li><a href="http://www.xipg.org/">libogg</a> (recommended).<p>
|
||||
<li><a href="http://www.xiph.org/ogg/vorbis/">libvorbis</a> (recommended).<p>
|
||||
<li><a href="http://www.theora.org/">libtheora</a> (recommended).<p>
|
||||
|
@ -66,7 +65,6 @@
|
|||
<li><a href="http://mikmod.raphnet.net/">libmikmod</a> (optional).<p>
|
||||
<li><a href="http://sources.redhat.com/bzip2/">libbzip2</a> (optional).<p>
|
||||
<li><a href="http://www.libmng.com/">libmng</a> (optional).<p>
|
||||
<li><a href="https://garage.maemo.org/projects/sdlhildon/">SDL gles</a> - part of SDL hildon - needed for OpenGL ES 1.1 (instead OpenGL).<p>
|
||||
<li><a href="http://www.sqlite.org/">SQLite</a> (optional).<p>
|
||||
<li><a href="http://www.doxygen.org/">DoxyGen</a> (optional).<p>
|
||||
|
||||
|
|
|
@ -135,10 +135,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if ( defined (MAEMO_GTK) || defined (MAEMO_CHANGES) ) && ! defined (MAEMO)
|
||||
#define MAEMO
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define WINVER 0x0501
|
||||
#include <windows.h>
|
||||
|
@ -175,10 +171,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MAEMO
|
||||
#include <hildon/hildon.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN64
|
||||
#define REGKEY "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Stratagus (64 bit)"
|
||||
#elif defined (WIN32)
|
||||
|
@ -209,12 +201,6 @@ static void error(char * title, char * text) {
|
|||
GtkWidget * window = NULL;
|
||||
GtkWidget * dialog = NULL;
|
||||
|
||||
#ifdef MAEMO
|
||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title(GTK_WINDOW(window), title);
|
||||
gtk_widget_show(window);
|
||||
#endif
|
||||
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", text);
|
||||
gtk_window_set_title(GTK_WINDOW(dialog), title);
|
||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), 0);
|
||||
|
@ -223,9 +209,6 @@ static void error(char * title, char * text) {
|
|||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
|
||||
#ifdef MAEMO
|
||||
gtk_widget_destroy(window);
|
||||
#endif
|
||||
} else {
|
||||
#endif
|
||||
fprintf(stderr, "%s -- Error: %s\n", title, text);
|
||||
|
@ -241,19 +224,12 @@ int main(int argc, char * argv[]) {
|
|||
ConsoleMode = 1;
|
||||
}
|
||||
if ( ConsoleMode ) {
|
||||
#ifdef MAEMO
|
||||
error(TITLE, NO_X_DISPLAY);
|
||||
#else
|
||||
if ( getuid() != 0 ) {
|
||||
error(TITLE, CONSOLE_MODE_NOT_ROOT);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#ifndef NOGTK
|
||||
gtk_init(&argc, &argv);
|
||||
#ifdef MAEMO
|
||||
hildon_init();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,280 +0,0 @@
|
|||
/*
|
||||
_________ __ __
|
||||
/ _____// |_____________ _/ |______ ____ __ __ ______
|
||||
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
|
||||
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
|
||||
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
|
||||
\/ \/ \//_____/ \/
|
||||
______________________ ______________________
|
||||
T H E W A R B E G I N S
|
||||
Stratagus - A free fantasy real time strategy game engine
|
||||
|
||||
stratagus-maemo-extract.h - Stratagus Game data extractor for Maemo
|
||||
Copyright (C) 2010-2011 Pali Rohár <pali.rohar@gmail.com>
|
||||
|
||||
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 of the License, 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* @page MaemoExtract Stratagus Game data extractor for Maemo
|
||||
*
|
||||
* Stratagus Game Launcher is C code for generating launcher for any Stratagus game.
|
||||
* Game launcher for concrete game check if game data exists in default Stratagus
|
||||
* location and spawn Stratagus process with correct game data location. If does not
|
||||
* exist it show GUI or console error message.
|
||||
*
|
||||
* Before including this header, you need to define:
|
||||
*
|
||||
* ::GAME_NAME
|
||||
*
|
||||
* ::GAME_CD
|
||||
*
|
||||
* ::GAME_CD_DIR
|
||||
*
|
||||
* ::GAME_CD_FILE
|
||||
*
|
||||
* ::GAME
|
||||
*
|
||||
*
|
||||
* ::EXTRACT_BIN
|
||||
*
|
||||
*
|
||||
* And optional:
|
||||
*
|
||||
* ::EXTRACT_COMMAND
|
||||
*
|
||||
* ::EXTRACT_INFO
|
||||
*
|
||||
* Example use of code:
|
||||
*
|
||||
* @code
|
||||
*
|
||||
* #define GAME_NAME "My Game Name"
|
||||
* #define GAME_CD "Original Game CD Name"
|
||||
* #define GAME_CD_DIR "MyDocs/game"
|
||||
* #define GAME_CD_FILE "datafile.bin"
|
||||
* #define GAME "my_game"
|
||||
* #define EXTRACT_BIN "/opt/stratagus/bin/mygametool"
|
||||
* #define EXTRACT_COMMAND "/opt/stratagus/bin/mygametool /home/user/MyDocs/game /home/user/stratagus/my_game"
|
||||
* #define EXTRACT_INFO ""
|
||||
* #include <stratagus-maemo-extract.h>
|
||||
*
|
||||
* @endcode
|
||||
**/
|
||||
|
||||
/**
|
||||
* \def GAME_NAME
|
||||
* Full name of your Game
|
||||
**/
|
||||
|
||||
/**
|
||||
* \def GAME_CD
|
||||
* Full name of data CD
|
||||
**/
|
||||
|
||||
/**
|
||||
* \def GAME_CD_DIR
|
||||
* Relative path of /home/user where is data CD
|
||||
**/
|
||||
|
||||
/**
|
||||
* \def GAME_CD_FILE
|
||||
* Filename of one data file
|
||||
**/
|
||||
|
||||
/**
|
||||
* \def GAME
|
||||
* Short name of game (lower ascii chars without space)
|
||||
**/
|
||||
|
||||
/**
|
||||
* \def EXTRACT_BIN
|
||||
* Full path to program which extract data
|
||||
**/
|
||||
|
||||
/**
|
||||
* \def EXTRACT_COMMAND
|
||||
* Optional: Full patch to extract program with command line arguments for extracting data
|
||||
* If not specified 'EXTRACT_BIN DATA_DIR EXTRACT_DIR' is used
|
||||
**/
|
||||
|
||||
/**
|
||||
* \def EXTRACT_INFO
|
||||
* Optional: Additional extract data game info
|
||||
* Default empty
|
||||
**/
|
||||
|
||||
/* Fake definitions for Doxygen */
|
||||
#ifdef DOXYGEN
|
||||
#define GAME_NAME
|
||||
#define GAME_CD
|
||||
#define GAME_CD_DIR
|
||||
#define GAME_CD_FILE
|
||||
#define GAME
|
||||
#define EXTRACT_BIN
|
||||
#endif
|
||||
|
||||
#if ! defined (GAME_NAME) || ! defined (GAME_CD) || ! defined (GAME_CD_DIR) || ! defined (GAME_CD_FILE) || ! defined (GAME) || ! defined (EXTRACT_BIN)
|
||||
#error You need to define all Game macros, see stratagus-maemo-extract.h
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <hildon/hildon.h>
|
||||
|
||||
#define DATA_DIR "/home/user/" GAME_CD_DIR
|
||||
#define EXTRACT_DIR "/home/user/MyDocs/stratagus/" GAME
|
||||
|
||||
#ifndef EXTRACT_COMMAND
|
||||
#define EXTRACT_COMMAND EXTRACT_BIN " " DATA_DIR " " EXTRACT_DIR
|
||||
#endif
|
||||
|
||||
#ifndef EXTRACT_INFO
|
||||
#define EXTRACT_INFO ""
|
||||
#endif
|
||||
|
||||
#define DATA_NEED_COPY "Note: You need the original " GAME_CD "\nto extract the game data files.\nData files are needed to run " GAME_NAME ".\n\nFirst copy " GAME_CD " to folder\n" GAME_CD_DIR "\nthen press OK. " EXTRACT_INFO
|
||||
#define DATA_FOUND GAME_CD " data files was found in folder\n" GAME_CD_DIR "\n\nPlease be patient, the data may take\na couple of minutes to extract...\n\nPress OK to start extracting data now."
|
||||
#define DATA_NOT_FOUND "Error: " GAME_CD " data files was not found.\n\nCheck if you have file\n" GAME_CD_DIR "/" GAME_CD_FILE
|
||||
#define EXTRACT_OK GAME_CD " data files was successfull extracted."
|
||||
#define EXTRACT_FAILED "Error: Cannot extract " GAME_CD " data files\nextract program crashed."
|
||||
|
||||
static void message(char * title, char * text, int error) {
|
||||
|
||||
GtkWidget * window = NULL;
|
||||
GtkWidget * dialog = NULL;
|
||||
|
||||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title(GTK_WINDOW(window), title);
|
||||
gtk_widget_show(window);
|
||||
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, error ? GTK_MESSAGE_ERROR : GTK_MESSAGE_INFO, GTK_BUTTONS_OK, text, NULL);
|
||||
gtk_window_set_title(GTK_WINDOW(dialog), title);
|
||||
gtk_window_set_skip_pager_hint(GTK_WINDOW(dialog), 0);
|
||||
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), 0);
|
||||
gtk_label_set_selectable(GTK_LABEL(GTK_MESSAGE_DIALOG(dialog)->label), 0);
|
||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
|
||||
gtk_widget_destroy(window);
|
||||
|
||||
if ( error )
|
||||
exit(error);
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
|
||||
FILE * file;
|
||||
struct stat st;
|
||||
|
||||
hildon_gtk_init(&argc, &argv);
|
||||
|
||||
file = fopen(EXTRACT_DIR "/extracted", "r");
|
||||
|
||||
if ( file ) {
|
||||
|
||||
char act_version[20];
|
||||
int have_version = 0;
|
||||
|
||||
if ( fgets(act_version, 20, file) )
|
||||
have_version = 1;
|
||||
|
||||
fclose(file);
|
||||
|
||||
if ( have_version ) {
|
||||
|
||||
file = popen(EXTRACT_BIN " -V", "r");
|
||||
|
||||
if ( file ) {
|
||||
|
||||
int i;
|
||||
char new_version[20];
|
||||
have_version = 0;
|
||||
|
||||
if ( fgets(new_version, 20, file) )
|
||||
have_version = 1;
|
||||
|
||||
pclose(file);
|
||||
|
||||
if ( have_version ) {
|
||||
|
||||
for ( i = 0; i < 20; ++i ) {
|
||||
if ( new_version[i] == '\n' ) {
|
||||
new_version[i] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( strcmp(act_version, new_version) == 0 )
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
message(GAME_NAME, DATA_NEED_COPY, 0);
|
||||
|
||||
if ( stat(DATA_DIR "/" GAME_CD_FILE, &st) != 0 ) {
|
||||
|
||||
char * buf = strdup(GAME_CD_FILE);
|
||||
char * path = calloc(strlen(DATA_DIR) + strlen(GAME_CD_FILE) + 2, 1);
|
||||
char * ptr = buf;
|
||||
|
||||
while ( *ptr ) {
|
||||
|
||||
*ptr = toupper(*ptr);
|
||||
++ptr;
|
||||
|
||||
}
|
||||
|
||||
sprintf(path, DATA_DIR "/%s", buf);
|
||||
|
||||
if ( stat(path, &st) != 0 )
|
||||
message(GAME_NAME, DATA_NOT_FOUND, 1);
|
||||
|
||||
free(buf);
|
||||
free(path);
|
||||
|
||||
}
|
||||
|
||||
if ( stat("/home/user/MyDocs/stratagus", &st) != 0 )
|
||||
mkdir("/home/user/MyDocs/stratagus", 0777);
|
||||
|
||||
if ( stat("/home/user/MyDocs/stratagus/" GAME, &st) != 0 )
|
||||
mkdir("/home/user/MyDocs/stratagus/" GAME, 0777);
|
||||
|
||||
message(GAME_NAME, DATA_FOUND, 0);
|
||||
|
||||
int ret = system(EXTRACT_COMMAND);
|
||||
|
||||
if ( ret != 0 )
|
||||
message(GAME_NAME, EXTRACT_FAILED, ret);
|
||||
|
||||
message(GAME_NAME, EXTRACT_OK, 0);
|
||||
return 0;
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
// _________ __ __
|
||||
// / _____// |_____________ _/ |______ ____ __ __ ______
|
||||
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
|
||||
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
|
||||
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
|
||||
// \/ \/ \//_____/ \/
|
||||
// ______________________ ______________________
|
||||
// T H E W A R B E G I N S
|
||||
// Stratagus - A free fantasy real time strategy game engine
|
||||
//
|
||||
/**@name maemo.h - Maemo platform code. */
|
||||
//
|
||||
// (c) Copyright 2011 by Pali Rohár
|
||||
//
|
||||
// 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; only version 2 of the License.
|
||||
//
|
||||
// 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 this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
// 02111-1307, USA.
|
||||
//
|
||||
|
||||
//@{
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Functions
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef USE_MAEMO
|
||||
void maemo_init(void);
|
||||
#endif
|
||||
|
||||
//@}
|
|
@ -1,127 +0,0 @@
|
|||
// _________ __ __
|
||||
// / _____// |_____________ _/ |______ ____ __ __ ______
|
||||
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
|
||||
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
|
||||
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
|
||||
// \/ \/ \//_____/ \/
|
||||
// ______________________ ______________________
|
||||
// T H E W A R B E G I N S
|
||||
// Stratagus - A free fantasy real time strategy game engine
|
||||
//
|
||||
/**@name maemo.cpp - Maemo platform code. */
|
||||
//
|
||||
// (c) Copyright 2011 by Pali Rohár
|
||||
//
|
||||
// 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; only version 2 of the License.
|
||||
//
|
||||
// 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 this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
// 02111-1307, USA.
|
||||
//
|
||||
|
||||
//@{
|
||||
|
||||
#ifdef USE_MAEMO
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Includes
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
#include <libosso.h>
|
||||
#include <SDL.h>
|
||||
|
||||
#include "stratagus.h"
|
||||
#include "version.h"
|
||||
#include "game.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Variables
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
static osso_context_t *osso = NULL;
|
||||
static SDL_TimerID timer = NULL;
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Functions
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Callback function for SDL_AddTimer.
|
||||
* Tell OSSO to keep display on and prevent suspending device for 60s.
|
||||
**/
|
||||
static Uint32 OssoKeepBacklightAlive(Uint32 interval, void *)
|
||||
{
|
||||
if (!osso) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
osso_display_state_on(osso);
|
||||
osso_display_blanking_pause(osso);
|
||||
|
||||
return interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize OSSO context, needed for calling OSSO functions.
|
||||
* Create SDL timer for calling OssoKeepBacklightAlive every 50s.
|
||||
**/
|
||||
static void OssoInitialize(void)
|
||||
{
|
||||
char *application;
|
||||
|
||||
if (FullGameName.empty()) {
|
||||
application = strdup("org.stratagus");
|
||||
} else {
|
||||
application = (char *)calloc(FullGameName.size() + 15, 1);
|
||||
strcpy(application, "org.stratagus.");
|
||||
for (int i = 0; i < FullGameName.size(); i++) {
|
||||
application[i + 14] = tolower(FullGameName[i]);
|
||||
}
|
||||
}
|
||||
|
||||
osso = osso_initialize(application, VERSION, TRUE, NULL);
|
||||
|
||||
free(application);
|
||||
|
||||
if (!osso) {
|
||||
fprintf(stderr, "Couldn't initialize OSSO\n");
|
||||
exit(OSSO_ERROR);
|
||||
}
|
||||
|
||||
timer = SDL_AddTimer(50000, OssoKeepBacklightAlive, NULL);
|
||||
|
||||
if (!timer) {
|
||||
fprintf(stderr, "Couldn't initialize SDL_AddTimer: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deinitialize OSSO context and remove registred SDL timer
|
||||
**/
|
||||
static void OssoDeinitialize(void)
|
||||
{
|
||||
SDL_RemoveTimer(timer);
|
||||
osso_deinitialize(osso);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main function which initialize Maemo platform code
|
||||
**/
|
||||
void maemo_init(void)
|
||||
{
|
||||
OssoInitialize();
|
||||
atexit(OssoDeinitialize);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//@}
|
|
@ -313,14 +313,7 @@ static int RealVideoSyncSpeed;
|
|||
|
||||
static void DisplayLoop()
|
||||
{
|
||||
#ifdef USE_MAEMO
|
||||
if (!IsSDLWindowVisible) {
|
||||
// On Maemo do not redraw/update screen when SDL window is not visible
|
||||
// This stop draining battery power on Nokia N900
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(USE_OPENGL) || defined(USE_GLES)
|
||||
if (UseOpenGL) {
|
||||
/* update only if screen changed */
|
||||
|
|
|
@ -76,7 +76,7 @@ static std::string GetLocalPlayerNameFromEnv()
|
|||
|
||||
#ifdef USE_WIN32
|
||||
userName = getenv("USERNAME");
|
||||
#elif !defined(USE_MAEMO)
|
||||
#else
|
||||
userName = getenv("USER");
|
||||
#endif
|
||||
|
||||
|
|
|
@ -361,9 +361,6 @@ static void PrintHeader()
|
|||
#ifdef USE_X11
|
||||
"X11 "
|
||||
#endif
|
||||
#ifdef USE_MAEMO
|
||||
"MAEMO "
|
||||
#endif
|
||||
#ifdef USE_TOUCHSCREEN
|
||||
"TOUCHSCREEN "
|
||||
#endif
|
||||
|
|
|
@ -56,10 +56,6 @@
|
|||
#include "SDL.h"
|
||||
#include "SDL_syswm.h"
|
||||
|
||||
#ifdef USE_GLES_MAEMO
|
||||
#include "SDL_gles.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_GLES_EGL
|
||||
#include "EGL/egl.h"
|
||||
#endif
|
||||
|
@ -81,10 +77,6 @@
|
|||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_MAEMO
|
||||
#include "maemo.h"
|
||||
#endif
|
||||
|
||||
#include "editor.h"
|
||||
#include "font.h"
|
||||
#include "game.h"
|
||||
|
@ -489,10 +481,6 @@ void InitVideoSdl()
|
|||
// Clean up on exit
|
||||
atexit(SDL_Quit);
|
||||
|
||||
#ifdef USE_MAEMO
|
||||
maemo_init();
|
||||
#endif
|
||||
|
||||
// If debug is enabled, Stratagus disable SDL Parachute.
|
||||
// So we need gracefully handle segfaults and aborts.
|
||||
#if defined(DEBUG) && !defined(USE_WIN32)
|
||||
|
@ -508,7 +496,7 @@ void InitVideoSdl()
|
|||
SDL_WM_SetCaption("Stratagus", "Stratagus");
|
||||
}
|
||||
|
||||
#if ! defined(USE_WIN32) && ! defined(USE_MAEMO)
|
||||
#if ! defined(USE_WIN32)
|
||||
|
||||
#if defined(USE_OPENGL) || defined(USE_GLES)
|
||||
// Make sure, that we not create OpenGL textures (and do not call OpenGL functions), when creating icon surface
|
||||
|
@ -591,13 +579,6 @@ void InitVideoSdl()
|
|||
|
||||
// Initialize the display
|
||||
|
||||
#ifdef USE_MAEMO
|
||||
// TODO: Support window mode and portrait mode resolution on Maemo - Nokia N900
|
||||
Video.FullScreen = 1;
|
||||
Video.Width = 800;
|
||||
Video.Height = 480;
|
||||
#endif
|
||||
|
||||
#if !defined(USE_OPENGL) && !defined(USE_GLES)
|
||||
flags = SDL_HWSURFACE | SDL_HWPALETTE;
|
||||
#endif
|
||||
|
@ -613,17 +594,6 @@ void InitVideoSdl()
|
|||
#ifdef USE_GLES_NATIVE
|
||||
flags |= SDL_OPENGLES;
|
||||
#endif
|
||||
#ifdef USE_GLES_MAEMO
|
||||
if (SDL_GLES_Init(SDL_GLES_VERSION_1_1) < 0) {
|
||||
fprintf(stderr, "Couldn't initialize SDL_GLES: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Clean up GLES on exit
|
||||
atexit(SDL_GLES_Quit);
|
||||
|
||||
flags |= SDL_SWSURFACE;
|
||||
#endif
|
||||
#ifdef USE_OPENGL
|
||||
flags |= SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
|
||||
#endif
|
||||
|
@ -683,18 +653,6 @@ void InitVideoSdl()
|
|||
|
||||
#if defined(USE_OPENGL) || defined(USE_GLES)
|
||||
if (UseOpenGL) {
|
||||
#ifdef USE_GLES_MAEMO
|
||||
SDL_GLES_Context *context = SDL_GLES_CreateContext();
|
||||
if (!context) {
|
||||
fprintf(stderr, "Couldn't initialize SDL_GLES_CreateContext: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
if (SDL_GLES_MakeCurrent(context) < 0) {
|
||||
fprintf(stderr, "Couldn't initialize SDL_GLES_MakeCurrent: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
// atexit(GLES_DeleteContext(context));
|
||||
#endif
|
||||
#ifdef USE_GLES_EGL
|
||||
// Get the SDL window handle
|
||||
SDL_SysWMinfo sysInfo; //Will hold our Window information
|
||||
|
@ -774,11 +732,6 @@ void InitVideoSdl()
|
|||
*/
|
||||
int VideoValidResolution(int w, int h)
|
||||
{
|
||||
#ifdef USE_MAEMO
|
||||
if (w != 800 || h != 480) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return SDL_VideoModeOK(w, h, TheScreen->format->BitsPerPixel, TheScreen->flags);
|
||||
}
|
||||
|
||||
|
@ -1011,9 +964,6 @@ void RealizeVideoMemory()
|
|||
{
|
||||
#if defined(USE_OPENGL) || defined(USE_GLES)
|
||||
if (UseOpenGL) {
|
||||
#ifdef USE_GLES_MAEMO
|
||||
SDL_GLES_SwapBuffers();
|
||||
#endif
|
||||
#ifdef USE_GLES_EGL
|
||||
eglSwapBuffers(eglDisplay, eglSurface);
|
||||
#endif
|
||||
|
@ -1125,10 +1075,6 @@ void ToggleGrabMouse(int mode)
|
|||
*/
|
||||
void ToggleFullScreen()
|
||||
{
|
||||
#ifdef USE_MAEMO
|
||||
// On Maemo is only supported fullscreen mode
|
||||
return;
|
||||
#endif
|
||||
#ifdef USE_WIN32
|
||||
long framesize;
|
||||
SDL_Rect clip;
|
||||
|
|
Loading…
Add table
Reference in a new issue