From 6c3f69f68f93cce294287b316c01d832c71a7e18 Mon Sep 17 00:00:00 2001 From: lufinkey Date: Thu, 13 Nov 2014 20:06:38 -0500 Subject: [PATCH] Renamed a lot of stupidly named functions Fixed names of a lot of stupidly named functions --- Source/Game.cpp | 2 +- Source/GameEngine/Actor/Actor.cpp | 24 +++--- Source/GameEngine/Actor/TextActor.cpp | 6 +- Source/GameEngine/Actor/WireframeActor.cpp | 6 +- Source/GameEngine/Application.cpp | 32 ++++---- Source/GameEngine/Application.h | 28 +++---- Source/GameEngine/Graphics/Graphics2D.cpp | 12 +-- .../GameEngine/ScreenManager/MenuScreen.cpp | 4 +- Source/GameEngine/View.cpp | 8 +- Source/GameEngine/View.h | 8 +- .../modules/GameEngine/lib_ge_Global.cpp | 28 +++---- Source/SmashBros/Camera.cpp | 78 +++++++++--------- Source/SmashBros/Controls.cpp | 82 +++++++++---------- Source/SmashBros/Game/GameScreen.cpp | 4 +- Source/SmashBros/Game/WinnerScreen.cpp | 2 +- Source/SmashBros/GameElement.cpp | 4 +- Source/SmashBros/Global.cpp | 2 +- Source/SmashBros/HUD.cpp | 14 ++-- Source/SmashBros/Magnifier.cpp | 20 ++--- Source/SmashBros/Menus/CharSelectScreen.cpp | 12 +-- Source/SmashBros/Menus/MenuClasses.cpp | 16 ++-- Source/SmashBros/Stage.cpp | 4 +- 22 files changed, 198 insertions(+), 198 deletions(-) diff --git a/Source/Game.cpp b/Source/Game.cpp index 939a430..973ae49 100755 --- a/Source/Game.cpp +++ b/Source/Game.cpp @@ -77,7 +77,7 @@ namespace SmashBros } firstUpdate = false; } - if(KeyPressed(Keys::ESCAPE) && !PrevKeyPressed(Keys::ESCAPE)) + if(getKeyPressed(Keys::ESCAPE) && !getPrevKeyPressed(Keys::ESCAPE)) { Exit(); } diff --git a/Source/GameEngine/Actor/Actor.cpp b/Source/GameEngine/Actor/Actor.cpp index 66fd4a3..fca028f 100755 --- a/Source/GameEngine/Actor/Actor.cpp +++ b/Source/GameEngine/Actor/Actor.cpp @@ -463,7 +463,7 @@ namespace GameEngine } else { - if(Application::MouseState(Mouse::LEFTCLICK) && !Application::PrevMouseState(Mouse::LEFTCLICK)) + if(Application::getMouseState(Mouse::LEFTCLICK) && !Application::getPrevMouseState(Mouse::LEFTCLICK)) { clicking = true; } @@ -497,7 +497,7 @@ namespace GameEngine } else { - if(clicked && !Application::MouseState(Mouse::LEFTCLICK)) + if(clicked && !Application::getMouseState(Mouse::LEFTCLICK)) { releasing = true; } @@ -735,13 +735,13 @@ namespace GameEngine float mousey = 0; if(relative) { - mousex = (float)Application::TouchX(currentTouchId) + View::x; - mousey = (float)Application::TouchY(currentTouchId) + View::y; + mousex = (float)Application::getTouchX(currentTouchId) + View::x; + mousey = (float)Application::getTouchY(currentTouchId) + View::y; } else { - mousex = (float)Application::TouchX(currentTouchId); - mousey = (float)Application::TouchY(currentTouchId); + mousex = (float)Application::getTouchX(currentTouchId); + mousey = (float)Application::getTouchY(currentTouchId); } if(checkHover(mousex, mousey)) @@ -767,13 +767,13 @@ namespace GameEngine float mousey = 0; if(relative) { - mousex = (float)Application::MouseX() + View::x; - mousey = (float)Application::MouseY() + View::y; + mousex = (float)Application::getMouseX() + View::x; + mousey = (float)Application::getMouseY() + View::y; } else { - mousex = (float)Application::MouseX(); - mousey = (float)Application::MouseY(); + mousex = (float)Application::getMouseX(); + mousey = (float)Application::getMouseY(); } return checkHover(mousex, mousey); @@ -1242,11 +1242,11 @@ namespace GameEngine left1 = (int)(x-(w/2)); left2 = (int)View::x; right1 = (int)(x+(w/2)); - right2 = (int)(View::x+(View::ScaleWidth())); + right2 = (int)(View::x+(View::getScalingWidth())); top1 = (int)(y-(h/2)); top2 = (int)View::y; bottom1 = (int)(y+(h/2)); - bottom2 = (int)(View::y+(View::ScaleHeight())); + bottom2 = (int)(View::y+(View::getScalingHeight())); if (bottom1 < top2) { diff --git a/Source/GameEngine/Actor/TextActor.cpp b/Source/GameEngine/Actor/TextActor.cpp index 9a052e1..cf06f27 100755 --- a/Source/GameEngine/Actor/TextActor.cpp +++ b/Source/GameEngine/Actor/TextActor.cpp @@ -626,11 +626,11 @@ namespace GameEngine left1 = (int)rect.x; left2 = (int)View::x; right1 = (int)rect.x+rect.width; - right2 = (int)View::x+(View::ScaleWidth()); + right2 = (int)View::x+(View::getScalingWidth()); top1 = (int)rect.y; top2 = (int)View::y; bottom1 = (int)rect.y+rect.height; - bottom2 = (int)View::y+(View::ScaleHeight()); + bottom2 = (int)View::y+(View::getScalingHeight()); if (bottom1 < top2) { @@ -777,7 +777,7 @@ namespace GameEngine { if(Application::checkTouchActive(currentTouchId)) { - if(checkHover((float)Application::TouchX(currentTouchId), (float)Application::TouchY(currentTouchId))) + if(checkHover((float)Application::getTouchX(currentTouchId), (float)Application::getTouchY(currentTouchId))) { return true; } diff --git a/Source/GameEngine/Actor/WireframeActor.cpp b/Source/GameEngine/Actor/WireframeActor.cpp index 86298ab..5d488e4 100755 --- a/Source/GameEngine/Actor/WireframeActor.cpp +++ b/Source/GameEngine/Actor/WireframeActor.cpp @@ -546,7 +546,7 @@ namespace GameEngine { if(Application::checkTouchActive(currentTouchId)) { - if(checkHover((float)Application::TouchX(currentTouchId), (float)Application::TouchY(currentTouchId))) + if(checkHover((float)Application::getTouchX(currentTouchId), (float)Application::getTouchY(currentTouchId))) { return true; } @@ -595,11 +595,11 @@ namespace GameEngine left1 = (int)x; left2 = (int)View::x; right1 = (int)x+width; - right2 = (int)View::x+(View::ScaleWidth()); + right2 = (int)View::x+(View::getScalingWidth()); top1 = (int)y; top2 = (int)View::y; bottom1 = (int)y+height; - bottom2 = (int)View::y+(View::ScaleHeight()); + bottom2 = (int)View::y+(View::getScalingHeight()); if (bottom1 < top2) { diff --git a/Source/GameEngine/Application.cpp b/Source/GameEngine/Application.cpp index 8597f5f..967bf3b 100755 --- a/Source/GameEngine/Application.cpp +++ b/Source/GameEngine/Application.cpp @@ -371,7 +371,7 @@ namespace GameEngine if(bgVisible) { BufferedImage*img = AssetManager::getImage(bgName); - graphics->drawImage(img,0,0,(float)View::ScaleWidth(),(float)View::ScaleHeight(),0,0,img->getWidth(),img->getHeight()); + graphics->drawImage(img,0,0,(float)View::getScalingWidth(),(float)View::getScalingHeight(),0,0,img->getWidth(),img->getHeight()); } this->Draw(*graphics,worldTime); if(!paused) @@ -433,7 +433,7 @@ namespace GameEngine { SDL_SetRenderDrawColor(renderer, 0,0,0,255); SDL_RenderClear(renderer); - graphics->drawImage(loadImage,0,0,(float)View::ScaleWidth(),(float)View::ScaleHeight(),0,0,loadImage->getWidth(),loadImage->getHeight()); + graphics->drawImage(loadImage,0,0,(float)View::getScalingWidth(),(float)View::getScalingHeight(),0,0,loadImage->getWidth(),loadImage->getHeight()); graphics->setColor(loadbarColor); graphics->fillRect(loadbarDim[0], loadbarDim[1], (float)((float)(loadCurrent/loadTotal)*loadbarDim[2]), loadbarDim[3]); SDL_RenderPresent(renderer); @@ -592,32 +592,32 @@ namespace GameEngine return result; } - int Application::GetLastKey() + int Application::getLastKey() { return currentLastKey; } - bool Application::KeyPressed(int key) //check if a key is pressed + bool Application::getKeyPressed(int key) //check if a key is pressed { return currentKeyState[key]; } - bool Application::PrevKeyPressed(int key) //check if a key was pressed in the last frame + bool Application::getPrevKeyPressed(int key) //check if a key was pressed in the last frame { return prevKeyState[key]; } - bool Application::MouseState(int state) + bool Application::getMouseState(int state) { return currentMouseState[state]; } - bool Application::PrevMouseState(int state) + bool Application::getPrevMouseState(int state) { return prevMouseState[state]; } - int Application::MouseX() + int Application::getMouseX() { if(scalescreen) { @@ -629,7 +629,7 @@ namespace GameEngine } } - int Application::PrevMouseX() + int Application::getPrevMouseX() { if(scalescreen) { @@ -641,7 +641,7 @@ namespace GameEngine } } - int Application::MouseY() + int Application::getMouseY() { if(scalescreen) { @@ -653,7 +653,7 @@ namespace GameEngine } } - int Application::PrevMouseY() + int Application::getPrevMouseY() { if(scalescreen) { @@ -665,7 +665,7 @@ namespace GameEngine } } - int Application::TouchX(long touchID) + int Application::getTouchX(long touchID) { TouchPoint*point = getTouchPoint(touchID); if(point==NULL) @@ -682,7 +682,7 @@ namespace GameEngine } } - int Application::PrevTouchX(long touchID) + int Application::getPrevTouchX(long touchID) { TouchPoint*point = getPrevTouchPoint(touchID); if(point==NULL) @@ -699,7 +699,7 @@ namespace GameEngine } } - int Application::TouchY(long touchID) + int Application::getTouchY(long touchID) { TouchPoint*point = getTouchPoint(touchID); if(point==NULL) @@ -716,7 +716,7 @@ namespace GameEngine } } - int Application::PrevTouchY(long touchID) + int Application::getPrevTouchY(long touchID) { TouchPoint*point = getPrevTouchPoint(touchID); if(point==NULL) @@ -1127,7 +1127,7 @@ namespace GameEngine if(showLoad) { BufferedImage*img = AssetManager::getImage(loadScreen); - graphics->drawImage(img,0,0,(float)View::ScaleWidth(),(float)View::ScaleHeight(),0,0,img->getWidth(),img->getHeight()); + graphics->drawImage(img,0,0,(float)View::getScalingWidth(),(float)View::getScalingHeight(),0,0,img->getWidth(),img->getHeight()); }*/ graphics->setColor(loadbarColor); graphics->fillRect(loadbarDim[0], loadbarDim[1], (float)((float)(loadCurrent/loadTotal)*loadbarDim[2]), loadbarDim[3]); diff --git a/Source/GameEngine/Application.h b/Source/GameEngine/Application.h index 53bf1b3..20efe4a 100755 --- a/Source/GameEngine/Application.h +++ b/Source/GameEngine/Application.h @@ -129,20 +129,20 @@ namespace GameEngine static void showMessage(const String&title, const String&message); static int showMessage(const String&title, const String&message, const ArrayList&options); - static int GetLastKey(); - static bool KeyPressed(int key); - static bool PrevKeyPressed(int key); - - static bool MouseState(int state); - static bool PrevMouseState(int state); - static int MouseX(); - static int MouseY(); - static int PrevMouseX(); - static int PrevMouseY(); - static int TouchX(long touchID); - static int PrevTouchX(long touchID); - static int TouchY(long touchID); - static int PrevTouchY(long touchID); + static int getLastKey(); + static bool getKeyPressed(int key); + static bool getPrevKeyPressed(int key); + + static bool getMouseState(int state); + static bool getPrevMouseState(int state); + static int getMouseX(); + static int getMouseY(); + static int getPrevMouseX(); + static int getPrevMouseY(); + static int getTouchX(long touchID); + static int getPrevTouchX(long touchID); + static int getTouchY(long touchID); + static int getPrevTouchY(long touchID); static bool checkTouchActive(long touchID); static bool checkPrevTouchActive(long touchID); static ArrayList getTouchPoints(); diff --git a/Source/GameEngine/Graphics/Graphics2D.cpp b/Source/GameEngine/Graphics/Graphics2D.cpp index d108587..2426da7 100755 --- a/Source/GameEngine/Graphics/Graphics2D.cpp +++ b/Source/GameEngine/Graphics/Graphics2D.cpp @@ -22,8 +22,8 @@ namespace GameEngine SDL_Rect rect; rect.x = 0; rect.y = 0; - rect.w = View::Width(); - rect.h = View::Height(); + rect.w = View::getWidth(); + rect.h = View::getHeight(); SDL_RenderSetViewport(renderer, &rect); } @@ -72,16 +72,16 @@ namespace GameEngine srcrect.top += lev; dstrect.top += (float)((lev/srcH)*dstH); } - if(dstrect.right > View::Width()) + if(dstrect.right > View::getWidth()) { - float dif = dstrect.right - View::Width(); + float dif = dstrect.right - View::getWidth(); float lev = (float)((int)((dif/dstW)*srcW)); srcrect.right -= lev; dstrect.right -= (float)((lev/srcW)*dstW); } - if(dstrect.bottom > View::Height()) + if(dstrect.bottom > View::getHeight()) { - float dif = dstrect.bottom - View::Height(); + float dif = dstrect.bottom - View::getHeight(); float lev = (float)((int)((dif/dstH)*srcH)); srcrect.bottom -= lev; dstrect.bottom -= (float)((lev/srcH)*dstH); diff --git a/Source/GameEngine/ScreenManager/MenuScreen.cpp b/Source/GameEngine/ScreenManager/MenuScreen.cpp index 64cee8e..097e0b9 100755 --- a/Source/GameEngine/ScreenManager/MenuScreen.cpp +++ b/Source/GameEngine/ScreenManager/MenuScreen.cpp @@ -81,7 +81,7 @@ namespace GameEngine } else { - if(Application::MouseState(Mouse::LEFTCLICK)) + if(Application::getMouseState(Mouse::LEFTCLICK)) { selecting = true; } @@ -115,7 +115,7 @@ namespace GameEngine } } - if(selectedIndex>=0 && !Application::MouseState(Mouse::LEFTCLICK) && Application::PrevMouseState(Mouse::LEFTCLICK)) + if(selectedIndex>=0 && !Application::getMouseState(Mouse::LEFTCLICK) && Application::getPrevMouseState(Mouse::LEFTCLICK)) { Items.get(selectedIndex)->OnRelease(); Items.get(selectedIndex)->setSelected(false); diff --git a/Source/GameEngine/View.cpp b/Source/GameEngine/View.cpp index 1ad2548..21cd3c7 100755 --- a/Source/GameEngine/View.cpp +++ b/Source/GameEngine/View.cpp @@ -41,22 +41,22 @@ namespace GameEngine scaleHeight=h; } - int View::Width() + int View::getWidth() { return windowWidth; } - int View::Height() + int View::getHeight() { return windowHeight; } - int View::ScaleWidth() + int View::getScalingWidth() { return scaleWidth; } - int View::ScaleHeight() + int View::getScalingHeight() { return scaleHeight; } diff --git a/Source/GameEngine/View.h b/Source/GameEngine/View.h index c972270..df2074b 100755 --- a/Source/GameEngine/View.h +++ b/Source/GameEngine/View.h @@ -32,10 +32,10 @@ namespace GameEngine static void setSize(int w, int h); static void setScaleSize(int w, int h); - static int Width(); - static int Height(); - static int ScaleWidth(); - static int ScaleHeight(); + static int getWidth(); + static int getHeight(); + static int getScalingWidth(); + static int getScalingHeight(); static void Update(Graphics2D& g); static void Draw(Graphics2D& g); diff --git a/Source/ScriptModule/modules/GameEngine/lib_ge_Global.cpp b/Source/ScriptModule/modules/GameEngine/lib_ge_Global.cpp index fdcacdb..7f6f97e 100644 --- a/Source/ScriptModule/modules/GameEngine/lib_ge_Global.cpp +++ b/Source/ScriptModule/modules/GameEngine/lib_ge_Global.cpp @@ -43,16 +43,16 @@ namespace GameEngine chaiscript::Module* m_gameengine_global = new chaiscript::Module(); //Application - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::Exit), "Application_Exit"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::GetLastKey), "Application_GetLastKey"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::KeyPressed), "Application_KeyPressed"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::PrevKeyPressed), "Application_PrevKeyPressed"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::MouseState), "Application_MouseState"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::PrevMouseState), "Application_PrevMouseState"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::MouseX), "Application_MouseX"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::MouseY), "Application_MouseY"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::PrevMouseX), "Application_PrevMouseX"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::PrevMouseY), "Application_PrevMouseY"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::Exit), "Application_exit"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getLastKey), "Application_getLastKey"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getKeyPressed), "Application_getKeyPressed"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getPrevKeyPressed), "Application_getPrevKeyPressed"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getMouseState), "Application_getMouseState"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getPrevMouseState), "Application_getPrevMouseState"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getMouseX), "Application_getMouseX"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getMouseY), "Application_getMouseY"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getPrevMouseX), "Application_getPrevMouseX"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getPrevMouseY), "Application_getPrevMouseY"); m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::setWindowTitle), "Application_setWindowTitle"); m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::setUpdatesPerFrame), "Application_setUpdatesPerFrame"); m_gameengine_global->add(chaiscript::fun(&GameEngine::Application::getFrame), "Application_getFrame"); @@ -142,10 +142,10 @@ namespace GameEngine m_gameengine_global->add(chaiscript::fun(&GameEngine::View_setY), "View_setY"); m_gameengine_global->add(chaiscript::fun(&GameEngine::View_setZoom), "View_setZoom"); m_gameengine_global->add(chaiscript::fun(&GameEngine::View::setSize), "View_setSize"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::View::Width), "View_getWidth"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::View::Height), "View_getHeight"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::View::ScaleWidth), "View_getScaleWidth"); - m_gameengine_global->add(chaiscript::fun(&GameEngine::View::ScaleHeight), "View_getScaleHeight"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::View::getWidth), "View_getWidth"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::View::getHeight), "View_getHeight"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::View::getScalingWidth), "View_getScalingWidth"); + m_gameengine_global->add(chaiscript::fun(&GameEngine::View::getScalingHeight), "View_getScalingHeight"); return chaiscript::ModulePtr(m_gameengine_global); } diff --git a/Source/SmashBros/Camera.cpp b/Source/SmashBros/Camera.cpp index 7dc2bf8..8c9356b 100755 --- a/Source/SmashBros/Camera.cpp +++ b/Source/SmashBros/Camera.cpp @@ -168,10 +168,10 @@ namespace SmashBros default: case MODE_FIXED: { - View::x = (float)(x + (float)Global::currentStage->x - (float)View::ScaleWidth()/2); - View::y = (float)(y + (float)Global::currentStage->y - (float)View::ScaleHeight()/2); - float zoomH = (float)View::ScaleHeight()/(float)(Global::currentStage->bottomViewBorder - Global::currentStage->topViewBorder); - float zoomW = (float)View::ScaleWidth()/(float)(Global::currentStage->rightViewBorder - Global::currentStage->leftViewBorder); + View::x = (float)(x + (float)Global::currentStage->x - (float)View::getScalingWidth()/2); + View::y = (float)(y + (float)Global::currentStage->y - (float)View::getScalingHeight()/2); + float zoomH = (float)View::getScalingHeight()/(float)(Global::currentStage->bottomViewBorder - Global::currentStage->topViewBorder); + float zoomW = (float)View::getScalingWidth()/(float)(Global::currentStage->rightViewBorder - Global::currentStage->leftViewBorder); if(zoomH>zoomW) { Zoom = zoomH; @@ -183,29 +183,29 @@ namespace SmashBros float centerX = (float)(x + Global::currentStage->x); float centerY = (float)(y + Global::currentStage->y); - float left = (float)(centerX - ((float)View::ScaleWidth()/((float)2*Zoom))); - float right = (float)(centerX +((float)View::ScaleWidth()/((float)2*Zoom))); - float top = (float)(centerY - ((float)View::ScaleHeight()/((float)2*Zoom))); - float bottom = (float)(centerY +((float)View::ScaleHeight()/((float)2*Zoom))); + float left = (float)(centerX - ((float)View::getScalingWidth()/((float)2*Zoom))); + float right = (float)(centerX +((float)View::getScalingWidth()/((float)2*Zoom))); + float top = (float)(centerY - ((float)View::getScalingHeight()/((float)2*Zoom))); + float bottom = (float)(centerY +((float)View::getScalingHeight()/((float)2*Zoom))); if(left<(Global::currentStage->x + Global::currentStage->leftViewBorder)) { - centerX = (float)((Global::currentStage->x + Global::currentStage->leftViewBorder) + View::ScaleWidth()/(Zoom*2)); + centerX = (float)((Global::currentStage->x + Global::currentStage->leftViewBorder) + View::getScalingWidth()/(Zoom*2)); } else if(right>(Global::currentStage->x + Global::currentStage->rightViewBorder)) { - centerX = (float)((Global::currentStage->x + Global::currentStage->rightViewBorder) - View::ScaleWidth()/(Zoom*2)); + centerX = (float)((Global::currentStage->x + Global::currentStage->rightViewBorder) - View::getScalingWidth()/(Zoom*2)); } if(top<(Global::currentStage->y + Global::currentStage->topViewBorder)) { - centerY = (float)((Global::currentStage->y + Global::currentStage->topViewBorder) + View::ScaleHeight()/(Zoom*2)); + centerY = (float)((Global::currentStage->y + Global::currentStage->topViewBorder) + View::getScalingHeight()/(Zoom*2)); } else if(bottom>(Global::currentStage->y + Global::currentStage->bottomViewBorder)) { - centerY = (float)((Global::currentStage->y + Global::currentStage->bottomViewBorder) - View::ScaleHeight()/(Zoom*2)); + centerY = (float)((Global::currentStage->y + Global::currentStage->bottomViewBorder) - View::getScalingHeight()/(Zoom*2)); } - camX = (float)((centerX*Zoom) - ((float)View::ScaleWidth()/2)); - camY = (float)((centerY*Zoom) - ((float)View::ScaleHeight()/2)); + camX = (float)((centerX*Zoom) - ((float)View::getScalingWidth()/2)); + camY = (float)((centerY*Zoom) - ((float)View::getScalingHeight()/2)); View::x = camX; View::y = camY; @@ -214,8 +214,8 @@ namespace SmashBros case MODE_FOLLOW: { - camX = (float)(((float)rect.x*Zoom) - (((float)View::ScaleWidth() - ((float)rect.width*Zoom))/2)); - camY = (float)(((float)rect.y*Zoom) - (((float)View::ScaleHeight() - ((float)rect.height*Zoom))/2)); + camX = (float)(((float)rect.x*Zoom) - (((float)View::getScalingWidth() - ((float)rect.width*Zoom))/2)); + camY = (float)(((float)rect.y*Zoom) - (((float)View::getScalingHeight() - ((float)rect.height*Zoom))/2)); float leftSide = (float)((Global::currentStage->x + borders.left)*Zoom); float rightSide = (float)((Global::currentStage->x + borders.right)*Zoom); @@ -226,17 +226,17 @@ namespace SmashBros { camX = leftSide; } - else if((camX + View::ScaleWidth()) > rightSide) + else if((camX + View::getScalingWidth()) > rightSide) { - camX = (rightSide - View::ScaleWidth()); + camX = (rightSide - View::getScalingWidth()); } if(camY < topSide) { camY = topSide; } - else if((camY + View::ScaleHeight()) > bottomSide) + else if((camY + View::getScalingHeight()) > bottomSide) { - camY = (bottomSide - View::ScaleHeight()); + camY = (bottomSide - View::getScalingHeight()); } View::x = (float)((x*Zoom) + camX); @@ -246,11 +246,11 @@ namespace SmashBros case MODE_ZOOM: { - float zoomW = (float)View::ScaleWidth()/(float)rect.width; - float zoomH = (float)View::ScaleHeight()/(float)rect.height; + float zoomW = (float)View::getScalingWidth()/(float)rect.width; + float zoomH = (float)View::getScalingHeight()/(float)rect.height; float expzoom; - if((rect.width*zoomH) > View::ScaleWidth()) + if((rect.width*zoomH) > View::getScalingWidth()) { expzoom = zoomW; //Zoom = zoomW; @@ -261,8 +261,8 @@ namespace SmashBros //Zoom = zoomH; } - float zoomx = (float)View::ScaleWidth()/(borders.right - borders.left); - float zoomy = (float)View::ScaleHeight()/(borders.bottom - borders.top); + float zoomx = (float)View::getScalingWidth()/(borders.right - borders.left); + float zoomy = (float)View::getScalingHeight()/(borders.bottom - borders.top); float cmpzoom; float setZoom; @@ -313,8 +313,8 @@ namespace SmashBros //g.setColor(Color::BLUE); //g.drawRect((int)(rect.x*Zoom), (int)(rect.y*Zoom), (int)(rect.width*Zoom), (int)(rect.height*Zoom)); - camX = (float)(((float)rect.x*Zoom) - (((float)View::ScaleWidth() - ((float)rect.width*Zoom))/2)); - camY = (float)(((float)rect.y*Zoom) - (((float)View::ScaleHeight() - ((float)rect.height*Zoom))/2)); + camX = (float)(((float)rect.x*Zoom) - (((float)View::getScalingWidth() - ((float)rect.width*Zoom))/2)); + camY = (float)(((float)rect.y*Zoom) - (((float)View::getScalingHeight() - ((float)rect.height*Zoom))/2)); float leftSide = (float)((Global::currentStage->x + borders.left)*Zoom); float rightSide = (float)((Global::currentStage->x + borders.right)*Zoom); @@ -325,28 +325,28 @@ namespace SmashBros { camX = leftSide; } - else if((camX + View::ScaleWidth()) > rightSide) + else if((camX + View::getScalingWidth()) > rightSide) { - camX = (rightSide - View::ScaleWidth()); + camX = (rightSide - View::getScalingWidth()); } if(camY < topSide) { camY = topSide; } - else if((camY + View::ScaleHeight()) > bottomSide) + else if((camY + View::getScalingHeight()) > bottomSide) { - camY = (bottomSide - View::ScaleHeight()); + camY = (bottomSide - View::getScalingHeight()); } - float centerX = (float)((camX + ((float)View::ScaleWidth()/2))/Zoom); - float centerY = (float)((camY + ((float)View::ScaleHeight()/2))/Zoom); + float centerX = (float)((camX + ((float)View::getScalingWidth()/2))/Zoom); + float centerY = (float)((camY + ((float)View::getScalingHeight()/2))/Zoom); if(firstUpdate) { centerX = (float)Global::currentStage->x; centerY = (float)Global::currentStage->y; - float zoom1 = (float)View::ScaleWidth()/(float)(borders.right - borders.left); - float zoom2 = (float)View::ScaleHeight()/(float)(borders.bottom - borders.top); + float zoom1 = (float)View::getScalingWidth()/(float)(borders.right - borders.left); + float zoom2 = (float)View::getScalingHeight()/(float)(borders.bottom - borders.top); if(zoom1 > zoom2) { Zoom = zoom1; @@ -391,8 +391,8 @@ namespace SmashBros } } - camX = (float)((centerX*Zoom) - ((float)View::ScaleWidth()/2)); - camY = (float)((centerY*Zoom) - ((float)View::ScaleHeight()/2)); + camX = (float)((centerX*Zoom) - ((float)View::getScalingWidth()/2)); + camY = (float)((centerY*Zoom) - ((float)View::getScalingHeight()/2)); firstFocus = false; } @@ -488,11 +488,11 @@ namespace SmashBros int Camera::Width() { - return (int)((double)View::ScaleWidth()/Zoom); + return (int)((double)View::getScalingWidth()/Zoom); } int Camera::Height() { - return (int)((double)View::ScaleHeight()/Zoom); + return (int)((double)View::getScalingHeight()/Zoom); } } \ No newline at end of file diff --git a/Source/SmashBros/Controls.cpp b/Source/SmashBros/Controls.cpp index 0c15ece..df6da38 100755 --- a/Source/SmashBros/Controls.cpp +++ b/Source/SmashBros/Controls.cpp @@ -93,7 +93,7 @@ namespace SmashBros arrow_right->setScale(2); arrow_right->setAlpha(0.5f); - joystickArea = new WireframeActor(0,0,View::ScaleWidth()/2, View::ScaleHeight()); + joystickArea = new WireframeActor(0,0,View::getScalingWidth()/2, View::getScalingHeight()); joystickArea->relativeToView(false); joystick = new Actor(150, 450); @@ -326,8 +326,8 @@ namespace SmashBros if(joystickArea->isClicked()) { long touchId = joystickArea->getTouchId(); - int mousex = Game::TouchX(touchId); - int mousey = Game::TouchY(touchId); + int mousex = Game::getTouchX(touchId); + int mousey = Game::getTouchY(touchId); byte dir = PrimitiveActor::getDir(joystick->x, joystick->y, (float)mousex, (float)mousey); float dist = (float)PrimitiveActor::distanceUnSqr(joystick->x, joystick->y, (float)mousex, (float)mousey); if(dist<=centerDist) @@ -1083,8 +1083,8 @@ namespace SmashBros if(playr->chargingAttack) { long touchId = joystickArea->getTouchId(); - int mousex = Game::TouchX(touchId); - int mousey = Game::TouchY(touchId); + int mousex = Game::getTouchX(touchId); + int mousey = Game::getTouchY(touchId); byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); switch(dir) { @@ -1251,8 +1251,8 @@ namespace SmashBros if(playr->attacksPriority!=-1) { long touchId = joystickArea->getTouchId(); - int mousex = Game::TouchX(touchId); - int mousey = Game::TouchY(touchId); + int mousex = Game::getTouchX(touchId); + int mousey = Game::getTouchY(touchId); byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); if(dir == PrimitiveActor::DIR_UP) { @@ -1303,8 +1303,8 @@ namespace SmashBros if(playr->attacksPriority!=-1) { long touchId = joystickArea->getTouchId(); - int mousex = Game::TouchX(touchId); - int mousey = Game::TouchY(touchId); + int mousex = Game::getTouchX(touchId); + int mousey = Game::getTouchY(touchId); byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); if(dir == PrimitiveActor::DIR_UP) { @@ -1365,8 +1365,8 @@ namespace SmashBros if(playr->attacksPriority!=-1) { long touchId = joystickArea->getTouchId(); - int mousex = Game::TouchX(touchId); - int mousey = Game::TouchY(touchId); + int mousex = Game::getTouchX(touchId); + int mousey = Game::getTouchY(touchId); byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); if(dir == PrimitiveActor::DIR_UP) { @@ -1417,8 +1417,8 @@ namespace SmashBros if(playr->attacksPriority!=-1) { long touchId = joystickArea->getTouchId(); - int mousex = Game::TouchX(touchId); - int mousey = Game::TouchY(touchId); + int mousex = Game::getTouchX(touchId); + int mousey = Game::getTouchY(touchId); byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); if(dir == PrimitiveActor::DIR_UP) { @@ -2110,42 +2110,42 @@ namespace SmashBros { if(Global::characters[i]!=null && !Global::characters[i]->isCPU() && Global::characters[i]->isAlive()) { - if(Game::KeyPressed(controls[i][BUTTON_UP]) && !Game::PrevKeyPressed(controls[i][BUTTON_UP])) + if(Game::getKeyPressed(controls[i][BUTTON_UP]) && !Game::getPrevKeyPressed(controls[i][BUTTON_UP])) { buttonUp(i,DOWN); } - if(Game::KeyPressed(controls[i][BUTTON_DOWN]) && !Game::PrevKeyPressed(controls[i][BUTTON_DOWN])) + if(Game::getKeyPressed(controls[i][BUTTON_DOWN]) && !Game::getPrevKeyPressed(controls[i][BUTTON_DOWN])) { buttonDown(i,DOWN); } - if(Game::KeyPressed(controls[i][BUTTON_LEFT]) && !Game::PrevKeyPressed(controls[i][BUTTON_LEFT])) + if(Game::getKeyPressed(controls[i][BUTTON_LEFT]) && !Game::getPrevKeyPressed(controls[i][BUTTON_LEFT])) { buttonLeft(i,DOWN); } - if(Game::KeyPressed(controls[i][BUTTON_RIGHT]) && !Game::PrevKeyPressed(controls[i][BUTTON_RIGHT])) + if(Game::getKeyPressed(controls[i][BUTTON_RIGHT]) && !Game::getPrevKeyPressed(controls[i][BUTTON_RIGHT])) { buttonRight(i,DOWN); } - if(Game::KeyPressed(controls[i][BUTTON_JUMP]) && !Game::PrevKeyPressed(controls[i][BUTTON_JUMP])) + if(Game::getKeyPressed(controls[i][BUTTON_JUMP]) && !Game::getPrevKeyPressed(controls[i][BUTTON_JUMP])) { buttonX(i,DOWN); } - if(Game::KeyPressed(controls[i][BUTTON_STANDARD]) && !Game::PrevKeyPressed(controls[i][BUTTON_STANDARD])) + if(Game::getKeyPressed(controls[i][BUTTON_STANDARD]) && !Game::getPrevKeyPressed(controls[i][BUTTON_STANDARD])) { buttonA(i,DOWN); } - if(Game::KeyPressed(controls[i][BUTTON_SPECIAL]) && !Game::PrevKeyPressed(controls[i][BUTTON_SPECIAL])) + if(Game::getKeyPressed(controls[i][BUTTON_SPECIAL]) && !Game::getPrevKeyPressed(controls[i][BUTTON_SPECIAL])) { buttonB(i,DOWN); } - if(Game::KeyPressed(controls[i][BUTTON_GRAB]) && !Game::PrevKeyPressed(controls[i][BUTTON_GRAB])) + if(Game::getKeyPressed(controls[i][BUTTON_GRAB]) && !Game::getPrevKeyPressed(controls[i][BUTTON_GRAB])) { buttonZ(i,DOWN); } @@ -2159,90 +2159,90 @@ namespace SmashBros { if(Global::characters[i]!=null && !Global::characters[i]->isCPU() && Global::characters[i]->isAlive()) { - if(!Game::KeyPressed(controls[i][BUTTON_UP]) && Game::PrevKeyPressed(controls[i][BUTTON_UP])) + if(!Game::getKeyPressed(controls[i][BUTTON_UP]) && Game::getPrevKeyPressed(controls[i][BUTTON_UP])) { buttonUp(i,UP); - if(Game::KeyPressed(controls[i][BUTTON_LEFT])) + if(Game::getKeyPressed(controls[i][BUTTON_LEFT])) { Global::characters[i]->buttondir=BUTTONDIR_LEFT; } - else if(Game::KeyPressed(controls[i][BUTTON_RIGHT])) + else if(Game::getKeyPressed(controls[i][BUTTON_RIGHT])) { Global::characters[i]->buttondir=BUTTONDIR_RIGHT; } - else if(Game::KeyPressed(controls[i][BUTTON_DOWN])) + else if(Game::getKeyPressed(controls[i][BUTTON_DOWN])) { Global::characters[i]->buttondir=BUTTONDIR_DOWN; } } - if(!Game::KeyPressed(controls[i][BUTTON_DOWN]) && Game::PrevKeyPressed(controls[i][BUTTON_DOWN])) + if(!Game::getKeyPressed(controls[i][BUTTON_DOWN]) && Game::getPrevKeyPressed(controls[i][BUTTON_DOWN])) { buttonDown(i,UP); - if(Game::KeyPressed(controls[i][BUTTON_LEFT])) + if(Game::getKeyPressed(controls[i][BUTTON_LEFT])) { Global::characters[i]->buttondir=BUTTONDIR_LEFT; } - else if(Game::KeyPressed(controls[i][BUTTON_RIGHT])) + else if(Game::getKeyPressed(controls[i][BUTTON_RIGHT])) { Global::characters[i]->buttondir=BUTTONDIR_RIGHT; } - else if(Game::KeyPressed(controls[i][BUTTON_UP])) + else if(Game::getKeyPressed(controls[i][BUTTON_UP])) { Global::characters[i]->buttondir=BUTTONDIR_UP; } } - if(!Game::KeyPressed(controls[i][BUTTON_LEFT]) && Game::PrevKeyPressed(controls[i][BUTTON_LEFT])) + if(!Game::getKeyPressed(controls[i][BUTTON_LEFT]) && Game::getPrevKeyPressed(controls[i][BUTTON_LEFT])) { buttonLeft(i,UP); - if(Game::KeyPressed(controls[i][BUTTON_RIGHT])) + if(Game::getKeyPressed(controls[i][BUTTON_RIGHT])) { Global::characters[i]->buttondir=BUTTONDIR_RIGHT; } - else if(Game::KeyPressed(controls[i][BUTTON_UP])) + else if(Game::getKeyPressed(controls[i][BUTTON_UP])) { Global::characters[i]->buttondir=BUTTONDIR_UP; } - else if(Game::KeyPressed(controls[i][BUTTON_DOWN])) + else if(Game::getKeyPressed(controls[i][BUTTON_DOWN])) { Global::characters[i]->buttondir=BUTTONDIR_DOWN; } } - if(!Game::KeyPressed(controls[i][BUTTON_RIGHT]) && Game::PrevKeyPressed(controls[i][BUTTON_RIGHT])) + if(!Game::getKeyPressed(controls[i][BUTTON_RIGHT]) && Game::getPrevKeyPressed(controls[i][BUTTON_RIGHT])) { buttonRight(i,UP); - if(Game::KeyPressed(controls[i][BUTTON_LEFT])) + if(Game::getKeyPressed(controls[i][BUTTON_LEFT])) { Global::characters[i]->buttondir=BUTTONDIR_LEFT; } - else if(Game::KeyPressed(controls[i][BUTTON_UP])) + else if(Game::getKeyPressed(controls[i][BUTTON_UP])) { Global::characters[i]->buttondir=BUTTONDIR_UP; } - else if(Game::KeyPressed(controls[i][BUTTON_DOWN])) + else if(Game::getKeyPressed(controls[i][BUTTON_DOWN])) { Global::characters[i]->buttondir=BUTTONDIR_DOWN; } } - if(!Game::KeyPressed(controls[i][BUTTON_JUMP]) && Game::PrevKeyPressed(controls[i][BUTTON_JUMP])) + if(!Game::getKeyPressed(controls[i][BUTTON_JUMP]) && Game::getPrevKeyPressed(controls[i][BUTTON_JUMP])) { buttonX(i,UP); } - if(!Game::KeyPressed(controls[i][BUTTON_STANDARD]) && Game::PrevKeyPressed(controls[i][BUTTON_STANDARD])) + if(!Game::getKeyPressed(controls[i][BUTTON_STANDARD]) && Game::getPrevKeyPressed(controls[i][BUTTON_STANDARD])) { buttonA(i,UP); } - if(!Game::KeyPressed(controls[i][BUTTON_SPECIAL]) && Game::PrevKeyPressed(controls[i][BUTTON_SPECIAL])) + if(!Game::getKeyPressed(controls[i][BUTTON_SPECIAL]) && Game::getPrevKeyPressed(controls[i][BUTTON_SPECIAL])) { buttonB(i,UP); } - if(!Game::KeyPressed(controls[i][BUTTON_GRAB]) && Game::PrevKeyPressed(controls[i][BUTTON_GRAB])) + if(!Game::getKeyPressed(controls[i][BUTTON_GRAB]) && Game::getPrevKeyPressed(controls[i][BUTTON_GRAB])) { buttonZ(i,UP); } diff --git a/Source/SmashBros/Game/GameScreen.cpp b/Source/SmashBros/Game/GameScreen.cpp index 97a8d8e..a4c59c8 100755 --- a/Source/SmashBros/Game/GameScreen.cpp +++ b/Source/SmashBros/Game/GameScreen.cpp @@ -133,7 +133,7 @@ namespace SmashBros } if(Global::currentStage!=null) { - if(Game::KeyPressed(Keys::ENTER) && !prevEnterPressed) + if(Game::getKeyPressed(Keys::ENTER) && !prevEnterPressed) { if(Game::Suspended()) { @@ -147,7 +147,7 @@ namespace SmashBros } prevEnterPressed = true; } - else if(!Game::KeyPressed(Keys::ENTER)) + else if(!Game::getKeyPressed(Keys::ENTER)) { prevEnterPressed = false; } diff --git a/Source/SmashBros/Game/WinnerScreen.cpp b/Source/SmashBros/Game/WinnerScreen.cpp index 54263eb..9810e52 100755 --- a/Source/SmashBros/Game/WinnerScreen.cpp +++ b/Source/SmashBros/Game/WinnerScreen.cpp @@ -180,7 +180,7 @@ namespace SmashBros for(int i=0; ix = (float)((float)View::ScaleWidth() / (float)(Global::charAmount+1))*(float)(i+1); + stat->x = (float)((float)View::getScalingWidth() / (float)(Global::charAmount+1))*(float)(i+1); stat->y = 250; } diff --git a/Source/SmashBros/GameElement.cpp b/Source/SmashBros/GameElement.cpp index 33141ce..e29fc09 100755 --- a/Source/SmashBros/GameElement.cpp +++ b/Source/SmashBros/GameElement.cpp @@ -40,11 +40,11 @@ namespace SmashBros left1 = ((x*Camera::Zoom)-(((float)w/2)*Camera::Zoom)); left2 = View::x; right1 = ((x*Camera::Zoom)+(((float)w/2)*Camera::Zoom)); - right2 = (View::x+(View::ScaleWidth())); + right2 = (View::x+(View::getScalingWidth())); top1 = ((y*Camera::Zoom)-(((float)h/2)*Camera::Zoom)); top2 = View::y; bottom1 = ((y*Camera::Zoom)+(((float)h/2)*Camera::Zoom)); - bottom2 = (View::y+(View::ScaleHeight())); + bottom2 = (View::y+(View::getScalingHeight())); if (bottom1 < top2) { diff --git a/Source/SmashBros/Global.cpp b/Source/SmashBros/Global.cpp index 369497c..a9c3764 100755 --- a/Source/SmashBros/Global.cpp +++ b/Source/SmashBros/Global.cpp @@ -352,7 +352,7 @@ namespace SmashBros Magnifier::load(); - currentStage = StageLoader::createStage((float)View::ScaleWidth()/2, (float)View::ScaleHeight()/2, selectedStage); + currentStage = StageLoader::createStage((float)View::getScalingWidth()/2, (float)View::getScalingHeight()/2, selectedStage); createPlayers(); diff --git a/Source/SmashBros/HUD.cpp b/Source/SmashBros/HUD.cpp index d58d078..981d1f3 100755 --- a/Source/SmashBros/HUD.cpp +++ b/Source/SmashBros/HUD.cpp @@ -48,7 +48,7 @@ namespace SmashBros trainingMenu = null; } - ReadyGo = new ReadyGoActor(View::ScaleWidth() * 0.5f,View::ScaleHeight() * 0.5f, this); + ReadyGo = new ReadyGoActor(View::getScalingWidth() * 0.5f,View::getScalingHeight() * 0.5f, this); ReadyGo->setRelativeToView(false); ReadyGo->addAnimation(new Animation("ready",1,"Images/Game/HUD/Ready.png")); @@ -64,7 +64,7 @@ namespace SmashBros } ReadyGo->setScale(0.7f); - FinishGame = new Actor(View::ScaleWidth() * 0.5f,View::ScaleHeight() * 0.5f); + FinishGame = new Actor(View::getScalingWidth() * 0.5f,View::getScalingHeight() * 0.5f); FinishGame->setRelativeToView(false); FinishGame->addAnimation(new Animation("game", 1, "Images/Game/HUD/Game.png")); @@ -79,14 +79,14 @@ namespace SmashBros CharacterPanel*panel = new CharacterPanel(this,i); - panel->y = (View::ScaleHeight() * 0.8f); + panel->y = (View::getScalingHeight() * 0.8f); if(Global::suddenDeath) { - panel->x = ((float)View::ScaleWidth() / (Global::suddenDeathPlayers.size()+1))*counter; + panel->x = ((float)View::getScalingWidth() / (Global::suddenDeathPlayers.size()+1))*counter; } else { - panel->x = ((float)View::ScaleWidth() / (Global::charAmount+1))*counter; + panel->x = ((float)View::getScalingWidth() / (Global::charAmount+1))*counter; } charPanels.add(panel); @@ -95,7 +95,7 @@ namespace SmashBros if(Global::gameMode == Global::MODE_TIME_LIMIT) { - currentTime = new TextActor((float)View::ScaleWidth()/2, 40, "0:00", AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 48), Color::WHITE); + currentTime = new TextActor((float)View::getScalingWidth()/2, 40, "0:00", AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 48), Color::WHITE); currentTime->setRelativeToView(false); currentTime->setAlignment(TextActor::ALIGN_CENTER); } @@ -1109,7 +1109,7 @@ namespace SmashBros resumeButton->setAlpha(0.2f); resumeButton->setScale(1.6f); - finishButton = new Actor((float)View::ScaleWidth()/2, (float)View::ScaleHeight()/2); + finishButton = new Actor((float)View::getScalingWidth()/2, (float)View::getScalingHeight()/2); finishButton->addAnimation(new Animation("normal", 1, "Images/Game/HUD/FinishButton.png")); finishButton->changeAnimation("normal", FORWARD); finishButton->setRelativeToView(false); diff --git a/Source/SmashBros/Magnifier.cpp b/Source/SmashBros/Magnifier.cpp index 40bb57e..77b9415 100755 --- a/Source/SmashBros/Magnifier.cpp +++ b/Source/SmashBros/Magnifier.cpp @@ -37,7 +37,7 @@ namespace SmashBros { dir = PrimitiveActor::DIR_UPLEFT; } - else if((x+(w/2)) >= View::ScaleWidth()) + else if((x+(w/2)) >= View::getScalingWidth()) { dir = PrimitiveActor::DIR_UPRIGHT; } @@ -46,13 +46,13 @@ namespace SmashBros dir = PrimitiveActor::DIR_UP; } } - else if((y+(h/2)) >= View::ScaleHeight()) + else if((y+(h/2)) >= View::getScalingHeight()) { if((x-(w/2)) <= 0) { dir = PrimitiveActor::DIR_DOWNLEFT; } - else if((x+(w/2)) >= View::ScaleWidth()) + else if((x+(w/2)) >= View::getScalingWidth()) { dir = PrimitiveActor::DIR_DOWNRIGHT; } @@ -65,7 +65,7 @@ namespace SmashBros { dir = PrimitiveActor::DIR_LEFT; } - else if((x+(w/2)) >= View::ScaleWidth()) + else if((x+(w/2)) >= View::getScalingWidth()) { dir = PrimitiveActor::DIR_RIGHT; } @@ -113,7 +113,7 @@ namespace SmashBros case PrimitiveActor::DIR_UPRIGHT: { - magnifier->x = (float)View::ScaleWidth() - (float)(magnifier->width)/2; + magnifier->x = (float)View::getScalingWidth() - (float)(magnifier->width)/2; magnifier->y = (float)(magnifier->height)/2; magnifier->setRotation(45); } @@ -129,7 +129,7 @@ namespace SmashBros case PrimitiveActor::DIR_RIGHT: { - magnifier->x = View::ScaleWidth() - (float)(magnifier->width)/2; + magnifier->x = View::getScalingWidth() - (float)(magnifier->width)/2; magnifier->y = y; magnifier->setRotation(90); } @@ -138,15 +138,15 @@ namespace SmashBros case PrimitiveActor::DIR_DOWNLEFT: { magnifier->x = (float)(magnifier->width)/2; - magnifier->y = View::ScaleHeight() - (float)(magnifier->height)/2; + magnifier->y = View::getScalingHeight() - (float)(magnifier->height)/2; magnifier->setRotation(-135); } break; case PrimitiveActor::DIR_DOWNRIGHT: { - magnifier->x = View::ScaleWidth() - (float)(magnifier->width)/2; - magnifier->y = View::ScaleHeight() - (float)(magnifier->height)/2; + magnifier->x = View::getScalingWidth() - (float)(magnifier->width)/2; + magnifier->y = View::getScalingHeight() - (float)(magnifier->height)/2; magnifier->setRotation(135); } break; @@ -154,7 +154,7 @@ namespace SmashBros case PrimitiveActor::DIR_DOWN: { magnifier->x = x; - magnifier->y = View::ScaleHeight() - (float)(magnifier->height)/2; + magnifier->y = View::getScalingHeight() - (float)(magnifier->height)/2; magnifier->setRotation(180); } break; diff --git a/Source/SmashBros/Menus/CharSelectScreen.cpp b/Source/SmashBros/Menus/CharSelectScreen.cpp index 9fb09f3..1f79fdd 100755 --- a/Source/SmashBros/Menus/CharSelectScreen.cpp +++ b/Source/SmashBros/Menus/CharSelectScreen.cpp @@ -402,7 +402,7 @@ namespace SmashBros coinPoints = new Vector2i[type.size()]; charSelectArea = new WireframeActor(); //CharSelectArea->setVisible(true); - int space = View::ScaleWidth()/(total); + int space = View::getScalingWidth()/(total); for(int i=1; i<=total; i++) { Global::CPU[i-1]=false; @@ -432,7 +432,7 @@ namespace SmashBros for(int i=1; i<=num; i++) { CharCoin*a = new CharCoin(this,i); - int space = View::ScaleWidth()/(num); + int space = View::getScalingWidth()/(num); addToGrid(a,25+(space/10),500,num,1,space,0,i); coinPoints[i-1].x=(int)a->x; coinPoints[i-1].y=(int)a->y; @@ -775,8 +775,8 @@ namespace SmashBros { if(drag && Game::checkTouchActive(dragId)) { - x = (float)Game::TouchX(dragId); - y = (float)Game::TouchY(dragId); + x = (float)Game::getTouchX(dragId); + y = (float)Game::getTouchY(dragId); } else { @@ -787,8 +787,8 @@ namespace SmashBros { if(drag) { - x = (float)Game::MouseX(); - y = (float)Game::MouseY(); + x = (float)Game::getMouseX(); + y = (float)Game::getMouseY(); } } } diff --git a/Source/SmashBros/Menus/MenuClasses.cpp b/Source/SmashBros/Menus/MenuClasses.cpp index be0e051..8bfd23d 100755 --- a/Source/SmashBros/Menus/MenuClasses.cpp +++ b/Source/SmashBros/Menus/MenuClasses.cpp @@ -45,7 +45,7 @@ namespace SmashBros void TitleScreen::Initialize() { - titleScreen = new TitleScreenActor(this, (float)View::ScaleWidth()/2,(float)View::ScaleHeight()/2); + titleScreen = new TitleScreenActor(this, (float)View::getScalingWidth()/2,(float)View::getScalingHeight()/2); } void TitleScreen::LoadContent() @@ -79,7 +79,7 @@ namespace SmashBros if(changing) { g.setColor(Color::WHITE); - g.fillRect(0, 0, (float)View::ScaleWidth(), (float)View::ScaleHeight()); + g.fillRect(0, 0, (float)View::getScalingWidth(), (float)View::getScalingHeight()); } else { @@ -441,7 +441,7 @@ namespace SmashBros rules_bar_text = new TextActor(560,60,"",AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 26),Color::BLACK); rules_bar_text->setAlignment(TextActor::ALIGN_BOTTOMLEFT); - readyToFight = new ReadyToFightBar((float)View::ScaleWidth()/2, 380); + readyToFight = new ReadyToFightBar((float)View::getScalingWidth()/2, 380); readyToFight->addAnimation(new Animation("normal",1,"Images/Menus/Buttons/Generic/readytofight.png")); readyToFight->addAnimation(new Animation("hover",1,"Images/Menus/Buttons/Generic/readytofight_selected.png")); readyToFight->changeAnimation("normal", FORWARD); @@ -849,7 +849,7 @@ namespace SmashBros arrow_right->setScale(2); arrow_right->setAlpha(0.5f); - joystickArea = new WireframeActor(0,0,View::ScaleWidth()/2, View::ScaleHeight()); + joystickArea = new WireframeActor(0,0,View::getScalingWidth()/2, View::getScalingHeight()); joystickArea->relativeToView(false); joystick = new Actor(150, 450); @@ -978,8 +978,8 @@ namespace SmashBros if(joystickArea->isClicked()) { long touchId = joystickArea->getTouchId(); - int mousex = Game::TouchX(touchId); - int mousey = Game::TouchY(touchId); + int mousex = Game::getTouchX(touchId); + int mousey = Game::getTouchY(touchId); byte dir = PrimitiveActor::getDir(joystick->x, joystick->y, (float)mousex, (float)mousey); float dist = (float)PrimitiveActor::distanceUnSqr(joystick->x, joystick->y, (float)mousex, (float)mousey); if(dist<=centerDist) @@ -2068,7 +2068,7 @@ namespace SmashBros peerCard = new PeerCard("", ""); - brawl = new Actor((float)View::ScaleWidth()/2, 540); + brawl = new Actor((float)View::getScalingWidth()/2, 540); brawl->setScale(0.5f); brawl->addAnimation(new Animation("disabled", 1, "Images/Menus/Buttons/Bluetooth/Brawl_disabled.png")); brawl->addAnimation(new Animation("enabled", 1, "Images/Menus/Buttons/Bluetooth/Brawl.png")); @@ -2162,7 +2162,7 @@ namespace SmashBros { int totalPeers = 2; - float width = ((float)View::ScaleWidth())/(totalPeers+1); + float width = ((float)View::getScalingWidth())/(totalPeers+1); Menus::button_back->Draw(g, gameTime); diff --git a/Source/SmashBros/Stage.cpp b/Source/SmashBros/Stage.cpp index 4da6335..9be1696 100755 --- a/Source/SmashBros/Stage.cpp +++ b/Source/SmashBros/Stage.cpp @@ -252,8 +252,8 @@ namespace SmashBros break; case BG_FIXED: - background->drawFrame(null, g, 0, View::x, View::y, View::x + (float)View::ScaleWidth() + 1, View::y + (float)View::ScaleHeight() + 1); - //background->drawFrame(null, g, 0, View::x, View::y, (float)View::ScaleWidth(), (float)View::ScaleHeight()); + background->drawFrame(null, g, 0, View::x, View::y, View::x + (float)View::getScalingWidth() + 1, View::y + (float)View::getScalingHeight() + 1); + //background->drawFrame(null, g, 0, View::x, View::y, (float)View::getScalingWidth(), (float)View::getScalingHeight()); break; } }