void Upgrade::DrawUpgrade(Core::Graphics& graphics, Vector2D mouse, float thickness) { myColor = (CheckMouse(mouse))? RGB(134, 134, 134): RGB(94,94,94); if(upgradeCooldown < .5) { upgradeCooldown += .016f; } graphics.SetColor(myColor); for(int i=0; i<BOX_SIZE; i++) { Vector2D start(position.x + i, position.y); Vector2D end(position.x + i, position.y+BOX_SIZE); graphics.DrawLine(start.x, start.y, end.x, end.y); } if(CheckMouse(mouse)) { viewText(graphics); if(Core::Input::IsPressed(Core::Input::BUTTON_LEFT)&&upgradeCooldown >= .5f && myCash.getCash() >= upgradeCost && upgradeCount < 5) { upgradeCooldown = 0; myCash.decreaseCash(upgradeCost); upgradeCount++; } } SetUpgradeCost(); DrawGraphic(graphics); graphics.SetColor(RGB(255,255,255)); if(upgradeCount > 4) { graphics.SetColor(RGB(255,0,0)); } //Draws $ DrawHorizontalBar(graphics, thickness, Letter_Size, Vector2D(costPosition.x, costPosition.y+thickness/2)); DrawVerticalBar(graphics, thickness, (Letter_Size-3*thickness)/2, Vector2D(costPosition.x, costPosition.y + thickness)); DrawHorizontalBar(graphics, thickness, Letter_Size, Vector2D(costPosition.x, costPosition.y+thickness+((Letter_Size-3*thickness)/2))); DrawVerticalBar(graphics, thickness,(Letter_Size-3*thickness)/2, Vector2D(costPosition.x+(Letter_Size-thickness), costPosition.y + thickness*2+((Letter_Size-3*thickness)/2))); DrawHorizontalBar(graphics, thickness, Letter_Size, Vector2D(costPosition.x, costPosition.y+2*thickness + (2*((Letter_Size-3*thickness)/2)-thickness/2))); DrawVerticalBar(graphics, thickness, Letter_Size, Vector2D(costPosition.x+(Letter_Size/2.5f), costPosition.y)); //Draws Cost DrawLetters(graphics, thickness); }
int CBox::Input(POINT mousePt, float fElapsedTime) { // bool timerEvent = m_Timer.Update(fElapsedTime); if (m_bIsActive) CheckMouse(mousePt); if (m_bIsActive && m_bAcceptInput) CheckKeysInputBox(); CheckKeys(); // if (timerEvent) // { // m_Timer.StartTimer(0.05f); // } return m_nCurrSelectedIndex; }
void Debugger::debugMode(void) { //-------------------------------------------------------------------- // Some assumptions: this will never be called during a smacker movie. //------------------------------------------------------------------------------- // When we enter debug mode, we grab control of all message handling from windows // until we exit ABL debug mode. This way, the ABL system is preserved for // debugging... debugModule = module; message[0] = nullptr; sprintStatement(message); print(message); #ifdef USE_IFACE debugCommand = true; while(debugCommand) { //---------------------------------------------------------- // Since MSWindows is locked out, we must Unlock the screen, // peek for MSWindows messages, then relock it. QueryPerformanceCounter((LARGE_INTEGER*)&startTime); bool result; do { MSG msg; result = PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE); if(result) { if(msg.message == WM_QUIT) { debugCommand = false; halt = false; trace = false; step = false; traceEntry = false; traceExit = false; break; } else { TranslateMessage(&msg); DispatchMessage(&msg); } } } while(result); // make sure we lock the screen for a valid ptr before we go to the user routines. if(applicationActive) { UpdateDisplay(takeScreenShot); takeScreenShot = false; QueryPerformanceCounter((LARGE_INTEGER*)&stopTime); if(MPlayer) { //WaitForSingleObject(ReceiveMutex, INFINITE); //WaitForSingleObject(FreeListMutex, INFINITE); MPlayer->processReceiveList(); //ReleaseMutex(FreeListMutex); //ReleaseMutex(ReceiveMutex); } // Insert our message loop here.... // and jump to the users idle // . // . // . // // // // finished with our user loop... CheckMouse(); } prevStart = startTime; L_INTEGER totalTime = stopTime - startTime; frameRate = (float)countsPerSecond / (float)totalTime ; } #endif }