mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 02:20:25 +01:00
Added PYRA option (also inverted Shoulder buttons function on Pandora/Pyra build)
This commit is contained in:
parent
7aabe0bd70
commit
f777ad622b
|
@ -106,10 +106,16 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*")
|
||||||
if(PYRA)
|
if(PYRA)
|
||||||
add_compile_options(-mfpu=neon-vfpv4)
|
add_compile_options(-mfpu=neon-vfpv4)
|
||||||
elseif(NOT (MACOSX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"))
|
add_compile_options(-mcpu=cortex-a15)
|
||||||
add_compile_options(-mfpu=neon)
|
add_compile_options(-mfloat-abi=hard)
|
||||||
|
add_compile_options(-marm)
|
||||||
|
elseif(NOT (MACOSX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"))
|
||||||
|
add_compile_options(-mfpu=neon)
|
||||||
|
else()
|
||||||
|
add_compile_options(-mfpu=neon)
|
||||||
endif()
|
endif()
|
||||||
|
add_compile_options(-fsigned-char)
|
||||||
endif()
|
endif()
|
||||||
add_compile_options(-fno-strict-aliasing)
|
add_compile_options(-fno-strict-aliasing)
|
||||||
add_definitions(-D_REENTRANT=1)
|
add_definitions(-D_REENTRANT=1)
|
||||||
|
|
|
@ -50,10 +50,10 @@ BOOL PeekMessage(MSG *msg, void *hwnd, UINT wMsgFilterMin,
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
if (sdlevent.key.keysym.sym == SDLK_BACKQUOTE)
|
if (sdlevent.key.keysym.sym == SDLK_BACKQUOTE)
|
||||||
msg->unicode = '~'; // !!! FIXME: this is all a hack.
|
msg->unicode = '~'; // !!! FIXME: this is all a hack.
|
||||||
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
#if defined(PLATFORM_PANDORA) || defined(PPLATFORM_PYRA)
|
||||||
if(sdlevent.key.keysym.sym == SDLK_RCTRL) {
|
if(sdlevent.key.keysym.sym == SDLK_RSHIFT) {
|
||||||
msg->message = (sdlevent.type==SDL_KEYDOWN)?WM_RBUTTONDOWN:WM_RBUTTONUP;
|
msg->message = (sdlevent.type==SDL_KEYDOWN)?WM_RBUTTONDOWN:WM_RBUTTONUP;
|
||||||
} else if(sdlevent.key.keysym.sym == SDLK_RSHIFT) {
|
} else if(sdlevent.key.keysym.sym == SDLK_RCTRL) {
|
||||||
msg->message = (sdlevent.type==SDL_KEYDOWN)?WM_LBUTTONDOWN:WM_LBUTTONUP;
|
msg->message = (sdlevent.type==SDL_KEYDOWN)?WM_LBUTTONDOWN:WM_LBUTTONUP;
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
@ -115,7 +115,7 @@ SHORT GetKeyState(int vk)
|
||||||
{
|
{
|
||||||
SHORT retval = 0;
|
SHORT retval = 0;
|
||||||
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
||||||
Uint8 *keystate = SDL_GetKeyboardState(NULL);
|
const Uint8 *keystate = SDL_GetKeyboardState(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (vk)
|
switch (vk)
|
||||||
|
@ -124,7 +124,7 @@ SHORT GetKeyState(int vk)
|
||||||
if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_LMASK)
|
if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_LMASK)
|
||||||
retval = 0x8000;
|
retval = 0x8000;
|
||||||
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
||||||
if(keystate[SDL_SCANCODE_RSHIFT])
|
if(keystate[SDL_SCANCODE_RCTRL])
|
||||||
retval = 0x8000;
|
retval = 0x8000;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -133,7 +133,7 @@ SHORT GetKeyState(int vk)
|
||||||
if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_RMASK)
|
if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_RMASK)
|
||||||
retval = 0x8000;
|
retval = 0x8000;
|
||||||
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
||||||
if(keystate[SDL_SCANCODE_RCTRL])
|
if(keystate[SDL_SCANCODE_RSHIFT])
|
||||||
retval = 0x8000;
|
retval = 0x8000;
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -288,11 +288,11 @@ static void SetKeyFromEvent(const SDL_Event *event, const BOOL bDown)
|
||||||
return;
|
return;
|
||||||
} // if
|
} // if
|
||||||
|
|
||||||
#ifdef PLATFORM_PANDORA
|
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
||||||
if(event->key.keysym.sym==SDLK_RSHIFT) {
|
if(event->key.keysym.sym==SDLK_RCTRL) {
|
||||||
_abKeysPressed[KID_MOUSE1] = bDown;
|
_abKeysPressed[KID_MOUSE1] = bDown;
|
||||||
return;
|
return;
|
||||||
} else if(event->key.keysym.sym==SDLK_RCTRL) {
|
} else if(event->key.keysym.sym==SDLK_RSHIFT) {
|
||||||
_abKeysPressed[KID_MOUSE2] = bDown;
|
_abKeysPressed[KID_MOUSE2] = bDown;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -887,7 +887,7 @@ nextRowO:
|
||||||
UWORD words[4];
|
UWORD words[4];
|
||||||
WORD iwords[4];
|
WORD iwords[4];
|
||||||
UBYTE bytes[8];
|
UBYTE bytes[8];
|
||||||
};
|
} __attribute__((packed)); //avoid optimisation and BUSERROR on Pyra build
|
||||||
for (int i=0; i<pixHeight; i++) {
|
for (int i=0; i<pixHeight; i++) {
|
||||||
int idx = i&3;
|
int idx = i&3;
|
||||||
uConv dith;
|
uConv dith;
|
||||||
|
|
|
@ -370,7 +370,7 @@ void Quaternion<Type>::FromEuler(const Vector<Type, 3> &a)
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Type Quaternion<Type>::EPS(Type orig) const
|
Type Quaternion<Type>::EPS(Type orig) const
|
||||||
{
|
{
|
||||||
#ifdef PLATFORM_PANDORA
|
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
||||||
if ((orig <= 1e-4f) && (orig >= -1e-4f))
|
if ((orig <= 1e-4f) && (orig >= -1e-4f))
|
||||||
#else
|
#else
|
||||||
if ((orig <= 10e-6f) && (orig >= -10e-6f))
|
if ((orig <= 10e-6f) && (orig >= -10e-6f))
|
||||||
|
|
|
@ -310,7 +310,7 @@ Rect ExtractPolygonsInBox(CTerrain *ptrTerrain, const FLOATaabbox3D &bboxExtract
|
||||||
if(!bFixSize) {
|
if(!bFixSize) {
|
||||||
// max vector of bbox in incremented for one, because first vertex is at 0,0,0 in world and in heightmap is at 1,1
|
// max vector of bbox in incremented for one, because first vertex is at 0,0,0 in world and in heightmap is at 1,1
|
||||||
#ifdef __arm__
|
#ifdef __arm__
|
||||||
#ifdef PLATFORM_PANDORA
|
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
||||||
#define Isinf(a) (((*(unsigned int*)&a)&0x7fffffff)==0x7f800000)
|
#define Isinf(a) (((*(unsigned int*)&a)&0x7fffffff)==0x7f800000)
|
||||||
#else
|
#else
|
||||||
#define Isinf isinff
|
#define Isinf isinff
|
||||||
|
|
|
@ -48,7 +48,7 @@ static inline void BoxToGrid(
|
||||||
FLOAT fMaxX = boxEntity.Max()(1);
|
FLOAT fMaxX = boxEntity.Max()(1);
|
||||||
FLOAT fMaxZ = boxEntity.Max()(3);
|
FLOAT fMaxZ = boxEntity.Max()(3);
|
||||||
#ifdef __arm__
|
#ifdef __arm__
|
||||||
#ifdef PLATFORM_PANDORA
|
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
|
||||||
#define Isinf(a) (((*(unsigned int*)&a)&0x7fffffff)==0x7f800000)
|
#define Isinf(a) (((*(unsigned int*)&a)&0x7fffffff)==0x7f800000)
|
||||||
#else
|
#else
|
||||||
#define Isinf isinff
|
#define Isinf isinff
|
||||||
|
|
|
@ -286,7 +286,7 @@ static void UpdatePauseState(void)
|
||||||
void LimitFrameRate(void)
|
void LimitFrameRate(void)
|
||||||
{
|
{
|
||||||
// do not limit FPS on the Pandora, it's not powerfull enough and doesn't "iconise" games either
|
// do not limit FPS on the Pandora, it's not powerfull enough and doesn't "iconise" games either
|
||||||
#ifndef PLATFORM_PANDORA
|
#if !defined(PLATFORM_PANDORA) && !defined(PLATFORM_PYRA)
|
||||||
// measure passed time for each loop
|
// measure passed time for each loop
|
||||||
static CTimerValue tvLast(-1.0f);
|
static CTimerValue tvLast(-1.0f);
|
||||||
CTimerValue tvNow = _pTimer->GetHighPrecisionTimer();
|
CTimerValue tvNow = _pTimer->GetHighPrecisionTimer();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user