void CBarGeneratorEan8::Generate(void* data) { EAN8* p; EAN8 ean8; p=reinterpret_cast<EAN8*>(data); ean8=*p; int digit=CheckDigit(ean8); if (DigitLen(ean8)==7) { ean8*=10; ean8+=digit; } else if (DigitLen(ean8)==8) { EAN8 lastDigit; lastDigit=ean8-(EAN8)((EAN8)(ean8/10)*10); if (lastDigit!=digit) throw CBarGeneratorException("Check digit error"); } if (DigitLen(ean8)!=8) throw CBarGeneratorException("Length of EAN8 error"); std::string binary; binary=EncodeDigits(ean8); if (binary.length()!=67) throw CBarGeneratorException("Binary length error"); DrawBars(binary); DrawDigits(ean8); }
static void DrawGraph(const GraphData * gd) { unsigned int i; float lastx = 0; glPushMatrix(); glTranslatef(NUM_WIDTH + RES_WIDTH * (float) gd->numGames + TOTAL_GAP + COL_WIDTH + (INTER_GAP + MID_GAP) / 2.0f, NUM_HEIGHT / 2, 0.f); glColor3f(1.f, 1.f, 1.f); glLineWidth(.5f); glScalef(NUM_WIDTH * 10, NUM_HEIGHT * 10, 1.f); glDrawText(totalText); glPopMatrix(); DrawLeftAxis(gd); for (i = 0; i < gd->numGames; i++) { float x = NUM_WIDTH + RES_WIDTH * (float) i + COL_WIDTH + (INTER_GAP + MID_GAP) / 2.0f; DrawBars(i, gd->data[i], 0); if (x > lastx + NUM_WIDTH) { PrintBottomNumber(i + 1, NUM_WIDTH * 10, NUM_HEIGHT * 10, x, NUM_HEIGHT / 2.0f); lastx = x; } } /* Total bars */ DrawBars(i, gd->data[i], 1); /* Axis */ glColor3f(1.f, 1.f, 1.f); glBegin(GL_LINES); glVertex2f(NUM_WIDTH, NUM_HEIGHT); glVertex2f(modelWidth - 1, NUM_HEIGHT); glVertex2f(NUM_WIDTH, NUM_HEIGHT); glVertex2f(NUM_WIDTH, modelHeight * .95f); glEnd(); glBegin(GL_POINTS); glVertex2f(NUM_WIDTH, NUM_HEIGHT); glEnd(); }
void WiFiStatWin::OnPaint(wxPaintEvent& event) { int width, height; GetClientSize(&width, &height ); wxPaintDC dc(this); dc.SetBackground(backBrush); dc.Clear(); int bar_total = width / NSIGBARS; // Create the Signal Strength Indicators dc.SetBrush(backBrush); wxPen ppPen(GetGlobalColor(_T("UBLCK")), 1, wxSOLID); dc.SetPen(ppPen); if(m_bserverstat) { for(int ista = 0 ; ista < NSIGBARS ; ista++) { if(0 != m_quality[ista]) { int x = width - bar_total * (ista + 1); dc.SetBrush(backBrush); dc.DrawRectangle(x+2, 2, bar_total-4 , height-4); // Old stations get soft color bars if(m_age[ista]) { dc.SetBrush(qual_hiBrush); if(m_secure[ista]) dc.SetBrush(secureBrush); } else { dc.SetBrush(qual_hiNewBrush); if(m_secure[ista]) dc.SetBrush(secureNewBrush); } DrawBars(dc, x+2, 2, bar_total-4 , height-4, m_quality[ista], 100); } } } else { wxPen yellowPen(GetGlobalColor(_T("CHYLW")), 1, wxSOLID); dc.SetPen(yellowPen); dc.DrawLine(1, 1, width-1, 1); dc.DrawLine(width-1, 1, width-1, height-1); dc.DrawLine(width-1, height-1, 1, height-1); dc.DrawLine(1, height-1, 1, 1); } }
//ボール発射待機中の画面を描画 void Standby_Draw(Gamedata& gameData){ PictureMap& g = gameData.graphicData; DrawBlocks(gameData); if(gameData.intervalVisibleObjs["ready_logo"].Visible()){ if(DrawGraph(READY_X, READY_Y, g["ready"], TRUE) == -1){ pd("ready_logo"); } } DrawBars(gameData); DrawScore(gameData); }
void CCinemaManager::Render() { if (GetEnabled()) { DrawBars(); return; } if (!m_DrawPaths) return; // draw all paths for (const std::pair<CStrW, CCinemaPath>& p : m_CinematicSimulationData.m_Paths) p.second.Draw(); }
void PlayLoop (void) { id0_int_t give; void (*think)(struct objstruct *); // REFKEEN: C++ patch ingame = true; SD_SetTimeCount(0); playstate = (exittype)0; //playstate = TimeCount = 0; gamestate.shotpower = handheight = 0; pointcount = pointsleft = 0; DrawLevelNumber (gamestate.mapon); DrawBars (); #ifndef PROFILE fizzlein = true; // fizzle fade in the first refresh #endif /*TimeCount = */lasttimecount = lastnuke = 0; PollControls (); // center mouse StartMusic (); do { #ifndef PROFILE PollControls(); #else c.xaxis = 1; // if (++TimeCount == 300) // return; SD_SetTimeCount(SD_GetTimeCount()+1); if (SD_GetTimeCount() == 300) return; #endif for (obj = player;obj;obj = obj->next) if (obj->active) { if (obj->ticcount) { obj->ticcount-=tics; while ( obj->ticcount <= 0) { think = obj->state->thinkptr; if (think) { think (obj); if (!obj->state) { RemoveObj (obj); goto nextactor; } } obj->state = obj->state->next; if (!obj->state) { RemoveObj (obj); goto nextactor; } if (!obj->state->tictime) { obj->ticcount = 0; goto nextactor; } if (obj->state->tictime>0) obj->ticcount += obj->state->tictime; } } think = obj->state->thinkptr; if (think) { think (obj); if (!obj->state) RemoveObj (obj); } nextactor:; } if (bordertime) { bordertime -= tics; if (bordertime<=0) { bordertime = 0; VW_ColorBorder (3); } } if (pointcount) { pointcount -= tics; if (pointcount <= 0) { pointcount += POINTTICS; give = (pointsleft > 1000)? 1000 : ( (pointsleft > 100)? 100 : ((pointsleft < 20)? pointsleft : 20) ); SD_PlaySound (GETPOINTSSND); AddPoints (give); pointsleft -= give; if (!pointsleft) pointcount = 0; } } ThreeDRefresh (); CheckKeys(); // (REFKEEN) SPECIAL - Without this the game // can run very fast, even if it's not noticeable // (a lot of PlayLoop iterations and consumed CPU power) // // Notes: // 1. Should NOT be called from ThreeDRefresh/CalcTics, // because we don't always want that to be done // (e.g., FizzleFade effect right after loading C4 saved game). // 2. SHOULD be called AFTER CheckKeys. That function resets // lasttimecount (just like CalcTics) if the debug key modifier // (F10 in Cat. 3-D/Abyss, Backspace in Armageddon/Apocalypse) // is held. As a consequence, if the wait is done before the // call to CheckKeys then the game may seem to get stuck while // the debug key modifier is held. BE_ST_TimeCountWaitFromSrc(SD_GetTimeCount(), 1); // if (singlestep) { VW_WaitVBL(14); lasttimecount = SD_GetTimeCount(); } if (extravbls) VW_WaitVBL(extravbls); }while (!playstate); StopMusic (); ingame = false; if (bordertime) { bordertime = 0; VW_ColorBorder (3); } if (!abortgame) AddPoints (pointsleft); else abortgame = false; }
//------------------------------------------------------------------------------ // methods //------------------------------------------------------------------------------ void CStatsWidget::paintEvent(QPaintEvent* p) { DrawData(); DrawBars(); }