Added the GRAPHICS flag, to simplify the gameplay structures
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. scenes ../common/gameplay ../common/graphics ../common/map ../common/network ../common/ui ../common/utilities
|
INCLUDES+=. scenes ../common/gameplay ../common/graphics ../common/map ../common/network ../common/ui ../common/utilities
|
||||||
LIBS+=libclient.a ../libcommon.a -lSDL_net -lwsock32 -liphlpapi -lmingw32 -lSDLmain -lSDL -llua
|
LIBS+=libclient.a ../libcommon.a -lSDL_net -lwsock32 -liphlpapi -lmingw32 -lSDLmain -lSDL -llua
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES)) -DGRAPHICS
|
||||||
|
|
||||||
#source
|
#source
|
||||||
CXXSRC=$(wildcard *.cpp)
|
CXXSRC=$(wildcard *.cpp)
|
||||||
|
|||||||
@@ -42,6 +42,9 @@
|
|||||||
#include "config_utility.hpp"
|
#include "config_utility.hpp"
|
||||||
#include "frame_rate.hpp"
|
#include "frame_rate.hpp"
|
||||||
|
|
||||||
|
#include "character_data.hpp"
|
||||||
|
#include "combat_data.hpp"
|
||||||
|
|
||||||
//client
|
//client
|
||||||
#include "base_scene.hpp"
|
#include "base_scene.hpp"
|
||||||
|
|
||||||
|
|||||||
@@ -210,6 +210,10 @@ void LobbyMenu::KeyUp(SDL_KeyboardEvent const& key) {
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------
|
||||||
|
//Network handlers
|
||||||
|
//-------------------------
|
||||||
|
|
||||||
void LobbyMenu::HandlePacket(SerialPacket packet) {
|
void LobbyMenu::HandlePacket(SerialPacket packet) {
|
||||||
switch(packet.meta.type) {
|
switch(packet.meta.type) {
|
||||||
case SerialPacket::Type::BROADCAST_RESPONSE: {
|
case SerialPacket::Type::BROADCAST_RESPONSE: {
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ protected:
|
|||||||
void KeyDown(SDL_KeyboardEvent const&);
|
void KeyDown(SDL_KeyboardEvent const&);
|
||||||
void KeyUp(SDL_KeyboardEvent const&);
|
void KeyUp(SDL_KeyboardEvent const&);
|
||||||
|
|
||||||
|
//Network handlers
|
||||||
void HandlePacket(SerialPacket);
|
void HandlePacket(SerialPacket);
|
||||||
|
|
||||||
//shared parameters
|
//shared parameters
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. .. ../../common/gameplay ../../common/graphics ../../common/map ../../common/network ../../common/ui ../../common/utilities
|
INCLUDES+=. .. ../../common/gameplay ../../common/graphics ../../common/map ../../common/network ../../common/ui ../../common/utilities
|
||||||
LIBS+=libclient.a ../libcommon.a -lSDL_net -lwsock32 -liphlpapi -lmingw32 -lSDLmain -lSDL -llua
|
LIBS+=libclient.a ../libcommon.a -lSDL_net -lwsock32 -liphlpapi -lmingw32 -lSDLmain -lSDL -llua
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES)) -DGRAPHICS
|
||||||
|
|
||||||
#source
|
#source
|
||||||
CXXSRC=$(wildcard *.cpp)
|
CXXSRC=$(wildcard *.cpp)
|
||||||
|
|||||||
@@ -27,6 +27,12 @@
|
|||||||
#include "vector2.hpp"
|
#include "vector2.hpp"
|
||||||
#include "statistics.hpp"
|
#include "statistics.hpp"
|
||||||
|
|
||||||
|
//graphics
|
||||||
|
#ifdef GRAPHICS
|
||||||
|
#include "sprite_sheet.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//std namespace
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
@@ -55,6 +61,9 @@ struct CharacterData {
|
|||||||
|
|
||||||
//active gameplay members
|
//active gameplay members
|
||||||
//NOTE: these are lost when unloaded
|
//NOTE: these are lost when unloaded
|
||||||
|
#ifdef GRAPHICS
|
||||||
|
SpriteSheet sprite;
|
||||||
|
#endif
|
||||||
BBox bbox = {0,0,0,0};
|
BBox bbox = {0,0,0,0};
|
||||||
bool inCombat = false;
|
bool inCombat = false;
|
||||||
int atbGauge = 0;
|
int atbGauge = 0;
|
||||||
|
|||||||
@@ -22,12 +22,20 @@
|
|||||||
#ifndef COMBATDATA_HPP_
|
#ifndef COMBATDATA_HPP_
|
||||||
#define COMBATDATA_HPP_
|
#define COMBATDATA_HPP_
|
||||||
|
|
||||||
|
//POD members
|
||||||
#include "vector2.hpp"
|
#include "vector2.hpp"
|
||||||
#include "bbox.hpp"
|
#include "bbox.hpp"
|
||||||
|
|
||||||
|
//gameplay members
|
||||||
#include "character_data.hpp"
|
#include "character_data.hpp"
|
||||||
#include "enemy_data.hpp"
|
#include "enemy_data.hpp"
|
||||||
|
|
||||||
|
//graphics
|
||||||
|
#ifdef GRAPHICS
|
||||||
|
#include "sprite_sheet.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//std namespace
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -46,6 +54,11 @@ struct CombatData {
|
|||||||
|
|
||||||
//time interval
|
//time interval
|
||||||
Clock::time_point lastTick = Clock::now();
|
Clock::time_point lastTick = Clock::now();
|
||||||
|
|
||||||
|
//graphics
|
||||||
|
#ifdef GRAPHICS
|
||||||
|
SpriteSheet sprite;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -22,8 +22,15 @@
|
|||||||
#ifndef ENEMYDATA_HPP_
|
#ifndef ENEMYDATA_HPP_
|
||||||
#define ENEMYDATA_HPP_
|
#define ENEMYDATA_HPP_
|
||||||
|
|
||||||
|
//gameplay
|
||||||
#include "statistics.hpp"
|
#include "statistics.hpp"
|
||||||
|
|
||||||
|
//graphics
|
||||||
|
#ifdef GRAPHICS
|
||||||
|
#include "sprite_sheet.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//std namespace
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
struct EnemyData {
|
struct EnemyData {
|
||||||
@@ -41,6 +48,9 @@ struct EnemyData {
|
|||||||
|
|
||||||
//active gameplay members
|
//active gameplay members
|
||||||
//NOTE: these are lost when unloaded
|
//NOTE: these are lost when unloaded
|
||||||
|
#ifdef GRAPHICS
|
||||||
|
SpriteSheet sprite;
|
||||||
|
#endif
|
||||||
int tableIndex;
|
int tableIndex;
|
||||||
int atbGauge = 0;
|
int atbGauge = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user