Skip to content

Commit

Permalink
Merge pull request #16 from inFullMobile/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
noxytrux authored Jul 7, 2018
2 parents 8031986 + 4aed812 commit 9523e57
Show file tree
Hide file tree
Showing 367 changed files with 21,253 additions and 1,340 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
#core
CORE/build.gradle

#SERVER
SERVER/DerivedData/
SERVER/PFServer/DerivedData/
SERVER/PFServer/bin/
SERVER/PFServer/obj/
SERVER/PFClient/bin/
SERVER/PFClient/obj/

#iOS
PLATFORM/iOS/DerivedData/
PLATFORM/iOS/PixFight.xcodeproj/xcuserdata/
Expand All @@ -16,6 +24,9 @@ PLATFORM/macOS/PixFight.xcodeproj/project.xcworkspace/xcuserdata/
#android
PLATFORM/Android/build
PLATFORM/Android/app/build
PLATFORM/Android/app/release/
PLATFORM/Android/.idea/caches/
PLATFORM/Android/.idea/assetWizardSettings.xml

#linux
PLATFORM/Linux/obj/
Expand All @@ -36,3 +47,8 @@ MAPEDITOR/nul

#html5
PLATFORM/HTML5/bin/

#raspberrypi

PLATFORM/RaspberryPi/bin/
PLATFORM/RaspberryPi/obj/
94 changes: 30 additions & 64 deletions CORE/AI/AIPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
GameUnit::unitspec s1 = a->getStats();
GameUnit::unitspec s2 = b->getStats();

float BonusA = s1.Expirence;
float BonusB = s2.Expirence;
//Bouns should come from Terrain type
float BonusA = 0;
float BonusB = 0;

float P = 0.0;

float TaA = 0.0;
Expand All @@ -36,20 +38,20 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
switch (TypeA) {
case M_INFANTRY:
switch (TypeB) {
case M_INFANTRY: {}
case M_INFANTRY:
break;
case M_BAZOOKA: {}
case M_BAZOOKA:
break;
case M_JEEP: {
TaA = -3.0;
TaA = -2.0;
}
break;
case M_LTANK: {
TaA = -3.0;
TaA = -2.0;
}
break;
case M_ARTILLERY: {
TaA = -3.0;
TaA = -2.0;
}
break;
default:
Expand All @@ -63,15 +65,15 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
case M_BAZOOKA: {}
break;
case M_JEEP: {
TaA = 2.0;
TaA = 3.0;
}
break;
case M_LTANK: {
TaA = 2.0;
TaA = 3.0;
}
break;
case M_ARTILLERY: {
TaA = 2.0;
TaA = 3.0;
}
break;
default:
Expand All @@ -81,26 +83,24 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
case M_JEEP :
switch (TypeB) {
case M_INFANTRY: {
TaB = -3.0;
TaB = -2.0;
TdB = -2.0;
}
break;
case M_BAZOOKA: {
TaB = 2.0;
TaB = 3.0;
TdB = -2.0;
}
break;
case M_JEEP: {
TaA = -6.0;
TaB = -6.0;
}
break;
case M_LTANK: {
TaA = -6.0;
TaB = -3.0;
TaA = -4.0;
}
break;
case M_ARTILLERY :{
TaA = -6.0;
TaB = -6.0;
TaA = -4.0;
}
break;
default:
Expand All @@ -110,27 +110,20 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
case M_LTANK :
switch (TypeB) {
case M_INFANTRY: {
TaB = -3.0;
TaB = -2.0;
}
break;
case M_BAZOOKA: {
TaB = 2.0;
TaB = 3.0;
}
break;
case M_JEEP: {
TaA = -3.0;
TaB = -6.0;
TaB = -4.0;
}
break;
case M_LTANK: {
TaA = -3.0;
TaB = -3.0;
}
case M_LTANK:
break;
case M_ARTILLERY: {
TaA = -3.0;
TaB = -6.0;
}
case M_ARTILLERY:
break;
default:
break;
Expand All @@ -139,27 +132,20 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
case M_ARTILLERY :
switch (TypeB) {
case M_INFANTRY: {
TaB = -3.0;
TaB = -2.0;
}
break;
case M_BAZOOKA: {
TaB = 2.0;
TaB = 3.0;
}
break;
case M_JEEP: {
TaA = -6.0;
TaB = -6.0;
TaB = -4.0;
}
break;
case M_LTANK: {
TaA = -6.0;
TaB = -3.0;
}
case M_LTANK:
break;
case M_ARTILLERY: {
TaA = -6.0;
TaB = -6.0;
}
case M_ARTILLERY:
break;
default:
break;
Expand Down Expand Up @@ -274,29 +260,9 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
auto TA = a;
auto TB = b;

if (unitsToDestroyForB > 0.0) { //Unit hit oppnent

TA->addExp(0.05);
}
else {

TB->addExp(0.05);
}

if (unitsToDestroyForA > 0.0) {

TB->addExp(0.05);
}//not hited enemy Guard Bonus
else {

TA->addExp(0.05);
}

//Units Removing
if (unitsToDestroyForB >= SizeB) {

TA->addExp(0.1);

if (TB->getRequestID() != -1) {

for (auto fBase : bases) {
Expand All @@ -313,6 +279,7 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
}

unitToDestroy = DESTROY_SECOND;
TB->setSize(0);
TB = nullptr;
}
else {
Expand All @@ -326,8 +293,6 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit

if (TB != nullptr) {

TB->addExp(0.1);

if (TA->getRequestID() != -1) {

for (auto fBase : bases) {
Expand All @@ -351,6 +316,7 @@ UNIT_DESTROY attackUnit(GameUnit *a, GameUnit *b, std::vector<GameUnit *> & unit
unitToDestroy = DESTROY_FIRST;
}

TA->setSize(0);
TA = nullptr;
}
else {
Expand Down
8 changes: 7 additions & 1 deletion CORE/Audio/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "fmod_errors.h"

Audio::Audio() {

_muted = false;

_result = FMOD::System_Create(&_system);
Expand All @@ -40,6 +39,13 @@ Audio::Audio() {

#endif

#ifdef _RPI_

//this could be different depending on PI double check this in future
_system->setDriver(1);

#endif // _RPI_

_paths.clear();

_result = _system->init(32, FMOD_INIT_NORMAL, nullptr);
Expand Down
12 changes: 6 additions & 6 deletions CORE/Core-pch.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Core-pch.hpp"

#ifdef __ANDROID__
#if defined(__ANDROID__) || defined(_RPI_)

PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOES = nullptr;
PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOES = nullptr;
Expand All @@ -19,11 +19,11 @@ int PLAYERTEAMSELECTED = 1;
int GAME_IDCOUNTER = 0;

int UNITS_RATINGS[5][3] = {
{6,6,5}, //M_INFANTRY
{6,6,5}, //M_BAZOOKA
{10,8,5}, //M_JEEP
{10,10,5}, //M_LTANK
{10,3,4} //M_ARTILLERY
{ 4, 6, 4}, //M_INFANTRY
{ 6, 6, 4}, //M_BAZOOKA
{ 8, 8, 5}, //M_JEEP
{10,10, 4}, //M_LTANK
{10, 3, 3} //M_ARTILLERY
};

bool AlmostEqual(const xVec2 & a, const xVec2 & b) {
Expand Down
44 changes: 35 additions & 9 deletions CORE/Core-pch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@
#define GLFW_INCLUDE_ES2
#include <GLFW/glfw3.h>
#include <emscripten/emscripten.h>

#define glBindVertexArray glBindVertexArrayOES
#define glGenVertexArrays glGenVertexArraysOES
#define glDeleteVertexArrays glDeleteVertexArraysOES

#else

#ifdef _WIN32

#define NOMINMAX
#include <windows.h>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GLFW/glfw3.h>
#define GL_RED_EXT GL_RED

#endif

#ifdef __APPLE__
Expand Down Expand Up @@ -94,12 +93,39 @@

#elif defined(__linux__)

#include <GL/glew.h>
#include <GL/gl.h>
#include <GLFW/glfw3.h>
#define GL_RED_EXT GL_RED
#ifdef _RPI_

#endif
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>

#include <EGL/egl.h>

extern PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOES;
extern PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOES;
extern PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOES;

extern void eglBuildVertexArray();

#define glBindVertexArray glBindVertexArrayOES
#define glGenVertexArrays glGenVertexArraysOES
#define glDeleteVertexArrays glDeleteVertexArraysOES

#define GLFW_INCLUDE_ES2

#else

#include <GL/glew.h>
#include <GL/gl.h>

#endif

#include <GLFW/glfw3.h>

#ifndef _RPI_
#define GL_RED_EXT GL_RED
#endif

#endif

#endif

Expand Down
2 changes: 1 addition & 1 deletion CORE/GameLogic/Drawable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "DrawingContext.hpp"

class Drawable {
class DrawableObject {

public:

Expand Down
Loading

0 comments on commit 9523e57

Please sign in to comment.