mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
Add support for the Nokia N-Gage (#5597)
* Add initial support for the Nokia N-Gage * N-Gage: disable clipping for the time being, issue needs to be resolved later * Move va_copy definition to SDL_internal.h * Move stdlib.h include to SDL_config_ngage.h, much cleaner this way * Remove redundant include, add HAVE_STDLIB_H * Revert "N-Gage: disable clipping for the time being, issue needs to be resolved later" This reverts commit 4f5f0fc36cc7f34fad05e45671dfa7b8dc32fd51. * N-Gage: fix clipping issue by providing proper math functions
This commit is contained in:
committed by
GitHub
parent
3fcc2cb500
commit
fbd230bb6c
82
src/main/ngage/SDL_ngage_main.cpp
Normal file
82
src/main/ngage/SDL_ngage_main.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
EPOC version (originally for SDL 1.2) by Hannu Viitala
|
||||
(hannu.j.viitala@mbnet.fi).
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
/* Include the SDL main definition header */
|
||||
#include "SDL_main.h"
|
||||
|
||||
#include <e32std.h>
|
||||
#include <e32def.h>
|
||||
#include <e32svr.h>
|
||||
#include <e32base.h>
|
||||
#include <estlib.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <w32std.h>
|
||||
#include <apgtask.h>
|
||||
|
||||
#include "SDL_error.h"
|
||||
|
||||
extern "C" int main(int argc, char *argv[]);
|
||||
|
||||
TInt E32Main()
|
||||
{
|
||||
/* Get the clean-up stack */
|
||||
CTrapCleanup* cleanup = CTrapCleanup::New();
|
||||
|
||||
/* Arrange for multi-threaded operation */
|
||||
SpawnPosixServerThread();
|
||||
|
||||
/* Get args and environment */
|
||||
int argc = 0;
|
||||
char** argv = 0;
|
||||
char** envp = 0;
|
||||
|
||||
__crt0(argc,argv,envp);
|
||||
|
||||
/* Start the application! */
|
||||
|
||||
/* Create stdlib */
|
||||
_REENT;
|
||||
|
||||
/* Set process and thread priority and name */
|
||||
|
||||
RThread currentThread;
|
||||
RProcess thisProcess;
|
||||
TParse exeName;
|
||||
exeName.Set(thisProcess.FileName(), NULL, NULL);
|
||||
currentThread.Rename(exeName.Name());
|
||||
currentThread.SetProcessPriority(EPriorityLow);
|
||||
currentThread.SetPriority(EPriorityMuchLess);
|
||||
|
||||
/* Increase heap size */
|
||||
RHeap* newHeap = NULL;
|
||||
RHeap* oldHeap = NULL;
|
||||
TInt heapSize = 7500000;
|
||||
int ret;
|
||||
|
||||
newHeap = User::ChunkHeap(NULL, heapSize, heapSize, KMinHeapGrowBy);
|
||||
|
||||
if (NULL == newHeap)
|
||||
{
|
||||
ret = 3;
|
||||
goto cleanup;
|
||||
}
|
||||
else
|
||||
{
|
||||
oldHeap = User::SwitchHeap(newHeap);
|
||||
/* Call stdlib main */
|
||||
ret = main(argc, argv);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
_cleanup();
|
||||
|
||||
CloseSTDLIB();
|
||||
delete cleanup;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
Reference in New Issue
Block a user