mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-23 01:57:21 +03:00
Trying to get the keyboard working. The keys are already being detected correctly, but there’s still a part missing.
This commit is contained in:
parent
52d43468b3
commit
e0107274a5
2 changed files with 81 additions and 10 deletions
|
|
@ -38,6 +38,10 @@
|
|||
#include "Text.h"
|
||||
#include "Timer.h"
|
||||
|
||||
//debug
|
||||
//#include <e32cons.h>
|
||||
//LOCAL_D CConsoleBase* console;
|
||||
|
||||
psGlobalType psGlobal;
|
||||
|
||||
uint32 gGameState = 0;
|
||||
|
|
@ -143,15 +147,16 @@ void CapturePad(int padID) {
|
|||
RsPadButtonStatus bs;
|
||||
bs.padID = padID;
|
||||
|
||||
RsPadEventHandler(rsPADBUTTONUP, (void *)&bs);
|
||||
|
||||
{
|
||||
/*RsPadEventHandler(rsPADBUTTONUP, (void *)&bs);{
|
||||
if (CPad::m_bMapPadOneToPadTwo)
|
||||
bs.padID = 1;
|
||||
|
||||
RsPadEventHandler(rsPADBUTTONUP, (void *)&bs);
|
||||
RsPadEventHandler(rsPADBUTTONDOWN, (void *)&bs);
|
||||
}
|
||||
}*/
|
||||
|
||||
// solo avisar que hubo input
|
||||
RsPadEventHandler(rsPADBUTTONDOWN, &bs);
|
||||
|
||||
CPad *pad = CPad::GetPad(0);
|
||||
pad->PCTempJoyState.LeftStickX = (int32)(virtualLeftStickX * 128.0f);
|
||||
|
|
@ -312,6 +317,7 @@ public:
|
|||
TRACE("gGameState = GS_PLAYING_GAME;");
|
||||
break;
|
||||
case GS_PLAYING_GAME:
|
||||
CapturePad(0);
|
||||
// float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)tickPeriod; //(float)CTimer::GetCyclesPerMillisecond();
|
||||
// if ( RwInitialised )
|
||||
// {
|
||||
|
|
@ -335,10 +341,16 @@ public:
|
|||
}
|
||||
|
||||
void ConstructL(const TRect& aRect, CAknAppUi* aAppUi) {
|
||||
/*console = Console::NewL(_L("RE3 Debug"), TSize(KConsFullScreen, KConsFullScreen));
|
||||
console->Printf(_L("Console iniciada\n"));*/
|
||||
|
||||
iAppUi = aAppUi;
|
||||
CreateWindowL();
|
||||
iAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape);
|
||||
SetExtentToWholeScreen();
|
||||
|
||||
SetFocus(ETrue);
|
||||
|
||||
#ifdef RW_GL3
|
||||
Window().EnableAdvancedPointers();
|
||||
#endif
|
||||
|
|
@ -538,6 +550,63 @@ public:
|
|||
|
||||
CCoeControl::HandlePointerEventL(aPointerEvent);
|
||||
}
|
||||
|
||||
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType){
|
||||
bool pressed = (aType == EEventKeyDown);
|
||||
TUint scan = aKeyEvent.iScanCode;
|
||||
|
||||
/*if(console){
|
||||
console->Printf(_L("Scan: %d Type: %d\n"), aKeyEvent.iScanCode, aType);
|
||||
}*/
|
||||
|
||||
switch(scan)
|
||||
{
|
||||
// Flechas (DPAD)
|
||||
case 16: // arriba
|
||||
virtualButtons[JOY_DPAD_UP] = pressed;
|
||||
break;
|
||||
case 17: // abajo
|
||||
virtualButtons[JOY_DPAD_DOWN] = pressed;
|
||||
break;
|
||||
case 14: // izquierda
|
||||
virtualButtons[JOY_DPAD_LEFT] = pressed;
|
||||
break;
|
||||
case 15: // derecha
|
||||
virtualButtons[JOY_DPAD_RIGHT] = pressed;
|
||||
break;
|
||||
|
||||
// OK → X (PlayStation)
|
||||
case 167: // OK
|
||||
case 3: // Enter (algunos devices)
|
||||
virtualButtons[JOY_X] = pressed;
|
||||
break;
|
||||
|
||||
// Softkeys
|
||||
/*case 164: // softkey izquierdo
|
||||
virtualButtons[JOY_SELECT] = pressed;
|
||||
break;*/
|
||||
case 165: // softkey derecho
|
||||
virtualButtons[JOY_START] = pressed;
|
||||
break;
|
||||
|
||||
// Num keypad → botones
|
||||
case 49: virtualButtons[JOY_X] = pressed; break; // 1
|
||||
case 50: virtualButtons[JOY_B] = pressed; break; // 2 (circulo)
|
||||
case 51: virtualButtons[JOY_Y] = pressed; break; // 3 (triangulo)
|
||||
case 52: virtualButtons[JOY_A] = pressed; break; // 4 (cuadrado)
|
||||
|
||||
// Gatillos
|
||||
case 53: virtualButtons[JOY_LB] = pressed; break; // 5
|
||||
case 54: virtualButtons[JOY_RB] = pressed; break; // 6
|
||||
case 55: virtualButtons[JOY_LB] = pressed; break; // 7
|
||||
case 56: virtualButtons[JOY_RB] = pressed; break; // 8
|
||||
|
||||
default:
|
||||
return EKeyWasNotConsumed;
|
||||
}
|
||||
|
||||
return EKeyWasConsumed;
|
||||
}
|
||||
};
|
||||
|
||||
class RE3AppUi : public CAknAppUi {
|
||||
|
|
|
|||
10
vendor/librw/src/gles1/gl1device.cpp
vendored
10
vendor/librw/src/gles1/gl1device.cpp
vendored
|
|
@ -926,6 +926,10 @@ setWorldMatrix(Matrix *mat)
|
|||
int32
|
||||
setLights(WorldLights *lightData)
|
||||
{
|
||||
//sin luces. menos codigo
|
||||
glDisable(GL_LIGHTING);
|
||||
return 0;
|
||||
|
||||
int i, n;
|
||||
Light *l;
|
||||
int32 bits = 0;
|
||||
|
|
@ -988,9 +992,7 @@ setLights(WorldLights *lightData)
|
|||
|
||||
out:
|
||||
if(n > 0 || lightData->numAmbients > 0)
|
||||
//pruebo a ver que tal sin luz
|
||||
//glEnable(GL_LIGHTING);
|
||||
glDisable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHTING);
|
||||
else
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
|
|
@ -1017,7 +1019,6 @@ setViewMatrix(float32 *mat)
|
|||
sceneDirty = 1;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
setMaterial(const RGBA &color, const SurfaceProperties &surfaceprops, float extraSurfProp)
|
||||
{
|
||||
|
|
@ -1066,6 +1067,7 @@ flushCache(void)
|
|||
uniformStateDirty[RWGL_FOGSTART] ||
|
||||
uniformStateDirty[RWGL_FOGEND] ||
|
||||
uniformStateDirty[RWGL_FOGCOLOR]){
|
||||
glDisable(GL_FOG);
|
||||
if (rwStateCache.fogEnable) {
|
||||
glEnable(GL_FOG);
|
||||
glFogf(GL_FOG_MODE, GL_LINEAR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue