removed debug code

This commit is contained in:
Emil Kabirov 2018-11-30 13:19:55 +05:00
parent 3248d72416
commit cee9693119
3 changed files with 1 additions and 68 deletions

View File

@ -872,8 +872,6 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
Renderer->PushMatrix(); Renderer->PushMatrix();
Renderer->LoadIdentity(); Renderer->LoadIdentity();
CheckGlError();
if (LevelState == CONST_LEVELSTATE_LOADING) if (LevelState == CONST_LEVELSTATE_LOADING)
{ {
@ -960,16 +958,11 @@ 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]); 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(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(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)); //Renderer->DrawRect(Vector2f(0,0), Vector2f(100,100), Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
CheckGlError();
std::list<TBall>::iterator iBall; std::list<TBall>::iterator iBall;
@ -994,25 +987,17 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
Renderer->PushShader("BrickShader"); Renderer->PushShader("BrickShader");
GetConsole() << "PUSHED BRICK SHADER";
CheckGlError();
for (int i = 0; i < CONST_BRICKMATRIX_WIDTH; i++) for (int i = 0; i < CONST_BRICKMATRIX_WIDTH; i++)
{ {
for (int j = 0; j < CONST_BRICKMATRIX_HEIGHT; j++) for (int j = 0; j < CONST_BRICKMATRIX_HEIGHT; j++)
{ {
BlockMatrix[i][j].TryDrawAppear(i, j, screenWidth); //Draws only appearing/disappearing blocks BlockMatrix[i][j].TryDrawAppear(i, j, screenWidth); //Draws only appearing/disappearing blocks
CheckGlError();
} }
} }
RenderUniform1f("Transparency", 1.f); RenderUniform1f("Transparency", 1.f);
CheckGlError();
//Vector2f outlineShift = Vector2f(((screenWidth - Application->GetGameLevelScreenWidth())*0.5f), 0.f); //Vector2f outlineShift = Vector2f(((screenWidth - Application->GetGameLevelScreenWidth())*0.5f), 0.f);
Renderer->PushMatrix(); Renderer->PushMatrix();
Renderer->TranslateMatrix(Vector3f(offset[0], offset[1], 0)); Renderer->TranslateMatrix(Vector3f(offset[0], offset[1], 0));
@ -1031,22 +1016,13 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
color(2) = c; color(2) = c;
} }
RenderUniform4fv("BrickColor", color.data()); RenderUniform4fv("BrickColor", color.data());
CheckGlError();
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[colorBlockIterator->first.second]); glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[colorBlockIterator->first.second]);
CheckGlError();
Renderer->DrawTriangleList(colorBlockIterator->second); Renderer->DrawTriangleList(colorBlockIterator->second);
CheckGlError();
} }
DrawBallInstancingList(blackAndWhite); DrawBallInstancingList(blackAndWhite);
CheckGlError();
Renderer->PopMatrix(); Renderer->PopMatrix();
@ -1055,14 +1031,10 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
for (iBonus = BonusFallingList.begin(); iBonus != BonusFallingList.end(); ++iBonus) for (iBonus = BonusFallingList.begin(); iBonus != BonusFallingList.end(); ++iBonus)
{ {
iBonus->Draw(); iBonus->Draw();
CheckGlError();
} }
Application->EffectsDraw(); Application->EffectsDraw();
CheckGlError();
Renderer->PopShader(); Renderer->PopShader();
//float LEVEL_VIEWPORT_WIDTH = Application->GetGameLevelScreenWidth(); //float LEVEL_VIEWPORT_WIDTH = Application->GetGameLevelScreenWidth();
@ -1075,29 +1047,21 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
Renderer->DrawRect(Vector2f(-xRW * 0.5f, -yRH * 0.5f) + matrixSize + offset, 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)); 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 wallUpPos1(xlOffset, tSH-ylOffset-uWTW);
const Vector2f wallUpPos2(tSW + xlOffset, tSH-ylOffset); const Vector2f wallUpPos2(tSW + xlOffset, tSH-ylOffset);
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_UP_TEXTURE]); glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_UP_TEXTURE]);
Renderer->DrawRect(wallUpPos1, wallUpPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f)); Renderer->DrawRect(wallUpPos1, wallUpPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
CheckGlError();
const Vector2f wallLeftPos1(xlOffset, lrFBO+ylOffset); const Vector2f wallLeftPos1(xlOffset, lrFBO+ylOffset);
const Vector2f wallLeftPos2(lWTW + xlOffset, tSH-ylOffset-(uWTW*0.68f)); const Vector2f wallLeftPos2(lWTW + xlOffset, tSH-ylOffset-(uWTW*0.68f));
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_LEFT_TEXTURE]); glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_LEFT_TEXTURE]);
Renderer->DrawRect(wallLeftPos1, wallLeftPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f)); 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 wallRightPos1(tSW+xlOffset-rWTW, lrFBO+ylOffset);
const Vector2f wallRightPos2(tSW + xlOffset, tSH-ylOffset-(uWTW*0.68f)); const Vector2f wallRightPos2(tSW + xlOffset, tSH-ylOffset-(uWTW*0.68f));
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_RIGHT_TEXTURE]); glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_RIGHT_TEXTURE]);
Renderer->DrawRect(wallRightPos1, wallRightPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f)); Renderer->DrawRect(wallRightPos1, wallRightPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
CheckGlError();
if (BonusFloorTimer>0.f) if (BonusFloorTimer>0.f)
{ {
@ -1111,8 +1075,6 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
Renderer->DrawRect(wallBonusPos1, wallBonusPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f)); Renderer->DrawRect(wallBonusPos1, wallBonusPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
} }
CheckGlError();
if (!pause && LevelState != CONST_LEVELSTATE_SNAPSHOTTING) if (!pause && LevelState != CONST_LEVELSTATE_SNAPSHOTTING)
@ -1127,8 +1089,6 @@ void TGameLevel::InnerDraw(int screenWidth, int screenHeight, int matrixWidth, i
drawOutline(screenWidth, screenHeight); drawOutline(screenWidth, screenHeight);
CheckGlError();
if (pause && !renderBufferReady) if (pause && !renderBufferReady)
{ {

View File

@ -469,8 +469,6 @@ void TMyApplication::LoadResources()
ResourceManager->FontManager.AddFont("droid_sans14", "droid_sans14_font_bitmap.png", "droid_sans14_font_charmap.txt"); ResourceManager->FontManager.AddFont("droid_sans14", "droid_sans14_font_bitmap.png", "droid_sans14_font_charmap.txt");
ResourceManager->FontManager.PushFont("droid_sans14"); ResourceManager->FontManager.PushFont("droid_sans14");
GetConsole() << "LOAD GAME";
} }
void TMyApplication::TryLoadSavedGame() void TMyApplication::TryLoadSavedGame()
@ -540,12 +538,8 @@ void TMyApplication::InnerUpdate(size_t dt)
return; return;
} }
GetConsole() << "INNER UPDATE";
LoadUserProgress(); LoadUserProgress();
GetConsole() << "LOAD SHADERS";
ResourceManager->ShaderManager.AddShader("HoverableButtonShader", "shaders/gui_transparent.vertex", "shaders/hoverable-button.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("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("ColorShader", "shaders/color-shader.vertex", "shaders/color-shader.fragment");
@ -553,27 +547,19 @@ void TMyApplication::InnerUpdate(size_t dt)
ResourceManager->ShaderManager.AddShader("BrickShader", "shaders/brickshader_vertex.txt", "shaders/brickshader_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"); ResourceManager->ShaderManager.AddShader(ParticleEffect::PARTICLE_SHADER, "shaders/particle-shader.vertex", "shaders/particle-shader.fragment");
GetConsole() << "ADD FRAMEBUFFER";
ResourceManager->FrameManager.AddFrameRenderBuffer("LevelBuffer", 256, 256); ResourceManager->FrameManager.AddFrameRenderBuffer("LevelBuffer", 256, 256);
//OnDrawSignal.connect(boost::bind(&TGameLoading::Draw, boost::ref(GameLoading))); //OnDrawSignal.connect(boost::bind(&TGameLoading::Draw, boost::ref(GameLoading)));
Inited = true; Inited = true;
Application->SetGameLevelScreenScale(); Application->SetGameLevelScreenScale();
//GameLevel.SetLevelScale(); //GameLevel.SetLevelScale();
GetConsole() << "INIT EFFECTS";
EffectsInit(); EffectsInit();
// ------- UI ------- // ------- UI -------
GetConsole() << "LOAD JSON UI";
gamePauseMenuUi = SE::ReadJsonFile(ST::PathToResources + "gui_game_pause_menu.json"); gamePauseMenuUi = SE::ReadJsonFile(ST::PathToResources + "gui_game_pause_menu.json");
galaxyMenuUi = SE::ReadJsonFile(ST::PathToResources + "gui_main_menu.json"); galaxyMenuUi = SE::ReadJsonFile(ST::PathToResources + "gui_main_menu.json");
GetConsole() << "INIT MENU";
// TESTS of menu // TESTS of menu
if (Menu.GalaxMenu.InitGalaxyMenu("levels/galaxy_ptree.json")) { if (Menu.GalaxMenu.InitGalaxyMenu("levels/galaxy_ptree.json")) {
std::cout << "ok" << std::endl; std::cout << "ok" << std::endl;
@ -582,16 +568,10 @@ void TMyApplication::InnerUpdate(size_t dt)
std::cout << "menu error" << std::endl; std::cout << "menu error" << std::endl;
} }
GetConsole() << "RENDER SNAPSHOTS";
RenderLevelSnapshots(); RenderLevelSnapshots();
GetConsole() << "LOAD RESOURCES";
LoadResources(); LoadResources();
GameState = CONST_GAMESTATE_LOADING; GameState = CONST_GAMESTATE_LOADING;
GetConsole() << "PRELOADING END";
} }
else if (GameState == CONST_GAMESTATE_LOADING) else if (GameState == CONST_GAMESTATE_LOADING)
{ {
@ -601,8 +581,6 @@ void TMyApplication::InnerUpdate(size_t dt)
StateTimer -= 1.f; StateTimer -= 1.f;
} }
GetConsole() << "BEFORE LOADING TEXTURES";
if (TextureNamesToLoad.size() != 0) if (TextureNamesToLoad.size() != 0)
{ {
ResourceManager->TexList.AddTexture(TextureNamesToLoad.begin()->first, TextureNamesToLoad.begin()->second); ResourceManager->TexList.AddTexture(TextureNamesToLoad.begin()->first, TextureNamesToLoad.begin()->second);
@ -707,7 +685,6 @@ void TMyApplication::InnerUpdate(size_t dt)
}); });
pauseBackground->onMoveSignal.connect([this](Vector2f, Vector2f shift, int) { pauseBackground->onMoveSignal.connect([this](Vector2f, Vector2f shift, int) {
SE::GetConsole() << std::to_string(shift.norm());
if (shift.norm() > 15) if (shift.norm() > 15)
{ {
GameLevel->TryGoToMenu(); GameLevel->TryGoToMenu();

View File

@ -10,9 +10,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.GestureDetector;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent; import android.view.MotionEvent;
//Deprecated //Deprecated
@ -29,8 +27,6 @@ public class GL2JNIActivity extends Activity
@Override @Override
protected void onCreate(Bundle icicle) protected void onCreate(Bundle icicle)
{ {
Log.d("DEBUG", "START ACTIVITY");
super.onCreate(icicle); super.onCreate(icicle);
instance = this; instance = this;