Commit c09ec283 authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

VirtualPad Macro fixes and more general cleanups

parent 4108ac3e
...@@ -7,13 +7,16 @@ Project(CommanderGenius) ...@@ -7,13 +7,16 @@ Project(CommanderGenius)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
option(USE_VIRTUALPAD "Enable Onscreen Virtual Gamepad support " yes)
if(USE_VIRTUALPAD)
ADD_DEFINITIONS(-DVIRTUALPAD)
endif(USE_VIRTUALPAD)
# Use COmpile TIme REducer # Use COmpile TIme REducer
include(cotire) include(cotire)
if(USE_SDL2S)
include(FindSDL2_mixer)
endif()
option(USE_PYTHON3 "Use Python3 scripts" yes) option(USE_PYTHON3 "Use Python3 scripts" yes)
set (CMAKE_CXX_STANDARD 14) set (CMAKE_CXX_STANDARD 14)
......
...@@ -7,18 +7,11 @@ Project(GsKit) ...@@ -7,18 +7,11 @@ Project(GsKit)
OPTION(USE_SDL2 "SDL2 support" Yes) OPTION(USE_SDL2 "SDL2 support" Yes)
option(USE_PYTHON3 "Use Python3 scripts" yes) option(USE_PYTHON3 "Use Python3 scripts" yes)
option(USE_VIRTUALPAD "Enable Onscreen Virtual Gamepad support " yes)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(USE_VIRTUALPAD)
ADD_DEFINITIONS(-DVIRTUALPAD)
endif(USE_VIRTUALPAD)
IF(WIN32) IF(WIN32)
ADD_DEFINITIONS(-DWIN32) ADD_DEFINITIONS(-DWIN32)
ENDIF(WIN32) ENDIF(WIN32)
......
...@@ -258,7 +258,7 @@ void CInput::loadControlconfig(void) ...@@ -258,7 +258,7 @@ void CInput::loadControlconfig(void)
else else
{ {
for(size_t c=1 ; c<= NUM_INPUTS ; c++) for(size_t c=1 ; c<= NUM_INPUTS ; c++)
resetControls(c); resetControls(int(c));
} }
} }
...@@ -274,26 +274,30 @@ void CInput::saveControlconfig() ...@@ -274,26 +274,30 @@ void CInput::saveControlconfig()
std::string section; std::string section;
for(size_t i=0 ; i<NUM_INPUTS ; i++) for(size_t i=0 ; i<NUM_INPUTS ; i++)
{ {
section = "input" + itoa(i); section = "input" + itoa(i);
Configuration.WriteString(section, "Left", getEventName(IC_LEFT, i));
Configuration.WriteString(section, "Up", getEventName(IC_UP, i)); const auto inputVal = static_cast<unsigned char>(i);
Configuration.WriteString(section, "Right", getEventName(IC_RIGHT, i));
Configuration.WriteString(section, "Down", getEventName(IC_DOWN, i)); Configuration.WriteString(section, "Left", getEventName(IC_LEFT, inputVal));
Configuration.WriteString(section, "Upper-Left", getEventName(IC_UPPERLEFT, i)); Configuration.WriteString(section, "Up", getEventName(IC_UP, inputVal));
Configuration.WriteString(section, "Upper-Right", getEventName(IC_UPPERRIGHT, i)); Configuration.WriteString(section, "Right", getEventName(IC_RIGHT, inputVal));
Configuration.WriteString(section, "Lower-Left", getEventName(IC_LOWERLEFT, i)); Configuration.WriteString(section, "Down", getEventName(IC_DOWN, inputVal));
Configuration.WriteString(section, "Lower-Right", getEventName(IC_LOWERRIGHT, i)); Configuration.WriteString(section, "Upper-Left", getEventName(IC_UPPERLEFT, inputVal));
Configuration.WriteString(section, "Jump", getEventName(IC_JUMP, i)); Configuration.WriteString(section, "Upper-Right", getEventName(IC_UPPERRIGHT, inputVal));
Configuration.WriteString(section, "Pogo", getEventName(IC_POGO, i)); Configuration.WriteString(section, "Lower-Left", getEventName(IC_LOWERLEFT, inputVal));
Configuration.WriteString(section, "Fire", getEventName(IC_FIRE, i)); Configuration.WriteString(section, "Lower-Right", getEventName(IC_LOWERRIGHT, inputVal));
Configuration.WriteString(section, "Run", getEventName(IC_RUN, i)); Configuration.WriteString(section, "Jump", getEventName(IC_JUMP, inputVal));
Configuration.WriteString(section, "Status", getEventName(IC_STATUS, i)); Configuration.WriteString(section, "Pogo", getEventName(IC_POGO, inputVal));
Configuration.WriteString(section, "Camlead", getEventName(IC_CAMLEAD, i)); Configuration.WriteString(section, "Fire", getEventName(IC_FIRE, inputVal));
Configuration.WriteString(section, "Help", getEventName(IC_HELP, i)); Configuration.WriteString(section, "Run", getEventName(IC_RUN, inputVal));
Configuration.WriteString(section, "Back", getEventName(IC_BACK, i)); Configuration.WriteString(section, "Status", getEventName(IC_STATUS, inputVal));
Configuration.SetKeyword(section, "TwoButtonFiring", TwoButtonFiring[i]); Configuration.WriteString(section, "Camlead", getEventName(IC_CAMLEAD, inputVal));
Configuration.SetKeyword(section, "Analog", mAnalogAxesMovement[i]); Configuration.WriteString(section, "Help", getEventName(IC_HELP, inputVal));
Configuration.WriteString(section, "Back", getEventName(IC_BACK, inputVal));
Configuration.SetKeyword(section, "TwoButtonFiring", TwoButtonFiring[i]);
Configuration.SetKeyword(section, "Analog", mAnalogAxesMovement[i]);
} }
Configuration.saveCfgFile(); Configuration.saveCfgFile();
} }
......
...@@ -160,7 +160,7 @@ class CInput : public GsSingleton<CInput> ...@@ -160,7 +160,7 @@ class CInput : public GsSingleton<CInput>
public: public:
CInput(); CInput();
~CInput(); virtual ~CInput();
/** /**
* @brief transMouseRelCoord transforms a mouse click from the screen coordinates to the relative coordinates * @brief transMouseRelCoord transforms a mouse click from the screen coordinates to the relative coordinates
......
...@@ -251,15 +251,14 @@ void GsApp::runMainCycle() ...@@ -251,15 +251,14 @@ void GsApp::runMainCycle()
curr = timerTicks(); curr = timerTicks();
if(gTimer.resetLogicSignal()) if(gTimer.resetLogicSignal())
start = curr; start = curr;
if(vsyncEnabled) if(vsyncEnabled)
{ {
start = timerTicks(); start = timerTicks();
// Game cycle // Game cycle
{ {
// Poll Inputs // Poll Inputs
gInput.pollEvents(); gInput.pollEvents();
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
* Author: gerstrong * Author: gerstrong
*/ */
#ifndef __GSAPP_H_ #ifndef GSAPP_H_
#define GSAPP_H #define GSAPP_H_
#include <base/GsEvent.h> #include <base/GsEvent.h>
#include <base/GsEngine.h> #include <base/GsEngine.h>
......
...@@ -56,9 +56,9 @@ public: ...@@ -56,9 +56,9 @@ public:
stInputCommand* cmd = nullptr; //stInputCommand* cmd = nullptr;
int immediateIndex = 0; int immediateIndex = 0;
//int x = 0, y = 0, w = 0, h = 0;
float x = 0.0f, y = 0.0f, w = 0.0f, h = 0.0f; float x = 0.0f, y = 0.0f, w = 0.0f, h = 0.0f;
bool invisible = true; bool invisible = true;
...@@ -77,8 +77,6 @@ public: ...@@ -77,8 +77,6 @@ public:
return !mFingerSet.empty(); return !mFingerSet.empty();
} }
//private:
std::set<SDL_FingerID> mFingerSet; std::set<SDL_FingerID> mFingerSet;
#endif #endif
...@@ -98,7 +96,7 @@ public: ...@@ -98,7 +96,7 @@ public:
/** /**
* @brief GsVirtualInput basic constructor, just setup some variables. * @brief GsVirtualInput basic constructor, just setup some variables.
*/ */
GsVirtualInput() {} //GsVirtualInput() {}
virtual ~GsVirtualInput() {} virtual ~GsVirtualInput() {}
...@@ -186,8 +184,6 @@ protected: ...@@ -186,8 +184,6 @@ protected:
bool mEnabled = true; bool mEnabled = true;
//GsSurface mOverlay;
float mTranslucency = 0.5f; float mTranslucency = 0.5f;
}; };
......
...@@ -18,47 +18,56 @@ ...@@ -18,47 +18,56 @@
/////////////////// ///////////////////
// If you want to use the adress of some Uint32 directly with memcpy or similar, use this // If you want to use the adress of some Uint32 directly with memcpy or similar, use this
inline Uint32 SDLColourToNativeColour(Uint32 pixel, short bpp) { /*
inline Uint32 SDLColourToNativeColour(Uint32 pixel, short bpp)
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN #if SDL_BYTEORDER == SDL_BIG_ENDIAN
return (pixel << (32 - 8 * bpp)); return (pixel << (32 - 8 * bpp));
#else #else
return pixel; return pixel;
#endif #endif
} }
*/
///////////////// /////////////////
// If you copied some data directly with memcpy into an Uint32, use this // If you copied some data directly with memcpy into an Uint32, use this
inline Uint32 NativeColourToSDLColour(Uint32 pixel, short bpp) { /*
inline Uint32 NativeColourToSDLColour(Uint32 pixel, short bpp)
{
#if SDL_BYTEORDER == SDL_BIG_ENDIAN #if SDL_BYTEORDER == SDL_BIG_ENDIAN
return (pixel >> (32 - 8 * bpp)); return (pixel >> (32 - 8 * bpp));
#else #else
return pixel; return pixel;
#endif #endif
} }
*/
/////////////// ///////////////
// Get the specified component from the pixel (grabbed from SDL) // Get the specified component from the pixel (grabbed from SDL)
inline Uint8 GetR(Uint32 pixel, SDL_PixelFormat *fmt) { /*
inline Uint8 GetR(Uint32 pixel, SDL_PixelFormat *fmt)
{
return (Uint8)((((pixel & fmt->Rmask) >> fmt->Rshift) << fmt->Rloss) + return (Uint8)((((pixel & fmt->Rmask) >> fmt->Rshift) << fmt->Rloss) +
(((pixel & fmt->Rmask) >> fmt->Rshift) >> (8 - (fmt->Rloss << 1)))); (((pixel & fmt->Rmask) >> fmt->Rshift) >> (8 - (fmt->Rloss << 1))));
} }
inline Uint8 GetG(Uint32 pixel, SDL_PixelFormat *fmt) { inline Uint8 GetG(Uint32 pixel, SDL_PixelFormat *fmt)
{
return (Uint8)((((pixel & fmt->Gmask) >> fmt->Gshift) << fmt->Gloss) + return (Uint8)((((pixel & fmt->Gmask) >> fmt->Gshift) << fmt->Gloss) +
(((pixel & fmt->Gmask) >> fmt->Gshift) >> (8 - (fmt->Gloss << 1)))); (((pixel & fmt->Gmask) >> fmt->Gshift) >> (8 - (fmt->Gloss << 1))));
} }
inline Uint8 GetB(Uint32 pixel, SDL_PixelFormat *fmt) { inline Uint8 GetB(Uint32 pixel, SDL_PixelFormat *fmt)
{
return (Uint8)((((pixel & fmt->Bmask) >> fmt->Bshift) << fmt->Bloss) + return (Uint8)((((pixel & fmt->Bmask) >> fmt->Bshift) << fmt->Bloss) +
(((pixel & fmt->Bmask) >> fmt->Bshift) >> (8 - (fmt->Bloss << 1)))); (((pixel & fmt->Bmask) >> fmt->Bshift) >> (8 - (fmt->Bloss << 1))));
} }
inline Uint8 GetA(Uint32 pixel, SDL_PixelFormat *fmt) { inline Uint8 GetA(Uint32 pixel, SDL_PixelFormat *fmt)
{
return (Uint8)((((pixel & fmt->Amask) >> fmt->Ashift) << fmt->Aloss) + return (Uint8)((((pixel & fmt->Amask) >> fmt->Ashift) << fmt->Aloss) +
(((pixel & fmt->Amask) >> fmt->Ashift) >> (8 - (fmt->Aloss << 1)))); (((pixel & fmt->Amask) >> fmt->Ashift) >> (8 - (fmt->Aloss << 1))));
} }
*/
//extern SDL_PixelFormat* mainPixelFormat; //extern SDL_PixelFormat* mainPixelFormat;
/*inline SDL_PixelFormat* getMainPixelFormat() /*inline SDL_PixelFormat* getMainPixelFormat()
...@@ -136,14 +145,16 @@ struct GsColor ...@@ -136,14 +145,16 @@ struct GsColor
*/ */
void converge(GsColor &&c) void converge(GsColor &&c)
{ {
r = (Uint16(r) + Uint16(c.r))/2; r = Uint8((Uint16(r) + Uint16(c.r))/2);
g = (Uint16(g) + Uint16(c.g))/2; g = Uint8((Uint16(g) + Uint16(c.g))/2);
b = (Uint16(b) + Uint16(c.b))/2; b = Uint8((Uint16(b) + Uint16(c.b))/2);
a = (Uint16(a) + Uint16(c.a))/2; a = Uint8((Uint16(a) + Uint16(c.a))/2);
} }
Uint8& operator[](int i) { switch(i) { case 0: return r; case 1: return g; case 2: return b; case 3: return a; default: assert(false); } return *((Uint8*)NULL); } /*
Uint8 operator[](int i) const { switch(i) { case 0: return r; case 1: return g; case 2: return b; case 3: return a; default: assert(false); } return 0; } Uint8& operator[](int i) { switch(i) { case 0: return r; case 1: return g; case 2: return b; case 3: return a; default: assert(false); } return *(reinterpret_cast<Uint8*>(0)); }
Uint8 operator[](int i) const { switch(i) { case 0: return r; case 1: return g; case 2: return b; case 3: return a; default: assert(false); } return 0; }
*/
}; };
#endif // COLOR_H #endif // COLOR_H
...@@ -111,6 +111,7 @@ static inline void scale2x_8_def_whole(scale2x_uint8* restrict dst0, scale2x_uin ...@@ -111,6 +111,7 @@ static inline void scale2x_8_def_whole(scale2x_uint8* restrict dst0, scale2x_uin
} }
} }
#ifndef USE_SCALE_RANDOMWRITE
static inline void scale2x_8_def_border(scale2x_uint8* restrict dst, const scale2x_uint8* restrict src0, const scale2x_uint8* restrict src1, const scale2x_uint8* restrict src2, unsigned count) static inline void scale2x_8_def_border(scale2x_uint8* restrict dst, const scale2x_uint8* restrict src0, const scale2x_uint8* restrict src1, const scale2x_uint8* restrict src2, unsigned count)
{ {
assert(count >= 2); assert(count >= 2);
...@@ -155,6 +156,7 @@ static inline void scale2x_8_def_border(scale2x_uint8* restrict dst, const scale ...@@ -155,6 +156,7 @@ static inline void scale2x_8_def_border(scale2x_uint8* restrict dst, const scale
dst[1] = src1[0]; dst[1] = src1[0];
} }
} }
#endif
static inline void scale2x_8_def_center(scale2x_uint8* restrict dst, const scale2x_uint8* restrict src0, const scale2x_uint8* restrict src1, const scale2x_uint8* restrict src2, unsigned count) static inline void scale2x_8_def_center(scale2x_uint8* restrict dst, const scale2x_uint8* restrict src0, const scale2x_uint8* restrict src1, const scale2x_uint8* restrict src2, unsigned count)
{ {
...@@ -409,6 +411,8 @@ static inline void scale2x_32_def_whole(scale2x_uint32* restrict dst0, scale2x_u ...@@ -409,6 +411,8 @@ static inline void scale2x_32_def_whole(scale2x_uint32* restrict dst0, scale2x_u
} }
} }
#ifndef USE_SCALE_RANDOMWRITE
static inline void scale2x_32_def_border(scale2x_uint32* restrict dst, const scale2x_uint32* restrict src0, const scale2x_uint32* restrict src1, const scale2x_uint32* restrict src2, unsigned count) static inline void scale2x_32_def_border(scale2x_uint32* restrict dst, const scale2x_uint32* restrict src0, const scale2x_uint32* restrict src1, const scale2x_uint32* restrict src2, unsigned count)
{ {
assert(count >= 2); assert(count >= 2);
...@@ -453,6 +457,7 @@ static inline void scale2x_32_def_border(scale2x_uint32* restrict dst, const sca ...@@ -453,6 +457,7 @@ static inline void scale2x_32_def_border(scale2x_uint32* restrict dst, const sca
dst[1] = src1[0]; dst[1] = src1[0];
} }
} }
#endif
static inline void scale2x_32_def_center(scale2x_uint32* restrict dst, const scale2x_uint32* restrict src0, const scale2x_uint32* restrict src1, const scale2x_uint32* restrict src2, unsigned count) static inline void scale2x_32_def_center(scale2x_uint32* restrict dst, const scale2x_uint32* restrict src0, const scale2x_uint32* restrict src1, const scale2x_uint32* restrict src2, unsigned count)
{ {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <graphics/GsGraphics.h> #include <graphics/GsGraphics.h>
#include <base/GsLogging.h> #include <base/GsLogging.h>
const unsigned int MAX_ELEMENTS_PER_PAGE = 7; //const unsigned int MAX_ELEMENTS_PER_PAGE = 7;
const unsigned int MAX_STEPS = 20; const unsigned int MAX_STEPS = 20;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
you feel merit inclusion in the source tree email them you feel merit inclusion in the source tree email them
to me at gerstrong@gmail.com. to me at gerstrong@gmail.com.
Thanks to ID Software for the "Commander Keen" series. Thanks to ID Software for the "Commander Keen" series.
"Commander Keen" and it's associated "Commander Keen" and it's associated
graphics, level, and sound files are the property of ID graphics, level, and sound files are the property of ID
Software. Commander Genius requires the original version of a Software. Commander Genius requires the original version of a
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#ifdef ANDROID #ifdef ANDROID
#include <SDL_main.h> #include <SDL_main.h>
#endif #endif
#include <base/utils/FindFile.h> #include <base/utils/FindFile.h>
...@@ -64,54 +64,54 @@ int main(int argc, char *argv[]) ...@@ -64,54 +64,54 @@ int main(int argc, char *argv[])
{ {
#if SDL_VERSION_ATLEAST(2, 0, 0) #if SDL_VERSION_ATLEAST(2, 0, 0)
#ifdef ANDROID #ifdef ANDROID
SDL_SetMainReady( ); SDL_SetMainReady( );
#endif #endif
#endif #endif
// Check if CG should look into a given directory // Check if CG should look into a given directory
std::string binary_dir; std::string binary_dir;
if(argc >= 1) if(argc >= 1)
{ {
binary_dir = argv[0]; binary_dir = argv[0];
size_t slashpos = findLastPathSep(binary_dir); size_t slashpos = findLastPathSep(binary_dir);
if(slashpos != std::string::npos) if(slashpos != std::string::npos)
{ {
binary_dir.erase(slashpos); binary_dir.erase(slashpos);
binary_dir = SystemNativeToUtf8(binary_dir); binary_dir = SystemNativeToUtf8(binary_dir);
} }
else else
{ {
binary_dir = "."; binary_dir = ".";
} }
} }
else else
{ {
warnings << "Binary-argument not given, assuming current dir" << endl; warnings << "Binary-argument not given, assuming current dir" << endl;
binary_dir = "."; binary_dir = ".";
} }
SetBinaryDir( GetAbsolutePath(binary_dir) ); SetBinaryDir( GetAbsolutePath(binary_dir) );
InitThreadPool(); InitThreadPool();
InitSearchPaths(gSettings.getConfigFileName()); InitSearchPaths(gSettings.getConfigFileName());
if( !gLogging.CreateLogfile("CGLog.html", APP_NAME, CGVERSION) ) if( !gLogging.CreateLogfile("CGLog.html", APP_NAME, CGVERSION) )
{ {
errors << "Not even able to create \"CGLog.html\"." << endl; errors << "Not even able to create \"CGLog.html\"." << endl;
return 1; return 1;
} }
// Init Video Driver with SDL all together // Init Video Driver with SDL all together
if( !gVideoDriver.init() ) if( !gVideoDriver.init() )
{ {
return 1; return 1;
} }
// Check if there are settings on the PC, otherwise use defaults. // Check if there are settings on the PC, otherwise use defaults.
if( !gSettings.loadDrvCfg() ) if( !gSettings.loadDrvCfg() )
{ {
//m_firsttime = true; //m_firsttime = true;
gLogging.textOut(FONTCOLORS::RED,"First time message: CG didn't find the driver config file. "); gLogging.textOut(FONTCOLORS::RED,"First time message: CG didn't find the driver config file. ");
...@@ -133,7 +133,7 @@ int main(int argc, char *argv[]) ...@@ -133,7 +133,7 @@ int main(int argc, char *argv[])
// Initialize CG and run the main cycle if worthy // // Initialize CG and run the main cycle if worthy //
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
if( gApp.init( argc, argv ) ) if( gApp.init( argc, argv ) )
{ {
//////////////////////////////// ////////////////////////////////
// Set GameLauncher as Engine // // Set GameLauncher as Engine //
//////////////////////////////// ////////////////////////////////
...@@ -143,10 +143,10 @@ int main(int argc, char *argv[]) ...@@ -143,10 +143,10 @@ int main(int argc, char *argv[])
// Run the Commander Genius // // Run the Commander Genius //
////////////////////////////// //////////////////////////////
gApp.runMainCycle(); gApp.runMainCycle();
} }
gSettings.saveDispCfg(); gSettings.saveDispCfg();
UnInitThreadPool(); UnInitThreadPool();
return 0; return 0;
} }
...@@ -661,19 +661,19 @@ void CGameLauncher::pumpEvent(const CEvent *evPtr) ...@@ -661,19 +661,19 @@ void CGameLauncher::pumpEvent(const CEvent *evPtr)
if( const MouseWheelEvent *mwe = dynamic_cast<const MouseWheelEvent*>(evPtr) ) if( const MouseWheelEvent *mwe = dynamic_cast<const MouseWheelEvent*>(evPtr) )
{ {
// Wrapper for the simple mouse scroll event // Wrapper for the simple mouse scroll event
if(mwe->amount.y > 0.0) if(mwe->amount.y > 0.0f)
{ {
mLauncherDialog.sendEvent(new CommandEvent( IC_UP )); mLauncherDialog.sendEvent(new CommandEvent( IC_UP ));
} }
else if(mwe->amount.y < 0.0) else if(mwe->amount.y < 0.0f)
{ {
mLauncherDialog.sendEvent(new CommandEvent( IC_DOWN )); mLauncherDialog.sendEvent(new CommandEvent( IC_DOWN ));
} }
if(mwe->amount.x < 0.0) if(mwe->amount.x < 0.0f)
{ {
mLauncherDialog.sendEvent(new CommandEvent( IC_RIGHT )); mLauncherDialog.sendEvent(new CommandEvent( IC_RIGHT ));
} }
else if(mwe->amount.x > 0.0) else if(mwe->amount.x > 0.0f)
{ {
mLauncherDialog.sendEvent(new CommandEvent( IC_LEFT )); mLauncherDialog.sendEvent(new CommandEvent( IC_LEFT ));
} }
......
...@@ -20,8 +20,8 @@ size_t bulletActionMap[] = ...@@ -20,8 +20,8 @@ size_t bulletActionMap[] =
namespace galaxy namespace galaxy
{ {
const Uint32 speed = 10; //const Uint32 speed = 10;
const Uint32 hittime = 100; //const Uint32 hittime = 100;
CBullet::CBullet(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y, CBullet::CBullet(CMap *pmap, const Uint16 foeID, const Uint32 x, const Uint32 y,
const int xDir, const int yDir, const int sprVar) : const int xDir, const int yDir, const int sprVar) :
......
...@@ -29,43 +29,43 @@ ...@@ -29,43 +29,43 @@
#include <array> #include <array>
struct EventEnterLevel : CEvent { struct EventEnterLevel : CEvent {
uint16_t data; uint16_t data;
int mSprVar = 0; int mSprVar = 0;
EventEnterLevel(const int sprVar, EventEnterLevel(const int sprVar,
const uint16_t d) : data(d), const uint16_t d) : data(d),
mSprVar(sprVar) {} mSprVar(sprVar) {}
}; };
struct EventExitLevel : CEvent { struct EventExitLevel : CEvent {
const uint16_t levelObject; const uint16_t levelObject;
const bool sucess; const bool sucess;
const bool teleport; const bool teleport;
const int who; const int who;
bool playSound = false; bool playSound = false;
EventExitLevel(const uint16_t l, const bool s, const bool t, const bool lWho) : EventExitLevel(const uint16_t l, const bool s, const bool t, const bool lWho) :
levelObject(l), sucess(s), teleport(t), who(lWho) {} levelObject(l), sucess(s), teleport(t), who(lWho) {}
}; };
struct EventExitLevelWithFoot : CEvent { struct EventExitLevelWithFoot : CEvent {
const uint16_t levelObject; const uint16_t levelObject;
const int who; const int who;
EventExitLevelWithFoot(const uint16_t l, const int lWho) : levelObject(l), who(lWho) {} EventExitLevelWithFoot(const uint16_t l, const int lWho) : levelObject(l), who(lWho) {}
}; };
struct EventDieKeenPlayer : CEvent struct EventDieKeenPlayer : CEvent
{ {
const int playerID; const int playerID;
const bool gameOver; const bool gameOver;
const int levelObj; const int levelObj;
const std::string levelName; const std::string levelName;
EventDieKeenPlayer(const int id, const bool go, const int lo, const std::string &ln) : EventDieKeenPlayer(const int id, const bool go, const int lo, const std::string &ln) :
playerID(id), gameOver(go), playerID(id), gameOver(go),
levelObj(lo), levelName(ln){} levelObj(lo), levelName(ln){}
}; };
...@@ -73,59 +73,59 @@ namespace galaxy ...@@ -73,59 +73,59 @@ namespace galaxy
{ {
enum PLAYER_ACTIONS enum PLAYER_ACTIONS
{ {
A_KEEN_STAND = 0, A_KEEN_STAND = 0,
A_KEEN_ON_PLAT, A_KEEN_ON_PLAT,
A_KEEN_BORED, A_KEEN_BORED,
A_KEEN_QUESTION,