diff --git a/projects/mtg/bin/Res/graphics/shop_light.png b/projects/mtg/bin/Res/graphics/shop_light.png new file mode 100644 index 000000000..7e3b13b9d Binary files /dev/null and b/projects/mtg/bin/Res/graphics/shop_light.png differ diff --git a/projects/mtg/include/GameStateShop.h b/projects/mtg/include/GameStateShop.h index 62810c5cb..e64980bee 100644 --- a/projects/mtg/include/GameStateShop.h +++ b/projects/mtg/include/GameStateShop.h @@ -25,6 +25,10 @@ class GameStateShop: public GameState, public JGuiListener JQuad * mBack; JQuad * mBg; JTexture * mBgTex; + + int lightAlpha; + int alphaChange; + SimpleMenu * menu; int mStage; char starterBuffer[128], boosterBuffer[128]; diff --git a/projects/mtg/src/GameStateShop.cpp b/projects/mtg/src/GameStateShop.cpp index 533464e18..3f51152f3 100644 --- a/projects/mtg/src/GameStateShop.cpp +++ b/projects/mtg/src/GameStateShop.cpp @@ -53,6 +53,8 @@ void GameStateShop::Start() JRenderer::GetInstance()->EnableVSync(true); + lightAlpha = 0; + alphaChange = 0; shop = NULL; load(); @@ -166,6 +168,12 @@ void GameStateShop::Update(float dt) if (shop) shop->Update(dt); } + + alphaChange = (500 - (rand() % 1000)) * dt; + lightAlpha+= alphaChange; + if (lightAlpha < 0) lightAlpha = 0; + if (lightAlpha > 50) lightAlpha = 50; + } @@ -177,6 +185,13 @@ void GameStateShop::Render() if (mBg) r->RenderQuad(mBg,0,0); + JQuad * quad = resources.RetrieveTempQuad("shop_light.png"); + if (quad){ + r->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE); + quad->SetColor(ARGB(lightAlpha,255,255,255)); + r->RenderQuad(quad,0,0); + r->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); + } if (shop) shop->Render();