#ifndef __LSDES_SYSTEM_H_ #define __LSDES_SYSTEM_H_ #include "../mx/mx.h" #include namespace es { typedef const char *(*GetName)(); typedef SDL_Surface *(*renderScr)(int *rt); typedef void (*syscall)(); typedef void (*axisMove)(int jid, int axis, int value); typedef void (*button_func)(int jid, int button); typedef char *(*ES_loadmod)(int *value); enum { BUTTON_A = 0, BUTTON_B = 1, BUTTON_C = 2, BUTTON_X = 3, BUTTON_Y = 4, BUTTON_Z = 5, BUTTON_R = 6 }; class systemController { public: systemController(SDL_Joystick *stick = 0); SDL_Joystick *stick; int which; bool key, arcade; int button[8]; int c_up, c_left, c_down, c_right; std::string name; void initXarcade(); }; class mainSystem : public mx::mxWnd { public: mainSystem(std::string exec, int w=-1, int h=-1, Uint32 flags=0); ~mainSystem(); virtual void eventPassed(SDL_Event &e); virtual void renderScreen(); void unload(); void loadObject(const char *src); void loadDash(); SDL_Surface *render_surface; bool resize; protected: int surface_w, surface_h; void *obj; bool ps3; axisMove m_axis; syscall initPlug, quitPlug; button_func joy_bd, joy_bu; renderScr rscr; GetName run_call; ES_loadmod module_prog; SDL_Joystick *j_one; int num_axis; mx::mxSurface surf_rez; mx::mxSurfacePainter p; SDL_Font *pfont; systemController player1, player2, syscontrol, arcade_control; void setupControls(); void initJoysticks(); void getKeys(mascToken *token, std::string v, systemController &syscontrol); void getControl(mascToken *token, std::string v); }; } #endif