diff --git a/.gitignore b/.gitignore index 4dd52f7..db4d37d 100755 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /bin/ /lib/ # CLion -.idea/ \ No newline at end of file +.idea/ +.orig \ No newline at end of file diff --git a/assets/Models/submarine2.mtl b/assets/Models/Submarine2.mtl similarity index 100% rename from assets/Models/submarine2.mtl rename to assets/Models/Submarine2.mtl diff --git a/assets/Models/submarine2.obj b/assets/Models/Submarine2.obj similarity index 99% rename from assets/Models/submarine2.obj rename to assets/Models/Submarine2.obj index 5796eba..144e0ad 100644 --- a/assets/Models/submarine2.obj +++ b/assets/Models/Submarine2.obj @@ -1,6 +1,6 @@ # Blender v2.75 (sub 0) OBJ File: 'submarine.blend' # www.blender.org -mtllib submarine2.mtl +mtllib Submarine2.mtl o Cube v -0.378953 -0.002680 -0.065172 v 0.212611 0.044805 -0.044067 diff --git a/include/Game/LevelSystem.h b/include/Game/LevelSystem.h index 775d639..acf0129 100755 --- a/include/Game/LevelSystem.h +++ b/include/Game/LevelSystem.h @@ -34,7 +34,6 @@ #include "Game/PadSystem.h" #include #include -#include namespace dd { diff --git a/include/Physics/PhysicsSystem.h b/include/Physics/PhysicsSystem.h index eaaf49e..05ea1e7 100644 --- a/include/Physics/PhysicsSystem.h +++ b/include/Physics/PhysicsSystem.h @@ -57,8 +57,8 @@ public: private: b2Vec2 m_Gravity; b2World* m_PhysicsWorld; - float m_TimeStep; - float m_Accumulator; + double m_TimeStep; + double m_Accumulator; int m_VelocityIterations, m_PositionIterations; diff --git a/src/game/Game/BallSystem.cpp b/src/game/Game/BallSystem.cpp index 6e32e52..4a4ba17 100644 --- a/src/game/Game/BallSystem.cpp +++ b/src/game/Game/BallSystem.cpp @@ -13,9 +13,9 @@ void dd::Systems::BallSystem::RegisterComponents(ComponentFactory *cf) void dd::Systems::BallSystem::Initialize() { - EVENT_SUBSCRIBE_MEMBER(m_Contact, BallSystem::Contact); - EVENT_SUBSCRIBE_MEMBER(m_ELifeLost, BallSystem::OnLifeLost); - EVENT_SUBSCRIBE_MEMBER(m_EMultiBallLost, BallSystem::OnMultiBallLost); + EVENT_SUBSCRIBE_MEMBER(m_Contact, &BallSystem::Contact); + EVENT_SUBSCRIBE_MEMBER(m_ELifeLost, &BallSystem::OnLifeLost); + EVENT_SUBSCRIBE_MEMBER(m_EMultiBallLost, &BallSystem::OnMultiBallLost); EVENT_SUBSCRIBE_MEMBER(m_EResetBall, &BallSystem::OnResetBall); EVENT_SUBSCRIBE_MEMBER(m_EMultiBall, &BallSystem::OnMultiBall); } diff --git a/src/game/Game/LevelSystem.cpp b/src/game/Game/LevelSystem.cpp index d3bfe34..92c7549 100755 --- a/src/game/Game/LevelSystem.cpp +++ b/src/game/Game/LevelSystem.cpp @@ -9,13 +9,13 @@ void dd::Systems::LevelSystem::Initialize() { - EVENT_SUBSCRIBE_MEMBER(m_EContact, LevelSystem::OnContact); - EVENT_SUBSCRIBE_MEMBER(m_EScoreEvent, LevelSystem::OnScoreEvent); - EVENT_SUBSCRIBE_MEMBER(m_EMultiBall, LevelSystem::OnMultiBall); - EVENT_SUBSCRIBE_MEMBER(m_EMultiBallLost, LevelSystem::OnMultiBallLost); - EVENT_SUBSCRIBE_MEMBER(m_ECreatePowerUp, LevelSystem::OnCreatePowerUp); - EVENT_SUBSCRIBE_MEMBER(m_EPowerUpTaken, LevelSystem::OnPowerUpTaken); - EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, LevelSystem::OnStageCleared); + EVENT_SUBSCRIBE_MEMBER(m_EContact, &LevelSystem::OnContact); + EVENT_SUBSCRIBE_MEMBER(m_EScoreEvent, &LevelSystem::OnScoreEvent); + EVENT_SUBSCRIBE_MEMBER(m_EMultiBall, &LevelSystem::OnMultiBall); + EVENT_SUBSCRIBE_MEMBER(m_ECreatePowerUp, &LevelSystem::OnCreatePowerUp); + EVENT_SUBSCRIBE_MEMBER(m_EMultiBallLost, &LevelSystem::OnMultiBallLost); + EVENT_SUBSCRIBE_MEMBER(m_EPowerUpTaken, &LevelSystem::OnPowerUpTaken); + EVENT_SUBSCRIBE_MEMBER(m_EStageCleared, &LevelSystem::OnStageCleared); /*for (int i = 0; i < Lives(); i++) { CreateLife(i); diff --git a/src/game/Physics/PhysicsSystem.cpp b/src/game/Physics/PhysicsSystem.cpp index 7d23110..c425b5f 100644 --- a/src/game/Physics/PhysicsSystem.cpp +++ b/src/game/Physics/PhysicsSystem.cpp @@ -15,16 +15,16 @@ void dd::Systems::PhysicsSystem::Initialize() m_Gravity = b2Vec2(0.f, -9.82f); m_PhysicsWorld = new b2World(m_Gravity); - m_TimeStep = 1.f/60.f; + m_TimeStep = 1.0/60.0; m_VelocityIterations = 6; m_PositionIterations = 2; - m_Accumulator = 0.f; + m_Accumulator = 0.0; m_PhysicsWorld->SetContactListener(m_ContactListener); InitializeWater(); - EVENT_SUBSCRIBE_MEMBER(m_SetImpulse, PhysicsSystem::SetImpulse); + EVENT_SUBSCRIBE_MEMBER(m_SetImpulse, &PhysicsSystem::SetImpulse); } void dd::Systems::PhysicsSystem::InitializeWater() @@ -268,7 +268,7 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity) if(physicsComponent->Static) { - body->CreateFixture(&fixtureDef); //Density kanske ska vara 0 på statiska kroppar + body->CreateFixture(&fixtureDef); //Density kanske ska vara 0 p� statiska kroppar } else { fixtureDef.shape = pShape; @@ -289,7 +289,7 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity) void dd::Systems::PhysicsSystem::CreateParticleGroup(EntityID e) { - //TODO: Lägg alla pd i en lista + //TODO: L�gg alla pd i en lista auto transform = m_World->GetComponent(e); if (!transform) { LOG_ERROR("No Transform component in CreateParticleGroup"); diff --git a/src/game/Sound/Sound.cpp b/src/game/Sound/Sound.cpp index 972f71b..f98f8eb 100644 --- a/src/game/Sound/Sound.cpp +++ b/src/game/Sound/Sound.cpp @@ -26,7 +26,7 @@ ALuint dd::Sound::LoadFile(std::string path) return 0; } - fread(&m_Size, sizeof(unsigned long), 1, fp); + fread(&m_Size, 4*sizeof(char), 1, fp); fread(m_Type, sizeof(char), 4, fp); if (m_Type[0] != 'W' || m_Type[1] != 'A' || m_Type[2] != 'V' || m_Type[3]!= 'E') { LOG_ERROR("ERROR: Not WAVE-file"); @@ -40,13 +40,13 @@ ALuint dd::Sound::LoadFile(std::string path) } //READ THE DATA FROM WAVE-FILE - fread(&m_ChunkSize, sizeof(unsigned long), 1, fp); - fread(&m_FormatType, sizeof(short), 1, fp); - fread(&m_Channels, sizeof(short), 1, fp); - fread(&m_SampleRate, sizeof(unsigned long), 1, fp); - fread(&m_AvgBytesPerSec, sizeof(unsigned long), 1, fp); - fread(&m_BytesPerSample, sizeof(short), 1, fp); - fread(&m_BitsPerSample, sizeof(short), 1, fp); + fread(&m_ChunkSize, 4*sizeof(char), 1, fp); + fread(&m_FormatType, 2*sizeof(char), 1, fp); + fread(&m_Channels, 2*sizeof(char), 1, fp); + fread(&m_SampleRate, 4*sizeof(char), 1, fp); + fread(&m_AvgBytesPerSec, 4*sizeof(char), 1, fp); + fread(&m_BytesPerSample, 2*sizeof(char), 1, fp); + fread(&m_BitsPerSample, 2*sizeof(char), 1, fp); fread(m_Type, sizeof(char), 4, fp); if (m_Type[0] !='d' || m_Type[1] != 'a' || m_Type[2] != 't' || m_Type[3] != 'a') { @@ -54,10 +54,10 @@ ALuint dd::Sound::LoadFile(std::string path) return 0; } - fread(&m_DataSize, sizeof(unsigned long), 1, fp); + fread(&m_DataSize, 4*sizeof(char), 1, fp); unsigned char* buf = new unsigned char[m_DataSize]; - fread(buf, sizeof(unsigned char), m_DataSize, fp); + fread(buf, sizeof(char), m_DataSize, fp); fclose(fp); // Create buffer diff --git a/tools/StyleGuide.h b/tools/StyleGuide.h index f43b57c..99c152c 100755 --- a/tools/StyleGuide.h +++ b/tools/StyleGuide.h @@ -1,6 +1,12 @@ #ifndef NAMESPACE_FILENAME_H__ #define NAMESPACE_FILENAME_H__ +#include + +#include + +#include "Internal/Header.h" + namespace dd {