mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
Fully and officially renamed our main function to scummvm_main, thus making
various backend specific hacks unnecessary. As a consequence, it is now the responsibility of the backend to define main. Hence I adapted the SDL backend accordingly. svn-id: r21542
This commit is contained in:
parent
a2c4795f32
commit
587431f8e8
@ -21,13 +21,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define REAL_MAIN
|
|
||||||
|
|
||||||
#include <common/stdafx.h>
|
#include <common/stdafx.h>
|
||||||
#include <common/scummsys.h>
|
#include <common/scummsys.h>
|
||||||
#include <base/engine.h>
|
#include <base/engine.h>
|
||||||
#include <base/gameDetector.h>
|
#include <base/gameDetector.h>
|
||||||
|
#include <base/main.h>
|
||||||
#include <base/plugins.h>
|
#include <base/plugins.h>
|
||||||
#include "dc.h"
|
#include "dc.h"
|
||||||
#include "icon.h"
|
#include "icon.h"
|
||||||
@ -205,7 +203,6 @@ void dc_init_hardware()
|
|||||||
init_arm();
|
init_arm();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int scummvm_main(int argc, char *argv[]);
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
static char *argv[] = { "scummvm", NULL, };
|
static char *argv[] = { "scummvm", NULL, };
|
||||||
|
@ -37,6 +37,3 @@
|
|||||||
#ifdef Timer
|
#ifdef Timer
|
||||||
#undef Timer
|
#undef Timer
|
||||||
#endif
|
#endif
|
||||||
#ifndef REAL_MAIN
|
|
||||||
#define main scummvm_main
|
|
||||||
#endif
|
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include "common/config-manager.h"
|
#include "common/config-manager.h"
|
||||||
|
|
||||||
|
#include "base/main.h"
|
||||||
|
|
||||||
#include "backends/gp32/gp32std.h"
|
#include "backends/gp32/gp32std.h"
|
||||||
#include "backends/gp32/gp32std_grap.h"
|
#include "backends/gp32/gp32std_grap.h"
|
||||||
|
|
||||||
@ -34,8 +36,6 @@
|
|||||||
|
|
||||||
GlobalVars g_vars;
|
GlobalVars g_vars;
|
||||||
|
|
||||||
extern "C" int scummvm_main(int argc, char *argv[]);
|
|
||||||
|
|
||||||
void init() {
|
void init() {
|
||||||
gp_setCpuSpeed(40); // Default CPU Speed
|
gp_setCpuSpeed(40); // Default CPU Speed
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define REAL_MAIN
|
|
||||||
#include <common/stdafx.h>
|
#include <common/stdafx.h>
|
||||||
#include <common/scummsys.h>
|
#include <common/scummsys.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
@ -29,6 +28,7 @@
|
|||||||
#include <SDL/SDL.h>
|
#include <SDL/SDL.h>
|
||||||
#include <SDL/SDL_syswm.h>
|
#include <SDL/SDL_syswm.h>
|
||||||
|
|
||||||
|
#include "base/main.h"
|
||||||
#include <hildon-widgets/hildon-app.h>
|
#include <hildon-widgets/hildon-app.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <libosso.h>
|
#include <libosso.h>
|
||||||
@ -48,8 +48,6 @@ void set_doubling(unsigned char enable) {
|
|||||||
XSPSetPixelDoubling(wminfo.info.x11.display, 0, enable);
|
XSPSetPixelDoubling(wminfo.info.x11.display, 0, enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int scummvm_main(int argc, char *argv[]);
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
osso_context_t *osso_context;
|
osso_context_t *osso_context;
|
||||||
|
|
||||||
|
@ -52,12 +52,6 @@ typedef signed int int32;
|
|||||||
/* Whether we should use i386 assembly routines */
|
/* Whether we should use i386 assembly routines */
|
||||||
#undef USE_NASM
|
#undef USE_NASM
|
||||||
|
|
||||||
#undef main
|
|
||||||
|
|
||||||
#ifndef REAL_MAIN
|
|
||||||
#define main scummvm_main
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -226,8 +226,6 @@ class AutoLock
|
|||||||
#define AUTO_LOCK AutoLock cs(&CritSec);
|
#define AUTO_LOCK AutoLock cs(&CritSec);
|
||||||
|
|
||||||
|
|
||||||
int morphos_main(int argc, char *argv[]);
|
|
||||||
|
|
||||||
extern OSystem_MorphOS *TheSystem;
|
extern OSystem_MorphOS *TheSystem;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "common/stdafx.h"
|
#include "common/stdafx.h"
|
||||||
#include "scumm/scumm.h"
|
#include "scumm/scumm.h"
|
||||||
#include "base/gameDetector.h"
|
#include "base/gameDetector.h"
|
||||||
|
#include "base/main.h"
|
||||||
#include "common/scaler.h"
|
#include "common/scaler.h"
|
||||||
#include "sound/mididrv.h"
|
#include "sound/mididrv.h"
|
||||||
#include "morphos.h"
|
#include "morphos.h"
|
||||||
@ -433,6 +434,6 @@ int main()
|
|||||||
if (ScummStory)
|
if (ScummStory)
|
||||||
argv[argc++] = ScummStory;
|
argv[argc++] = ScummStory;
|
||||||
|
|
||||||
return morphos_main(argc, argv);
|
return scummvm_main(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
#include "../intern.h"
|
#include "../intern.h"
|
||||||
#include "base/engine.h"
|
#include "base/engine.h"
|
||||||
|
#include "base/main.h"
|
||||||
#include "backends/ps2/systemps2.h"
|
#include "backends/ps2/systemps2.h"
|
||||||
#include "backends/ps2/Gs2dScreen.h"
|
#include "backends/ps2/Gs2dScreen.h"
|
||||||
#include "backends/ps2/ps2input.h"
|
#include "backends/ps2/ps2input.h"
|
||||||
@ -98,8 +99,6 @@ OSystem *OSystem_PS2_create(void) {
|
|||||||
return g_systemPs2;
|
return g_systemPs2;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int scummvm_main(int argc, char *argv[]);
|
|
||||||
|
|
||||||
extern "C" int main(int argc, char *argv[]) {
|
extern "C" int main(int argc, char *argv[]) {
|
||||||
SifInitRpc(0);
|
SifInitRpc(0);
|
||||||
#ifndef USE_PS2LINK // reset the IOP if this is a CD build
|
#ifndef USE_PS2LINK // reset the IOP if this is a CD build
|
||||||
|
@ -51,12 +51,6 @@
|
|||||||
//#define printf pspDebugScreenPrintf
|
//#define printf pspDebugScreenPrintf
|
||||||
#define exit(x) printf("exit() called\n"); sceKernelSleepThread();
|
#define exit(x) printf("exit() called\n"); sceKernelSleepThread();
|
||||||
|
|
||||||
#undef main
|
|
||||||
|
|
||||||
#ifndef REAL_MAIN
|
|
||||||
#define main scummvm_main
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* PORTDEFS_H */
|
#endif /* PORTDEFS_H */
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,10 +28,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define REAL_MAIN
|
|
||||||
#include <common/stdafx.h>
|
#include <common/stdafx.h>
|
||||||
#include <common/scummsys.h>
|
#include <common/scummsys.h>
|
||||||
#include <base/engine.h>
|
#include <base/engine.h>
|
||||||
|
#include <base/main.h>
|
||||||
#include <base/gameDetector.h>
|
#include <base/gameDetector.h>
|
||||||
#include <base/plugins.h>
|
#include <base/plugins.h>
|
||||||
|
|
||||||
@ -123,8 +123,6 @@ int SetupCallbacks(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern "C" int scummvm_main(int argc, char *argv[]);
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
//PSPDebugTrace("Init debug screen\n");
|
//PSPDebugTrace("Init debug screen\n");
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "backends/sdl/sdl-common.h"
|
#include "backends/sdl/sdl-common.h"
|
||||||
#include "common/config-manager.h"
|
#include "common/config-manager.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
#include "base/main.h"
|
||||||
|
|
||||||
#if defined(HAVE_CONFIG_H)
|
#if defined(HAVE_CONFIG_H)
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -32,6 +33,12 @@
|
|||||||
#include "scummvm.xpm"
|
#include "scummvm.xpm"
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) && !defined(__MAEMO__)
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
return scummvm_main(argc, argv);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
OSystem *OSystem_SDL_create() {
|
OSystem *OSystem_SDL_create() {
|
||||||
return new OSystem_SDL();
|
return new OSystem_SDL();
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "base/gameDetector.h"
|
#include "base/gameDetector.h"
|
||||||
#include "base/engine.h"
|
#include "base/engine.h"
|
||||||
|
#include "base/main.h"
|
||||||
#include "base/plugins.h"
|
#include "base/plugins.h"
|
||||||
#include "common/timer.h"
|
#include "common/timer.h"
|
||||||
|
|
||||||
@ -119,8 +120,6 @@ bool isSmartphone() {
|
|||||||
|
|
||||||
// MAIN
|
// MAIN
|
||||||
|
|
||||||
extern "C" int scummvm_main(GameDetector &gameDetector, int argc, char **argv);
|
|
||||||
|
|
||||||
int handleException(EXCEPTION_POINTERS *exceptionPointers) {
|
int handleException(EXCEPTION_POINTERS *exceptionPointers) {
|
||||||
CEException::writeException(TEXT("\\scummvmCrash"), exceptionPointers);
|
CEException::writeException(TEXT("\\scummvmCrash"), exceptionPointers);
|
||||||
drawError("Unrecoverable exception occurred - see crash dump in latest \\scummvmCrash file");
|
drawError("Unrecoverable exception occurred - see crash dump in latest \\scummvmCrash file");
|
||||||
|
@ -155,12 +155,6 @@ const char* stackCookie = "$STACK: 655360\0";
|
|||||||
extern "C" int main(int argc, char *argv[]);
|
extern "C" int main(int argc, char *argv[]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MACOSX) || defined(QTOPIA) || defined(__SYMBIAN32__)
|
|
||||||
#include <SDL.h>
|
|
||||||
#elif !defined(__MORPHOS__) && !defined(__DC__) && !defined(__GP32__)
|
|
||||||
#undef main
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (ALLEGRO_BACKEND)
|
#if defined (ALLEGRO_BACKEND)
|
||||||
#include "allegro.h"
|
#include "allegro.h"
|
||||||
#endif
|
#endif
|
||||||
@ -344,10 +338,8 @@ static int runGame(GameDetector &detector, OSystem &system, const Common::String
|
|||||||
|
|
||||||
#ifdef _WIN32_WCE
|
#ifdef _WIN32_WCE
|
||||||
extern "C" int scummvm_main(GameDetector &detector, int argc, char *argv[]) {
|
extern "C" int scummvm_main(GameDetector &detector, int argc, char *argv[]) {
|
||||||
#elif defined(__PLAYSTATION2__) || defined(__PSP__) || defined(__GP32__) || defined(__MAEMO__)
|
|
||||||
extern "C" int scummvm_main(int argc, char *argv[]) {
|
|
||||||
#else
|
#else
|
||||||
extern "C" int main(int argc, char *argv[]) {
|
extern "C" int scummvm_main(int argc, char *argv[]) {
|
||||||
#endif
|
#endif
|
||||||
char *cfgFilename = NULL;
|
char *cfgFilename = NULL;
|
||||||
Common::String specialDebug = "";
|
Common::String specialDebug = "";
|
||||||
|
38
base/main.h
Normal file
38
base/main.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/* ScummVM - Scumm Interpreter
|
||||||
|
* Copyright (C) 2001 Ludvig Strigeus
|
||||||
|
* Copyright (C) 2001-2006 The ScummVM project
|
||||||
|
*
|
||||||
|
* 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, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* $URL$
|
||||||
|
* $Id: scummsys.h 21500 2006-03-29 15:59:37Z fingolfin $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BASE_MAIN_H
|
||||||
|
#define BASE_MAIN_H
|
||||||
|
|
||||||
|
#include "common/scummsys.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// The scummvm main entry point, to be invoked by ports
|
||||||
|
//
|
||||||
|
#ifdef _WIN32_WCE
|
||||||
|
extern "C" int scummvm_main(GameDetector &detector, int argc, char *argv[]);
|
||||||
|
#else
|
||||||
|
extern "C" int scummvm_main(int argc, char *argv[]);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@ -20,6 +20,7 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMMON_SCUMMSYS_H
|
#ifndef COMMON_SCUMMSYS_H
|
||||||
#define COMMON_SCUMMSYS_H
|
#define COMMON_SCUMMSYS_H
|
||||||
|
|
||||||
@ -200,8 +201,6 @@
|
|||||||
#define END_PACK_STRUCTS pack ()
|
#define END_PACK_STRUCTS pack ()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define main morphos_main
|
|
||||||
|
|
||||||
#elif defined(__DC__)
|
#elif defined(__DC__)
|
||||||
|
|
||||||
#define scumm_stricmp strcasecmp
|
#define scumm_stricmp strcasecmp
|
||||||
@ -386,7 +385,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Overlay color type (FIXME: shouldn't be declared here)
|
// Overlay color type (FIXME: shouldn't be declared here)
|
||||||
//
|
//
|
||||||
@ -398,4 +396,5 @@
|
|||||||
typedef int16 OverlayColor;
|
typedef int16 OverlayColor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user