void RWindows::Update(const TRegion& aRgn,const TSize& aSize) { if(aRgn.CheckError()) UpdateRect(TRect(aSize),aSize); else for(TInt count=0;count<aRgn.Count();count++) UpdateRect(aRgn[count],aSize); }
//***************************************************************************** void CHTMLWidget::Paint( //Paint text inside of the widget area. // //Params: bool bUpdateRect) //(in) If true (default) and destination // surface is the screen, the screen // will be immediately updated in // the widget's rect. { if (this->pHTMLSurface) { //Prepare for blitting the surface during idle animation. //Wait until entire page is painted before repainting it. if (this->wHeightDrawn >= (UINT)this->pHTMLSurface->h) { bNeedRepaint = false; this->wHeightDrawn = 0; GetScrollOffset(this->nOffsetX, this->nOffsetY); } else bNeedRepaint = true; } else { PaintChildren(); //No surface; slow render mode. if (bUpdateRect) UpdateRect(); } }
CPicketMan::CPicketMan(int objID, int typeID, double posX, double posY, int width, int height, double posXCollide, double posYCollide, int widthCollide, int heightCollide, bool _isTurnHor) { m_Id = objID; m_Type = PICKETMAN; m_Sprite = new CSprite(CResourceManager::GetInstance()->GetSprite(IMAGE_ENEMIES), D3DXVECTOR2(450, 71), 3, 1, D3DXVECTOR2(335, 46), D3DXVECTOR2(0, 0), D3DXVECTOR2(10, 0)); m_Size = D3DXVECTOR2(m_Sprite->GetWidthRectSprite(), m_Sprite->GetHeightRectSprite()); m_pos = D3DXVECTOR3(posX - m_Size.x/2, posY + m_Size.y/2, DEPTH_MOTION); m_posOrg = m_pos; UpdateRect(); /**Attribute Octopus**/ m_TimeSpend = 0; m_IsLife = true; m_vellocTemp = D3DXVECTOR2(0,0); m_rangeItem = 3; m_isTurnLeft = true; }
void ListBox::OnResize() { UpdateRect(); for (UIElement* child : mChildren) child->OnResize(); }
//***************************************************************************** bool CCreditsScreen::OnQuit() //Called when SDL_QUIT event is received. //Returns whether Quit action was confirmed. { //Pause action while the "Really quit?" dialog is activated. const bool bWasPaused = this->bPaused; if (!bWasPaused) { this->bPaused = true; SetRate(0); } const bool bQuit = CScreen::OnQuit(); //no sell screen if (!bWasPaused) { this->bPaused = false; SetRate(this->fScrollRateMultiplier); } else { //redraw screen parts PaintChildren(); UpdateRect(); } return bQuit; }
void CRectSelectTracker::Init(const GEOMETRY::geom::Coordinate& startPt) { m_startPt = m_EndPt = startPt; UpdateRect(GEOMETRY::geom::Envelope(m_startPt, m_EndPt)); }
void CUWindow::DestroyFrame (CUFrame *pFrame) // DestroyFrame // // Destroys the frame { RECT rcRect; // Make sure we're not holding on to this pointer if (pFrame == m_pMouseCapture) ReleaseCapture(); if (pFrame == m_pInputFocus) m_pInputFocus = NULL; // Remember the old rect pFrame->GetRect(&rcRect); // Destroy m_pFrame->DestroyFrame(pFrame); // Repaint UpdateRect(&rcRect); }
void I_BeginRead(void) { byte *screenloc = I_VideoBuffer + (SCREENHEIGHT - LOADING_DISK_H) * SCREENWIDTH + (SCREENWIDTH - LOADING_DISK_W); int y; if (!initialized || disk_image == NULL) return; // save background and copy the disk image in for (y=0; y<LOADING_DISK_H; ++y) { memcpy(saved_background + y * LOADING_DISK_W, screenloc, LOADING_DISK_W); memcpy(screenloc, disk_image + y * LOADING_DISK_W, LOADING_DISK_W); screenloc += SCREENWIDTH; } UpdateRect(SCREENWIDTH - LOADING_DISK_W, SCREENHEIGHT - LOADING_DISK_H, SCREENWIDTH, SCREENHEIGHT); }
void tcOOBView::OnScrollbarUpdated(wxCommandEvent& event) { yOffset = 0.25 * float(event.GetExtraLong()); float yStart = mfYOffset - yOffset; UpdateRect(yStart); PlaceIcons(); }
void tcOOBView::Update() { UpdateData(); UpdateTrackData(); UpdateFormation(); UpdateRect(mfYOffset - yOffset); PlaceIcons(); }
static int win32_gui_data_exchange( vo_driver_t * vo_driver, int data_type, void * data ) { win32_driver_t *win32_driver = ( win32_driver_t * ) vo_driver; switch( data_type ) { case GUI_WIN32_MOVED_OR_RESIZED: UpdateRect( win32_driver->win32_visual ); DisplayFrame( win32_driver ); break; case XINE_GUI_SEND_DRAWABLE_CHANGED: { HRESULT result; HWND newWndHnd = (HWND) data; /* set cooperative level */ result = IDirectDraw_SetCooperativeLevel( win32_driver->ddobj, newWndHnd, DDSCL_NORMAL ); if( result != DD_OK ) { Error( 0, "SetCooperativeLevel : error 0x%lx", result ); return 0; } /* associate our clipper with new window */ result = IDirectDrawClipper_SetHWnd( win32_driver->ddclipper, 0, newWndHnd ); if( result != DD_OK ) { Error( 0, "ddclipper->SetHWnd : error 0x%lx", result ); return 0; } /* store our objects in our visual struct */ win32_driver->win32_visual->WndHnd = newWndHnd; /* update video area and redraw current frame */ UpdateRect( win32_driver->win32_visual ); DisplayFrame( win32_driver ); break; } } return 0; }
FloatRect Text::GetRect() const { UpdateRect(); FloatRect rect; rect.Left = (myBaseRect.Left - GetOrigin().x) * GetScale().x + GetPosition().x; rect.Top = (myBaseRect.Top - GetOrigin().y) * GetScale().y + GetPosition().y; rect.Width = myBaseRect.Width * GetScale().x; rect.Height = myBaseRect.Height * GetScale().y; return rect; }
CBeak::CBeak(int objID, int typeID, double posX, double posY, int width, int height, double posXCollide, double posYCollide, int widthCollide, int heightCollide, bool _isLeft) { m_Id = objID; m_Type = BEAK; m_Status = BeakWait; m_IsLife = true; m_TimeSpent = m_TimeShot = 0; m_CurrentBullet = 0; m_isTurnLeft = _isLeft; m_Sprite = new CSprite(CResourceManager::GetInstance()->GetSprite(IMAGE_ENEMIES), D3DXVECTOR2(180, 267) , 4, 1, D3DXVECTOR2(20, 250), D3DXVECTOR2(0, 0), D3DXVECTOR2(30,0)); m_Size = D3DXVECTOR2(m_Sprite->GetWidthRectSprite(), m_Sprite->GetHeightRectSprite()); m_pos = D3DXVECTOR3(posX - m_Size.x/2, posY + m_Size.y/2, DEPTH_MOTION); m_posOrg = m_pos; m_rangeItem = 3; UpdateRect(); #pragma region create list bullet int vx = -V_BULLET; int vy = 0; int dir = _isLeft ? 1 : -1; for (int i = 0; i < NUM_BULLET; i++) { CBullet *bullet = new CBullet(D3DXVECTOR3(m_pos.x + m_Size.x/2 - dir * m_Size.x/2, m_pos.y - m_Size.y/2, m_pos.z)); switch (i) { case 0: vx = -V_BULLET * dir; vy = V_BULLET * dir; break; case 1: vx = -V_BULLET * 1.7 * dir; vy = V_BULLET*0.3 * dir; break; case 2: vx = -V_BULLET*1.7 *dir; vy = -V_BULLET*0.3 *dir; break; case 3: vx = -V_BULLET *dir; vy = -V_BULLET *dir; break; default: break; } bullet->SetVelloc(D3DXVECTOR2(vx, vy)); m_ListBullet[i] = bullet; } #pragma endregion }
//---------------------------------------------------------------------------// // OnResize // //---------------------------------------------------------------------------// void CMGControl::OnResize() { UpdateSize(); UpdateRect(); // Resize sons CListaIter<CMGControl *> Iter(m_Sons); while (!Iter.EsFinal()) { CMGControl *pItem = Iter; pItem->OnResize(); Iter++; } }
//***************************************************************************** void CHTMLWidget::HandleAnimate() //Draw as much of page surface as can be done this frame without slowing animation. { ASSERT(IsVisible()); if (!this->pHTMLSurface) return; if (this->wHeightDrawn >= (UINT)this->pHTMLSurface->h) return; //all done SDL_Surface *pDestSurface = GetDestSurface(); //Blit horizontal strips of HTML surface to screen until animation duration is up. static const UINT dwMaxTime = 30; //30ms const UINT dwStopTime = SDL_GetTicks() + dwMaxTime; ASSERT(this->pParent); SDL_Rect clipRect; this->pParent->GetChildClippingRect(clipRect); SDL_SetClipRect(pDestSurface, &clipRect); do { static const UINT wStripHeight = 64; SDL_Rect src = {-this->nOffsetX, -this->nOffsetY + this->wHeightDrawn, this->pHTMLSurface->w, wStripHeight}; SDL_Rect dest = {this->x, this->y + this->wHeightDrawn, this->pHTMLSurface->w, wStripHeight}; //Bounds check on last row. if (this->wHeightDrawn + wStripHeight > (UINT)this->pHTMLSurface->h) src.h = dest.h = this->pHTMLSurface->h - this->wHeightDrawn; if (dest.y + dest.h >= clipRect.y + clipRect.h) { //Now rendering past the visible rect -- stop drawing the page after this, //or repaint if dirty flag is set. src.h = dest.h = (clipRect.y + clipRect.h) - dest.y; if (bNeedRepaint) { bNeedRepaint = false; this->wHeightDrawn = -dest.h; GetScrollOffset(this->nOffsetX, this->nOffsetY); } else this->wHeightDrawn = this->pHTMLSurface->h; } SDL_BlitSurface(this->pHTMLSurface, &src, pDestSurface, &dest); UpdateRect(dest); this->wHeightDrawn += dest.h; if (this->wHeightDrawn >= (UINT)this->pHTMLSurface->h) break; //all done if (this->wHeightDrawn >= this->h) break; //drawn entire visible area } while (SDL_GetTicks() < dwStopTime); SDL_SetClipRect(pDestSurface, NULL); }
CGroupBox *CGroupBox::setBorderOuterWidth(const size_t value) { if (value != m_iBorderOuterWidth) { m_iBorderOuterWidth = value; if (m_pForm) m_pForm->LockRepaint(); UpdateRect(); Repaint(true); if (m_pForm) m_pForm->UnlockRepaint(); } return this; }
static int win32_gui_data_exchange( vo_driver_t * vo_driver, int data_type, void * data ) { win32_driver_t * win32_driver = ( win32_driver_t * ) vo_driver; switch( data_type ) { case GUI_WIN32_MOVED_OR_RESIZED: UpdateRect( win32_driver->win32_visual ); DisplayFrame( win32_driver ); break; } return 0; }
CGroupBox *CGroupBox::setCaption(const String &value) { if (value != m_sCaption) { m_sCaption = value; if (m_pForm) m_pForm->LockRepaint(); UpdateRect(); Repaint(true); if (m_pForm) m_pForm->UnlockRepaint(); } return this; }
CGroupBox *CGroupBox::setPadding(const math::RECTANGLE<size_t> &value) { if (value != m_sPadding) { m_sPadding = value; if (m_pForm) m_pForm->LockRepaint(); UpdateRect(); Repaint(true); if (m_pForm) m_pForm->UnlockRepaint(); } return this; }
CFlea::CFlea(int objID, int typeID, double posX, double posY, int width, int height, double posXCollide, double posYCollide, int widthCollide, int heightCollide) { m_Id = objID; m_Type = FLEA; m_Sprite = new CSprite(CResourceManager::GetInstance()->GetSprite(IMAGE_ENEMIES), D3DXVECTOR2(335, 190) , 2, 1, D3DXVECTOR2(255, 170), D3DXVECTOR2(0,0), D3DXVECTOR2(20,0)); m_pos = D3DXVECTOR3(posX - m_Size.x/2, posY + m_Size.y/2, DEPTH_MOTION); m_velloc.x = -10; m_accel.y = -5.0f; m_posOrg = m_pos; m_Size = D3DXVECTOR2(m_Sprite->GetWidthRectSprite(), m_Sprite->GetHeightRectSprite()); UpdateRect(); }
//***************************************************************************** void CCreditsScreen::Paint( //Overridable method to paint the screen. // //Params: bool bUpdateRect) //(in) If true (default) and destination // surface is the screen, the screen // will be immediately updated in // the widget's rect. { //Blit the background graphic. SDL_BlitSurface(this->images[0], NULL, GetDestSurface(), NULL); PaintChildren(); if (bUpdateRect) UpdateRect(); }
CBeak::CBeak(int _id, D3DXVECTOR3 _pos, bool _isLeft) { m_Id = _id; m_Type = BEAK; m_Sprite = new CSprite(CResourceManager::GetInstance()->GetSprite(IMAGE_ENEMIES), D3DXVECTOR2(360, 455) , 4, 1, D3DXVECTOR2(40,420), D3DXVECTOR2(0, 0), D3DXVECTOR2(50,0)); m_pos = _pos; m_accel = D3DXVECTOR2(0,0); m_isTurnLeft = _isLeft; m_Status = BeakWait; m_IsLife = true; m_TimeSpent = m_TimeShot = 0; m_CurrentBullet = 0; m_Size = D3DXVECTOR2(m_Sprite->GetWidthRectSprite(), m_Sprite->GetHeightRectSprite()); UpdateRect(); #pragma region create list bullet int vx = -V_BULLET; int vy = 0; int dir = _isLeft ? 1 : -1; for (int i = 0; i < NUM_BULLET; i++) { CBullet *bullet = new CBullet(D3DXVECTOR3(_pos.x + m_Size.x/2 - 10, _pos.y - m_Size.y/2 + 10, _pos.z)); switch (i % (NUM_BULLET/2)) { case 0: vx = -V_BULLET * dir; vy = V_BULLET * dir; break; case 1: vx = -V_BULLET * dir; vy = 0; break; case 2: vx = -V_BULLET *dir; vy = -V_BULLET *dir; break; default: break; } bullet->SetVelloc(D3DXVECTOR2(vx, vy)); m_ListBullet[i] = bullet; } #pragma endregion }
CGroupBox *CGroupBox::setBorderRadius(const size_t value) { if (value != m_iBorderRadius) { m_iBorderRadius = value; if (m_iBorderInnerWidth > 0 || m_iBorderOuterWidth > 0) { if (m_pForm) m_pForm->LockRepaint(); UpdateRect(); Repaint(true); if (m_pForm) m_pForm->UnlockRepaint(); } } return this; }
void DisplayList::Update() { CalcUpdate(); // Use multiple dirty rectangles to minimize area if ( nDirty > 0 && bits ) { // Update the frame buffer DecomposeDirtyList(); for ( int i = 0; i < nDirty; i++ ) { SRECT bitsDirtyRgn; CalcBitsDirty(devDirtyRect+i, &bitsDirtyRgn); RectUnion(&bitsDirtyRgn, &screenDirtyRgn, &screenDirtyRgn); UpdateRect(&bitsDirtyRgn); } } RectSetEmpty(&devDirtyRgn); nDirty = 0; }
Button::Button(sf::RenderWindow& window, int state, int x, int y, int size, sf::Font font, std::string content) : GuiItem(window, state, x - MARGIN / 2, y - MARGIN / 2) { _font = font; _text.SetText(content); _text.SetFont(_font); _text.SetSize(size); _text.SetPosition(x, y); _text.SetColor(sf::Color(0, 0, 0)); _sizex = _text.GetRect().GetWidth() + MARGIN * 2; _sizey = _text.GetRect().GetHeight() + MARGIN * 2; UpdateRect(); _listeners.push_back(new ButtonMouseOverListener(MOUSEOVER, this)); _listeners.push_back(new ButtonMouseOutListener(MOUSEOUT, this)); }
//********************************************************************************************************* void CProgressBarWidget::Paint( //Paint widget area. // //Params: bool bUpdateRect) //(in) If true (default) and destination // surface is the screen, the screen // will be immediately updated in // the widget's rect. { //Draw inset covering entire widget area. SDL_Rect rectInset; GetRect(rectInset); DrawInset(rectInset.x, rectInset.y, rectInset.w, rectInset.h, this->images[0], GetDestSurface()); DrawBar(); this->fLastDrawnValue = this->fValue; if (bUpdateRect) UpdateRect(); }
void LandscapeToolsPanel::WillAppear() { if(selectionPanel) { selectedBrushTool = selectionPanel->Tool(); selectedTool = selectedBrushTool; if(selectedBrushTool) { brushIcon->SetSprite(selectedBrushTool->sprite, 0); } else { brushIcon->SetSprite(NULL, 0); } ToolIconSelected(brushIcon); } UpdateRect(); }
///////////////////////////////////////////////////////////////////////////// // class AgentDisplay public virtual functions bool AgentDisplay::Initiate() { FCB * pFCB = (FCB *)m_pFCB; switch (MESA_TO_C_UNSPECIFIED(pFCB->m_nCommand)) { case kNop: pFCB->m_nStatus = C_TO_MESA_UNSPECIFIED(kSuccess); break; case kSetCLTEntry: SetCLTEntry(); break; case kGetCLTEntry: GetCLTEntry(); break; case kSetInverseVideo: SetInverseVideo(); break; case kSetCursorPattern: SetCursorPattern(); break; case kUpdateRect: UpdateRect(); break; case kMoveRect: MoveRect(); break; case kPatternFillRect: PatternFillRect(); break; default: pFCB->m_nStatus = C_TO_MESA_UNSPECIFIED(kFailure); break; } return true; }
boolean CreatePrimary( win32_driver_t * win32_driver ) { LPDIRECTDRAW ddobj; DDSURFACEDESC2 ddsd; HRESULT result; // create direct draw object result = DirectDrawCreate( 0, &ddobj, 0 ); if( result != DD_OK ) { Error( 0, "DirectDrawCreate : error %i", result ); printf( "vo_out_directx : DirectDrawCreate : error %i\n", result ); return 0; } // set cooperative level result = IDirectDraw_SetCooperativeLevel( ddobj, win32_driver->win32_visual->WndHnd, DDSCL_NORMAL ); if( result != DD_OK ) { Error( 0, "SetCooperativeLevel : error %i", result ); return 0; } // try to get new interface result = IDirectDraw_QueryInterface( ddobj, &IID_IDirectDraw7, (LPVOID *) &win32_driver->ddobj ); if( result != DD_OK ) { Error( 0, "ddobj->QueryInterface : DirectX 7 or higher required" ); return 0; } // release our old interface IDirectDraw_Release( ddobj ); // create primary_surface memset( &ddsd, 0, sizeof( ddsd ) ); ddsd.dwSize = sizeof( ddsd ); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; result = IDirectDraw7_CreateSurface( win32_driver->ddobj, &ddsd, &win32_driver->primary, 0 ); if( result != DD_OK ) { Error( 0, "CreateSurface ( primary ) : error %i ", result ); return 0; } // create our clipper object result = IDirectDraw7_CreateClipper( win32_driver->ddobj, 0, &win32_driver->ddclipper, 0 ); if( result != DD_OK ) { Error( 0, "CreateClipper : error %i", result ); return 0; } // associate our clipper with our window result = IDirectDrawClipper_SetHWnd( win32_driver->ddclipper, 0, win32_driver->win32_visual->WndHnd ); if( result != DD_OK ) { Error( 0, "ddclipper->SetHWnd : error %i", result ); return 0; } // associate our primary surface with our clipper result = IDirectDrawSurface7_SetClipper( win32_driver->primary, win32_driver->ddclipper ); if( result != DD_OK ) { Error( 0, "ddclipper->SetHWnd : error %i", result ); return 0; } // store our objects in our visual struct UpdateRect( win32_driver->win32_visual ); return 1; }
static boolean CreatePrimary( win32_driver_t * win32_driver ) { LPDIRECTDRAW ddobj; DDSURFACEDESC ddsd; HRESULT result; /* create direct draw object */ result = DirectDrawCreate( 0, &ddobj, 0 ); if( result != DD_OK ) { Error( 0, "DirectDrawCreate : error %ld", result ); xprintf(win32_driver->xine, XINE_VERBOSITY_DEBUG, "vo_out_directx : DirectDrawCreate : error %ld\n", result ); return 0; } /* set cooperative level */ result = IDirectDraw_SetCooperativeLevel( ddobj, win32_driver->win32_visual->WndHnd, DDSCL_NORMAL ); if( result != DD_OK ) { Error( 0, "SetCooperativeLevel : error 0x%lx", result ); return 0; } /* try to get new interface */ result = IDirectDraw_QueryInterface( ddobj, &IID_IDirectDraw, (LPVOID *) &win32_driver->ddobj ); if( result != DD_OK ) { Error( 0, "ddobj->QueryInterface : DirectX required" ); return 0; } /* release our old interface */ IDirectDraw_Release( ddobj ); /* create primary_surface */ memset( &ddsd, 0, sizeof( ddsd ) ); ddsd.dwSize = sizeof( ddsd ); ddsd.dwFlags = DDSD_CAPS; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; result = IDirectDraw_CreateSurface( win32_driver->ddobj, &ddsd, &win32_driver->primary, 0 ); if( result != DD_OK ) { Error( 0, "CreateSurface ( primary ) : error 0x%lx", result ); return 0; } /* create our clipper object */ result = IDirectDraw_CreateClipper( win32_driver->ddobj, 0, &win32_driver->ddclipper, 0 ); if( result != DD_OK ) { Error( 0, "CreateClipper : error 0x%lx", result ); return 0; } /* associate our clipper with our window */ result = IDirectDrawClipper_SetHWnd( win32_driver->ddclipper, 0, win32_driver->win32_visual->WndHnd ); if( result != DD_OK ) { Error( 0, "ddclipper->SetHWnd : error 0x%lx", result ); return 0; } /* associate our primary surface with our clipper */ result = IDirectDrawSurface_SetClipper( win32_driver->primary, win32_driver->ddclipper ); if( result != DD_OK ) { Error( 0, "ddclipper->SetHWnd : error 0x%lx", result ); return 0; } /* store our objects in our visual struct */ UpdateRect( win32_driver->win32_visual ); return 1; }