J :
* Key buffer update : Add functions & clean the file
This commit is contained in:
@@ -25,31 +25,35 @@
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#include <windows.h>
|
||||
#include <windows.h>
|
||||
|
||||
void JGEControl();
|
||||
BOOL JGEGetKeyState(int key);
|
||||
bool JGEGetButtonState(u32 button);
|
||||
bool JGEGetButtonClick(u32 button);
|
||||
void JGEControl();
|
||||
BOOL JGEGetKeyState(int key);
|
||||
bool JGEGetButtonState(u32 button);
|
||||
bool JGEGetButtonClick(u32 button);
|
||||
u32 JGEReadKey();
|
||||
void JGEResetInput();
|
||||
|
||||
#elif LINUX
|
||||
|
||||
void JGEControl();
|
||||
BOOL JGEGetKeyState(int key);
|
||||
bool JGEGetButtonState(uint32_t button);
|
||||
bool JGEGetButtonClick(uint32_t button);
|
||||
void JGEControl();
|
||||
BOOL JGEGetKeyState(int key);
|
||||
bool JGEGetButtonState(u32 button);
|
||||
bool JGEGetButtonClick(u32 button);
|
||||
u32 JGEReadKey();
|
||||
void JGEResetInput();
|
||||
|
||||
#else
|
||||
|
||||
#include <pspgu.h>
|
||||
#include <pspkernel.h>
|
||||
#include <pspdisplay.h>
|
||||
#include <pspdebug.h>
|
||||
#include <pspctrl.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <pspaudiolib.h>
|
||||
#include <psprtc.h>
|
||||
#include <pspgu.h>
|
||||
#include <pspkernel.h>
|
||||
#include <pspdisplay.h>
|
||||
#include <pspdebug.h>
|
||||
#include <pspctrl.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <pspaudiolib.h>
|
||||
#include <psprtc.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -71,13 +75,13 @@ class JMusic;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class JGE
|
||||
{
|
||||
private:
|
||||
private:
|
||||
JApp *mApp;
|
||||
// JResourceManager *mResourceManager;
|
||||
// JFileSystem* mFileSystem;
|
||||
// JResourceManager *mResourceManager;
|
||||
// JFileSystem* mFileSystem;
|
||||
|
||||
// JParticleSystem* mParticleSystem;
|
||||
// JMotionSystem* mMotionSystem;
|
||||
// JParticleSystem* mParticleSystem;
|
||||
// JMotionSystem* mMotionSystem;
|
||||
|
||||
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
@@ -112,7 +116,7 @@ private:
|
||||
static JGE* mInstance;
|
||||
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Get JGE instance.
|
||||
@@ -173,6 +177,22 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool GetButtonClick(u32 button);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Get the next keypress.
|
||||
///
|
||||
/// @return Next pressed button, or 0 if none.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
u32 ReadButton();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Reset the input buffer.
|
||||
/// This is necessary because there might be phases when GetButtonState
|
||||
/// or GetButtonClick are used, thereby accumulating keypresses in the
|
||||
/// key buffer.
|
||||
///
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void ResetInput();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
/// Get x value of the analog pad.
|
||||
///
|
||||
@@ -217,7 +237,7 @@ public:
|
||||
void SetDelta(int delta);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
protected:
|
||||
JGE();
|
||||
~JGE();
|
||||
|
||||
|
||||
@@ -88,11 +88,11 @@ JGE::JGE()
|
||||
mCurrentMusic = NULL;
|
||||
Init();
|
||||
|
||||
// mResourceManager = new JResourceManager();
|
||||
// mFileSystem = new JFileSystem();
|
||||
// mResourceManager = new JResourceManager();
|
||||
// mFileSystem = new JFileSystem();
|
||||
|
||||
// mParticleSystem = NULL;//new JParticleSystem(500);
|
||||
// mMotionSystem = NULL;//new JMotionSystem();
|
||||
// mParticleSystem = NULL;//new JParticleSystem(500);
|
||||
// mMotionSystem = NULL;//new JMotionSystem();
|
||||
|
||||
}
|
||||
|
||||
@@ -107,17 +107,17 @@ JGE::~JGE()
|
||||
//DestroyGfx();
|
||||
//DestroySfx();
|
||||
|
||||
// if (mResourceManager != NULL)
|
||||
// delete mResourceManager;
|
||||
//
|
||||
// if (mFileSystem != NULL)
|
||||
// delete mFileSystem;
|
||||
//
|
||||
// if (mParticleSystem != NULL)
|
||||
// delete mParticleSystem;
|
||||
//
|
||||
// if (mMotionSystem != NULL)
|
||||
// delete mMotionSystem;
|
||||
// if (mResourceManager != NULL)
|
||||
// delete mResourceManager;
|
||||
//
|
||||
// if (mFileSystem != NULL)
|
||||
// delete mFileSystem;
|
||||
//
|
||||
// if (mParticleSystem != NULL)
|
||||
// delete mParticleSystem;
|
||||
//
|
||||
// if (mMotionSystem != NULL)
|
||||
// delete mMotionSystem;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,11 +199,11 @@ JGE::JGE()
|
||||
|
||||
Init();
|
||||
|
||||
// mResourceManager = new JResourceManager();
|
||||
// mFileSystem = new JFileSystem();
|
||||
//
|
||||
// mParticleSystem = new JParticleSystem(500);
|
||||
// mMotionSystem = new JMotionSystem();
|
||||
// mResourceManager = new JResourceManager();
|
||||
// mFileSystem = new JFileSystem();
|
||||
//
|
||||
// mParticleSystem = new JParticleSystem(500);
|
||||
// mMotionSystem = new JMotionSystem();
|
||||
|
||||
}
|
||||
|
||||
@@ -216,17 +216,17 @@ JGE::~JGE()
|
||||
//DestroyGfx();
|
||||
//DestroySfx();
|
||||
|
||||
// delete mResourceManager;
|
||||
// delete mFileSystem;
|
||||
// delete mParticleSystem;
|
||||
// delete mMotionSystem;
|
||||
// delete mResourceManager;
|
||||
// delete mFileSystem;
|
||||
// delete mParticleSystem;
|
||||
// delete mMotionSystem;
|
||||
|
||||
// if (mApp != NULL)
|
||||
// {
|
||||
// mApp->Destroy();
|
||||
// delete mApp;
|
||||
// mApp = NULL;
|
||||
// }
|
||||
// if (mApp != NULL)
|
||||
// {
|
||||
// mApp->Destroy();
|
||||
// delete mApp;
|
||||
// mApp = NULL;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -259,8 +259,8 @@ void JGE::Init()
|
||||
|
||||
//Create();
|
||||
|
||||
// mCurrMS = 1.0f;
|
||||
// mFPSSlice = 0;
|
||||
// mCurrMS = 1.0f;
|
||||
// mFPSSlice = 0;
|
||||
|
||||
//struct timeval tp;
|
||||
//gettimeofday(&tp, NULL);
|
||||
@@ -441,9 +441,9 @@ void JGE::printf(const char *format, ...)
|
||||
vsprintf(mDebuggingMsg, format, list);
|
||||
va_end(list);
|
||||
|
||||
// FILE *f = fopen("jge.log", "a+");
|
||||
// fprintf(f, "%s\n", mDebuggingMsg);
|
||||
// fclose(f);
|
||||
// FILE *f = fopen("jge.log", "a+");
|
||||
// fprintf(f, "%s\n", mDebuggingMsg);
|
||||
// fclose(f);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user