diff --git a/.gitignore b/.gitignore
index a929ead..b3ccc91 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
## Build generated
build/
DerivedData/
+.idea/
## Various settings
*.pbxuser
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100755
index c962845..0000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,217 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1531738153088
-
-
- 1531738153088
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/assets/shaders/particle-shader.fragment b/assets/shaders/particle-shader.fragment
index b4a6521..f94bcc3 100755
--- a/assets/shaders/particle-shader.fragment
+++ b/assets/shaders/particle-shader.fragment
@@ -1,7 +1,7 @@
precision mediump float;
-in vec2 texCoord;
-flat in vec4 color;
+varying vec2 texCoord;
+varying vec4 color;
uniform sampler2D Texture;
diff --git a/assets/shaders/particle-shader.vertex b/assets/shaders/particle-shader.vertex
index f9a7261..522cd9b 100755
--- a/assets/shaders/particle-shader.vertex
+++ b/assets/shaders/particle-shader.vertex
@@ -2,8 +2,8 @@ attribute vec3 vPosition;
attribute vec2 vTexCoord;
attribute vec4 vColor;
-out vec2 texCoord;
-flat out vec4 color;
+varying vec2 texCoord;
+varying vec4 color;
uniform mat4 ProjectionMatrix;
diff --git a/game/android_api.cpp b/game/android_api.cpp
index bc9bce5..5ea4cad 100755
--- a/game/android_api.cpp
+++ b/game/android_api.cpp
@@ -16,7 +16,7 @@ JNIEXPORT void JNICALL Java_fishrungames_doublehitballs_JniWrapper_Init(JNIEnv *
std::stringstream LoadFileFromAndroid(const std::string& fileName)
{
- *Console << "LoadFileFromAndroid called \n";
+ GetConsole() << "LoadFileFromAndroid called \n";
JNIEnv* jEnv;
localJavaVirtualMachine->GetEnv((void**)&jEnv, JNI_VERSION_1_4);
@@ -33,14 +33,14 @@ std::stringstream LoadFileFromAndroid(const std::string& fileName)
std::stringstream ss;
ss << jEnv->GetStringUTFChars(jFileContent, &jCopy);
- *Console << ss.str();
+ GetConsole() << ss.str();
return ss;
}
void SaveFileToAndroid(const std::string& fileName, const std::string& fileContent)
{
- *Console << "SaveFileToAndroid called \n";
+ GetConsole() << "SaveFileToAndroid called \n";
JNIEnv* jEnv;
localJavaVirtualMachine->GetEnv((void**)&jEnv, JNI_VERSION_1_4);
diff --git a/game/galaxy_menu.cpp b/game/galaxy_menu.cpp
index 76a03bb..844a035 100755
--- a/game/galaxy_menu.cpp
+++ b/game/galaxy_menu.cpp
@@ -223,11 +223,11 @@ void GalaxyMenu::DrawGalaxyMenu() {
Renderer->PushShader("HoverableButtonShader");
if (stars_params.size() >= i) {
for (int j = 0; j < stars_params[i].size(); j++) {
- if (planetHoverIndex == j) {
+ if (planetHoverIndex == j) {
RenderUniform1i("Hover", 1);
glBindTexture(GL_TEXTURE_2D, SE::ResourceManager->TexList[galaxies[i].Stars[j].textureName]);
}
- else {
+ else {
RenderUniform1i("Hover", 0);
glBindTexture(GL_TEXTURE_2D, SE::ResourceManager->TexList[galaxies[i].Stars[j].textureName]);
}
@@ -259,7 +259,8 @@ void GalaxyMenu::InteractWithGalaxy(size_t dt) {
if (timer_active) {
// ::::::::::::: timer active ::::::::::::::
- if (menuState == 0) { // main view
+ //if (menuState == 0)
+ { // main view
//if (currentTapShift(0) == 0.f && currentTapShift(1) == 0.f) {
if (currentTapShift(0) == totalTapShift(0) && currentTapShift(1) == totalTapShift(1)) {
// OnTapDown->
@@ -312,7 +313,8 @@ void GalaxyMenu::InteractWithGalaxy(size_t dt) {
else {
// ::::::::::::: timer inactive ::::::::::::::
if (lastTapPos != Eigen::Vector2f(-9999.9f, -9999.9f)) {
- if (menuState == 0) {// main view
+ //if (menuState == 0)
+ {// main view
// OnTapDown->OnTapUp
@@ -325,8 +327,6 @@ void GalaxyMenu::InteractWithGalaxy(size_t dt) {
Application->SetupGalaxyUi(starIndex);
}
- timer_active = false;
-
}/*
@@ -384,6 +384,7 @@ void GalaxyMenu::InteractWithGalaxy(size_t dt) {
lastTapPos = Eigen::Vector2f(-9999.9f, -9999.9f); // reset
}
+
}
void GalaxyMenu::tapDown(Eigen::Vector2f pos) {
diff --git a/game/gamecode.cpp b/game/gamecode.cpp
index 2709c15..17a4881 100755
--- a/game/gamecode.cpp
+++ b/game/gamecode.cpp
@@ -469,7 +469,7 @@ void TBall::Update(size_t dt)
//===========================================
//===========================================
//===========================================
-
+
bool TGameLevel::XXX = true;
TGameLevel::TGameLevel(int levelStar, int levelIndex)
@@ -872,6 +872,8 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
Renderer->PushMatrix();
Renderer->LoadIdentity();
+ CheckGlError();
+
if (LevelState == CONST_LEVELSTATE_LOADING)
{
@@ -958,11 +960,16 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
}
// :::::::::::
+// *SE::Console << BkgTexture;
+// *SE::Console << std::to_string(ResourceManager->TexList[BkgTexture]);
+
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[BkgTexture]);
//Renderer->DrawRect(Vector2f(xlOffset, ylOffset), Vector2f(xlOffset+tSW, ylOffset+tSH),Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
Renderer->DrawRect(Vector2f(bkgSWO, bkgSHO), Vector2f(bkgSWO + bkgSW, bkgSHO + bkgSH), Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
//Renderer->DrawRect(Vector2f(0,0), Vector2f(100,100), Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
+ CheckGlError();
+
std::list::iterator iBall;
@@ -987,17 +994,25 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
Renderer->PushShader("BrickShader");
+ GetConsole() << "PUSHED BRICK SHADER";
+
+ CheckGlError();
+
for (int i = 0; i < CONST_BRICKMATRIX_WIDTH; i++)
{
for (int j = 0; j < CONST_BRICKMATRIX_HEIGHT; j++)
{
BlockMatrix[i][j].TryDrawAppear(i, j, screenWidth); //Draws only appearing/disappearing blocks
+
+ CheckGlError();
}
}
RenderUniform1f("Transparency", 1.f);
+ CheckGlError();
+
//Vector2f outlineShift = Vector2f(((screenWidth - Application->GetGameLevelScreenWidth())*0.5f), 0.f);
Renderer->PushMatrix();
Renderer->TranslateMatrix(Vector3f(offset[0], offset[1], 0));
@@ -1016,13 +1031,22 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
color(2) = c;
}
RenderUniform4fv("BrickColor", color.data());
+
+ CheckGlError();
+
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[colorBlockIterator->first.second]);
+
+ CheckGlError();
Renderer->DrawTriangleList(colorBlockIterator->second);
+
+ CheckGlError();
}
DrawBallInstancingList(blackAndWhite);
+ CheckGlError();
+
Renderer->PopMatrix();
@@ -1031,9 +1055,13 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
for (iBonus = BonusFallingList.begin(); iBonus != BonusFallingList.end(); ++iBonus)
{
iBonus->Draw();
+
+ CheckGlError();
}
Application->EffectsDraw();
+
+ CheckGlError();
Renderer->PopShader();
@@ -1047,20 +1075,28 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
Renderer->DrawRect(Vector2f(-xRW * 0.5f, -yRH * 0.5f) + matrixSize + offset,
Vector2f(xRW*0.5f, yRH*0.5f) + matrixSize + offset, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
+ CheckGlError();
+
const Vector2f wallUpPos1(xlOffset, tSH-ylOffset-uWTW);
const Vector2f wallUpPos2(tSW + xlOffset, tSH-ylOffset);
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_UP_TEXTURE]);
Renderer->DrawRect(wallUpPos1, wallUpPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
+
+ CheckGlError();
const Vector2f wallLeftPos1(xlOffset, lrFBO+ylOffset);
const Vector2f wallLeftPos2(lWTW + xlOffset, tSH-ylOffset-(uWTW*0.68f));
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_LEFT_TEXTURE]);
Renderer->DrawRect(wallLeftPos1, wallLeftPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
+
+ CheckGlError();
const Vector2f wallRightPos1(tSW+xlOffset-rWTW, lrFBO+ylOffset);
const Vector2f wallRightPos2(tSW + xlOffset, tSH-ylOffset-(uWTW*0.68f));
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_RIGHT_TEXTURE]);
Renderer->DrawRect(wallRightPos1, wallRightPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
+
+ CheckGlError();
if (BonusFloorTimer>0.f)
@@ -1074,6 +1110,8 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
const Vector2f wallBonusPos2(tSW + xlOffset - bWTO, ylOffset + wallDownPos(1) + bWTW*0.5f);
Renderer->DrawRect(wallBonusPos1, wallBonusPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
}
+
+ CheckGlError();
@@ -1089,6 +1127,8 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
drawOutline(screenWidth, screenHeight);
+ CheckGlError();
+
if (pause && !renderBufferReady)
{
diff --git a/game/main_code.cpp b/game/main_code.cpp
index 15100c4..defdd52 100755
--- a/game/main_code.cpp
+++ b/game/main_code.cpp
@@ -134,9 +134,9 @@ void TMyApplication::SaveUserProgress(int levelStar, int levelIndex)
SaveFileToAndroid("user_progress.json", ss.str());
#endif
}
-
+
void TMyApplication::InnerChangeWidthHeight(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight)
-{
+{
Menu.GalaxMenu.UpdateGalaxyMenu(matrixWidth, matrixHeight, 0);
SetGameLevelScreenScale();
@@ -164,7 +164,7 @@ void TMyApplication::InnerInit()
#ifdef TARGET_WIN32
#ifdef NDEBUG
- ST::PathToResources = "resources/";
+ //ST::PathToResources = "resources/";
ST::PathToResources = "../../../assets/";
#else
ST::PathToResources = "../../../assets/";
@@ -179,71 +179,68 @@ void TMyApplication::InnerInit()
ST::PathToResources = "";
#endif
- LoadUserProgress();
-
GetConsole() <<"APP INIT\n";
srand (static_cast(time(NULL)));
GameState = CONST_GAMESTATE_PRELOADING;
StateTimer = 0.f;
- /*
- ResourceManager->ShaderManager.AddShader("DefaultShader", "shader1vertex", "shader1fragment.txt");
- ResourceManager->ShaderManager.AddShader("FrameShader", "frameshader_vertex.txt", "frameshader_fragment.txt");
- ResourceManager->ShaderManager.AddShader("BrickShader", "brickshader_vertex.txt", "brickshader_fragment.txt");
- Renderer->PushShader("DefaultShader");
- */
-
- //ResourceManager->ShaderManager.AddShader("DefaultShader", "shaders/texture-shader.vertex", "shaders/texture-shader.fragment");
ResourceManager->ShaderManager.AddShader("DefaultShader", "shaders/gui_transparent.vertex", "shaders/gui_transparent.fragment");
- ResourceManager->ShaderManager.AddShader("HoverableButtonShader", "shaders/gui_transparent.vertex", "shaders/hoverable-button.fragment");
- ResourceManager->ShaderManager.AddShader("BlackAndWhiteShader", "shaders/gui_transparent_blackandwhite.vertex", "shaders/gui_transparent_blackandwhite.fragment");
- ResourceManager->ShaderManager.AddShader("ColorShader", "shaders/color-shader.vertex", "shaders/color-shader.fragment");
- ResourceManager->ShaderManager.AddShader("FrameShader", "shaders/frameshader_vertex.txt", "shaders/frameshader_fragment.txt");
- ResourceManager->ShaderManager.AddShader("BrickShader", "shaders/brickshader_vertex.txt", "shaders/brickshader_fragment.txt");
- ResourceManager->ShaderManager.AddShader(ParticleEffect::PARTICLE_SHADER, "shaders/particle-shader.vertex", "shaders/particle-shader.fragment");
- Renderer->PushShader("DefaultShader");
+ Renderer->PushShader("DefaultShader");
- //ResourceManager->TexList.AddTexture(CONST_LOADING_BACKGROUND_BLACK + ".png", CONST_LOADING_BACKGROUND_BLACK);
- //ResourceManager->TexList.AddTexture(CONST_LOADING_TEXTURE + ".png", CONST_LOADING_TEXTURE);
- //ResourceManager->TexList.AddTexture(CONST_LOGO_SMALL_TEXTURE + ".png", CONST_LOGO_SMALL_TEXTURE);
+ ResourceManager->TexList.AddTexture("console_bkg.bmp");
+ ResourceManager->TexList.AddTexture("white.bmp");
- ResourceManager->TexList.AddTexture("console_bkg.bmp");
- ResourceManager->TexList.AddTexture("white.bmp");
+ ResourceManager->FontManager.AddFont("arial32", "arial32.png", "arial32.txt");
+ ResourceManager->FontManager.AddFont("lucon12", "lucon12.png", "lucon12.txt");
+ ResourceManager->FontManager.PushFont("lucon12");
+ Renderer->SetOrthoProjection();
- ResourceManager->FrameManager.AddFrameRenderBuffer("LevelBuffer", 256, 256);
-
- //OnDrawSignal.connect(boost::bind(&TGameLoading::Draw, boost::ref(GameLoading)));
- Inited = true;
+ Renderer->SetFullScreenViewport();
- Renderer->SetOrthoProjection();
+ ResourceManager->newGuiManager.LoadFromConfig("gui_loading.json");
- Renderer->SetFullScreenViewport();
- Application->SetGameLevelScreenScale();
- //GameLevel.SetLevelScale();
- EffectsInit();
-
- // ------- UI -------
+ skipUpdateToUpdateScreen = true;
+ StateTimer = 0.f;
+}
- boost::property_tree::json_parser::read_json(ST::PathToResources + "gui_game_pause_menu.json", gamePauseMenuUi);
- boost::property_tree::json_parser::read_json(ST::PathToResources + "gui_main_menu.json", galaxyMenuUi);
+void TMyApplication::InnerReinitGLResources()
+{
+ RenderLevelSnapshots();
- ResourceManager->FontManager.AddFont("arial32", "arial32.png", "arial32.txt");
- ResourceManager->FontManager.AddFont("lucon12", "lucon12.png", "lucon12.txt");
- ResourceManager->FontManager.PushFont("lucon12");
- //ResourceManager->newGuiManager.LoadFromConfig("gui_main_menu.json");
- ResourceManager->newGuiManager.LoadFromConfig("gui_loading.json");
+ lsparkler.reinitGlResources();
+ rsparkler.reinitGlResources();
+ tsparkler.reinitGlResources();
+ bsparkler.reinitGlResources();
+ lvlFirework.reinitGlResources();
+}
- // ------- UI -------
+void TMyApplication::RenderLevelSnapshots()
+{
+ Renderer->SwitchToFrameBuffer("LevelBuffer");
- // TESTS of menu
- if (Menu.GalaxMenu.InitGalaxyMenu("levels/galaxy_ptree.json")) {
- std::cout << "ok" << std::endl;
- }
- else {
- std::cout << "menu error" << std::endl;
- }
+ Renderer->SetProjectionMatrix(768, 480);
+
+ Renderer->LoadIdentity();
+
+ for (auto &star : Menu.GalaxMenu.galaxies[0].Stars)
+ {
+ for (auto level : star.selectionMenu.gameLevels)
+ {
+ level->DrawSnapshot("LevelBuffer", false);
+
+ Renderer->PushShader("BlackAndWhiteShader");
+
+ level->DrawSnapshot("LevelBuffer", true);
+
+ Renderer->PopShader();
+ }
+ }
+
+ Renderer->SwitchToScreen();
+
+ Renderer->SetOrthoProjection();
}
void TMyApplication::InnerDeinit()
@@ -471,8 +468,8 @@ void TMyApplication::LoadResources()
ResourceManager->FontManager.AddFont("droid_sans14", "droid_sans14_font_bitmap.png", "droid_sans14_font_charmap.txt");
ResourceManager->FontManager.PushFont("droid_sans14");
-
- TryLoadSavedGame();
+
+ GetConsole() << "LOAD GAME";
}
@@ -534,10 +531,67 @@ void TMyApplication::InnerUpdate(size_t dt)
StateTimer += dt/1000.f;
if (StateTimer >= 1.f)
{
- LoadResources();
- GameState = CONST_GAMESTATE_LOADING;
- StateTimer = 0.f;
+ StateTimer -= 1.f;
+ skipUpdateToUpdateScreen = false;
}
+
+ if (skipUpdateToUpdateScreen)
+ {
+ return;
+ }
+
+ GetConsole() << "INNER UPDATE";
+
+ LoadUserProgress();
+
+ GetConsole() << "LOAD SHADERS";
+
+ ResourceManager->ShaderManager.AddShader("HoverableButtonShader", "shaders/gui_transparent.vertex", "shaders/hoverable-button.fragment");
+ ResourceManager->ShaderManager.AddShader("BlackAndWhiteShader", "shaders/gui_transparent_blackandwhite.vertex", "shaders/gui_transparent_blackandwhite.fragment");
+ ResourceManager->ShaderManager.AddShader("ColorShader", "shaders/color-shader.vertex", "shaders/color-shader.fragment");
+ ResourceManager->ShaderManager.AddShader("FrameShader", "shaders/frameshader_vertex.txt", "shaders/frameshader_fragment.txt");
+ ResourceManager->ShaderManager.AddShader("BrickShader", "shaders/brickshader_vertex.txt", "shaders/brickshader_fragment.txt");
+ ResourceManager->ShaderManager.AddShader(ParticleEffect::PARTICLE_SHADER, "shaders/particle-shader.vertex", "shaders/particle-shader.fragment");
+
+ GetConsole() << "ADD FRAMEBUFFER";
+
+ ResourceManager->FrameManager.AddFrameRenderBuffer("LevelBuffer", 256, 256);
+
+ //OnDrawSignal.connect(boost::bind(&TGameLoading::Draw, boost::ref(GameLoading)));
+ Inited = true;
+ Application->SetGameLevelScreenScale();
+ //GameLevel.SetLevelScale();
+
+ GetConsole() << "INIT EFFECTS";
+ EffectsInit();
+
+ // ------- UI -------
+
+ GetConsole() << "LOAD JSON UI";
+
+ gamePauseMenuUi = SE::ReadJsonFile(ST::PathToResources + "gui_game_pause_menu.json");
+ galaxyMenuUi = SE::ReadJsonFile(ST::PathToResources + "gui_main_menu.json");
+
+ GetConsole() << "INIT MENU";
+
+ // TESTS of menu
+ if (Menu.GalaxMenu.InitGalaxyMenu("levels/galaxy_ptree.json")) {
+ std::cout << "ok" << std::endl;
+ }
+ else {
+ std::cout << "menu error" << std::endl;
+ }
+
+ GetConsole() << "RENDER SNAPSHOTS";
+
+ RenderLevelSnapshots();
+
+ GetConsole() << "LOAD RESOURCES";
+
+ LoadResources();
+ GameState = CONST_GAMESTATE_LOADING;
+
+ GetConsole() << "PRELOADING END";
}
else if (GameState == CONST_GAMESTATE_LOADING)
{
@@ -546,6 +600,8 @@ void TMyApplication::InnerUpdate(size_t dt)
{
StateTimer -= 1.f;
}
+
+ GetConsole() << "BEFORE LOADING TEXTURES";
if (TextureNamesToLoad.size() != 0)
{
@@ -557,27 +613,27 @@ void TMyApplication::InnerUpdate(size_t dt)
else
{
- Renderer->SwitchToFrameBuffer("LevelBuffer");
-
- Renderer->LoadIdentity();
-
- for (auto &star : Menu.GalaxMenu.galaxies[0].Stars)
- {
- for (auto level : star.selectionMenu.gameLevels)
- {
- level->DrawSnapshot("LevelBuffer", false);
-
- Renderer->PushShader("BlackAndWhiteShader");
-
- level->DrawSnapshot("LevelBuffer", true);
-
- Renderer->PopShader();
- }
- }
-
- Renderer->SwitchToScreen();
-
- Renderer->SetOrthoProjection();
+// Renderer->SwitchToFrameBuffer("LevelBuffer");
+//
+// Renderer->LoadIdentity();
+//
+// for (auto &star : Menu.GalaxMenu.galaxies[0].Stars)
+// {
+// for (auto level : star.selectionMenu.gameLevels)
+// {
+// level->DrawSnapshot("LevelBuffer", false);
+//
+// Renderer->PushShader("BlackAndWhiteShader");
+//
+// level->DrawSnapshot("LevelBuffer", true);
+//
+// Renderer->PopShader();
+// }
+// }
+//
+// Renderer->SwitchToScreen();
+//
+// Renderer->SetOrthoProjection();
GameState = CONST_GAMESTATE_MENU;
ApplySignalsToMenu();
@@ -651,7 +707,7 @@ void TMyApplication::InnerUpdate(size_t dt)
});
pauseBackground->onMoveSignal.connect([this](Vector2f, Vector2f shift, int) {
- SE::GetConsole() << shift.norm();
+ SE::GetConsole() << std::to_string(shift.norm());
if (shift.norm() > 15)
{
GameLevel->TryGoToMenu();
@@ -841,7 +897,7 @@ void TMyApplication::GoFromGameToMenu()
TrySaveGame();
DisapplySignalsToGame();
- ignoreTapUp = true;
+ //ignoreTapUp = true;
LoadGalaxyUi();
@@ -1013,11 +1069,10 @@ void TMyApplication::EffectsDraw() {
Renderer->TranslateMatrix(Vector3f(offset[0], offset[1], 0));
Renderer->ScaleMatrix(scale);
- glPushAttrib(GL_ALL_ATTRIB_BITS);
+ //glPushAttrib(GL_ALL_ATTRIB_BITS);
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
lsparkler.draw();
rsparkler.draw();
@@ -1025,9 +1080,12 @@ void TMyApplication::EffectsDraw() {
bsparkler.draw();
lvlFirework.draw();
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_BLEND);
+
Renderer->PopMatrix();
- glPopAttrib();
+ //glPopAttrib();
}
void TMyApplication::hitSpark(std::string direct,Vector2f Pos) {
diff --git a/game/main_code.h b/game/main_code.h
index bb8aefe..8a2cde1 100755
--- a/game/main_code.h
+++ b/game/main_code.h
@@ -89,6 +89,8 @@ const int CONST_GAMESTATE_PRELOADING = 7;
class TMyApplication : public TApplication
{
protected:
+ bool skipUpdateToUpdateScreen;
+
int levelScreenWidth;
int levelScreenHeight;
float levelScreenRatio = 1.6;
@@ -137,16 +139,20 @@ public:
bool Loaded;
TMyApplication() : TApplication(), Loaded(false), Inited(false) { }
-
- void LoadUserProgress();
+
+ void LoadUserProgress();
void SaveUserProgress(int levelStar, int levelIndex);
void InnerChangeWidthHeight(int screenWidth, int screenHeight, float matrixWidth, float matrixHeight) override;
-
-
+
+
virtual void OnKeyPress(size_t key);
virtual void InnerInit();
+ virtual void RenderLevelSnapshots();
+
+ virtual void InnerReinitGLResources();
+
virtual void InnerDeinit();
virtual void InnerDraw();
diff --git a/proj.android-studio/app/CMakeLists.txt b/proj.android-studio/app/CMakeLists.txt
index f814c6c..acbe547 100755
--- a/proj.android-studio/app/CMakeLists.txt
+++ b/proj.android-studio/app/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.4.1)
-set(BOOST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../boost_1_67_0)
+set(BOOST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../boost_1_68_0)
set(BOOST_GIL_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/boost-gil-extension)
set(ZIP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/julienr-libzip-android/jni)
set(LIBPNG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/libpng_1.4.1_android)
diff --git a/proj.android-studio/app/build.gradle b/proj.android-studio/app/build.gradle
index b64bb4a..14629fe 100755
--- a/proj.android-studio/app/build.gradle
+++ b/proj.android-studio/app/build.gradle
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
android {
compileSdkVersion 28
- buildToolsVersion "28.0.0"
+ buildToolsVersion "28.0.3"
defaultConfig {
applicationId "fishrungames.DoubleHitBalls"
minSdkVersion 19
@@ -46,9 +46,9 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation 'com.android.support:appcompat-v7:28+'
+ implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation project(':SalmonEngineAndroid')
- compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
diff --git a/proj.android-studio/app/src/main/java/fishrungames/doublehitballs/GL2JNIActivity.java b/proj.android-studio/app/src/main/java/fishrungames/doublehitballs/GL2JNIActivity.java
index 32f841e..5e28ae0 100755
--- a/proj.android-studio/app/src/main/java/fishrungames/doublehitballs/GL2JNIActivity.java
+++ b/proj.android-studio/app/src/main/java/fishrungames/doublehitballs/GL2JNIActivity.java
@@ -9,6 +9,7 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
+import android.util.Log;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.GestureDetector.SimpleOnGestureListener;
@@ -28,7 +29,8 @@ public class GL2JNIActivity extends Activity
@Override
protected void onCreate(Bundle icicle)
{
-
+ Log.d("DEBUG", "START ACTIVITY");
+
super.onCreate(icicle);
instance = this;
@@ -65,7 +67,7 @@ public class GL2JNIActivity extends Activity
@Override
protected void onPause()
{
- EngineWrapper.CallDestroy();
+ //EngineWrapper.CallDestroy();
super.onPause();
mView.onPause();
}
diff --git a/proj.android-studio/build.gradle b/proj.android-studio/build.gradle
index f8360c7..9678956 100755
--- a/proj.android-studio/build.gradle
+++ b/proj.android-studio/build.gradle
@@ -1,14 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = '1.2.70'
+ ext {
+ compileSdkVersion = 28
+ targetSdkVersion = 28
+
+ kotlin_version = "1.3.10"
+ supportLibraryVersion = "28.0.0"
+ }
+
repositories {
jcenter()
google()
}
+
dependencies {
- classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
+ classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong