예제 #1
0
void Interface::Radar::QueueEventProcessing(void)
{
    Interface::GameArea & gamearea = Interface::GameArea::Get();
    Display & display = Display::Get();
    Cursor & cursor = Cursor::Get();
    Settings & conf = Settings::Get();
    LocalEvent & le = LocalEvent::Get();

    // move border
    if(conf.ExtGameHideInterface() && conf.ShowRadar() && le.MousePressLeft(border.GetTop()))
    {
	Surface sf(border.GetRect().w, border.GetRect().h);
        Cursor::DrawCursor(sf, 0x70);
	const Point & mp = le.GetMouseCursor();
	const s16 ox = mp.x - border.GetRect().x;
	const s16 oy = mp.y - border.GetRect().y;
        SpriteCursor sp(sf, border.GetRect().x, border.GetRect().y);
	cursorArea->Hide();
	cursor.Hide();
        sp.Redraw();
	cursor.Show();
        display.Flip();
	while(le.HandleEvents() && le.MousePressLeft())
	{
	    if(le.MouseMotion())
	    {
		cursor.Hide();
		sp.Move(mp.x - ox, mp.y - oy);
		cursor.Show();
		display.Flip();
	    }
	}
	cursor.Hide();
	SetPos(mp.x - ox, mp.y - oy);
	RedrawCursor();
    	Interface::Basic::Get().SetRedraw(REDRAW_GAMEAREA);
    }
    else
    // move cursor
    if(le.MouseCursor(*this))
    {
	if(le.MouseClickLeft() || le.MousePressLeft())
	{
    	    const Point prev(gamearea.GetRectMaps());
    	    const Point & pt = le.GetMouseCursor();
	    if(*this & pt)
	    {
		gamearea.SetCenter((pt.x - x) * world.w() / w, (pt.y - y) * world.h() / h);
    		if(prev != gamearea.GetRectMaps())
    		{
		    Cursor::Get().Hide();
        	    RedrawCursor();
        	    Interface::Basic::Get().SetRedraw(REDRAW_GAMEAREA);
    		}
	    }
	}
	else
	if(!conf.ExtPocketTapMode() && le.MousePressRight(*this)) Dialog::Message(_("World Map"), _("A miniature view of the known world. Left click to move viewing area."), Font::BIG);
    }
}
예제 #2
0
void TextRenderer::MoveCursor(int new_pos)
{
    TxtDrawTrans tr(*this);    

    RedrawCursor(*this, true);
    curPos = new_pos;
    RedrawCursor(*this, true);
}
예제 #3
0
void ShowCursor::OnLeaveFocus(TextRenderer& txt_rndr)
{
    if( !CanShowCursor(txt_rndr) )
    {
        ChangeState(txt_rndr, HideCursor::Instance());
        RedrawCursor(txt_rndr);
    }
}
예제 #4
0
void HideCursor::OnGetFocus(TextRenderer& txt_rndr)
{
    if( CanShowCursor(txt_rndr) )
    {
        ChangeState(txt_rndr, PendingCursor::Instance());
        RedrawCursor(txt_rndr);
    }
}
예제 #5
0
bool BlinkCursor::OnTimeout(TextRenderer* txt_rndr)
{
    Data& dat = *(Data*)txt_rndr;
    dat.toShow = !dat.toShow;
    RedrawCursor(*txt_rndr);

    SetTimer(*txt_rndr);
    return false;
}
예제 #6
0
/* redisplaying graphics */
void Display(void)
{
    hlBeginFrame();

    hlMaterialf(HL_FRONT_AND_BACK, HL_STATIC_FRICTION, 0.1);
    hlMaterialf(HL_FRONT_AND_BACK, HL_DYNAMIC_FRICTION, 0.8);

    hlCheckEvents();

	/* clear the display */
	//glClear(GL_COLOR_BUFFER_BIT);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	
	//materialsTest();

	if (mDrawSurface)
		mSurface.DrawSurface();

    // draw the haptic surface
    hlHintb(HL_SHAPE_DYNAMIC_SURFACE_CHANGE, HL_TRUE);
    hlTouchableFace(HL_BACK);
    hlBeginShape(HL_SHAPE_FEEDBACK_BUFFER, mSurfaceShapeId);
        mSurface.DrawSurface();
    hlEndShape();
	
	glDisable(GL_LIGHTING);

	if (mDrawSystem)
		mPS.Draw();

	if (mDrawNormals)
		mSurface.DrawSurfaceNormals();

	glEnable(GL_LIGHTING);

    // draw the 3D cursor
    RedrawCursor();

	// show FPS
	if (mDrawInfo != drawInfo_None)
		DisplayInfo();

	// swap the double buffers
	glutSwapBuffers();  

    hlEndFrame();

}
예제 #7
0
void Interface::Radar::Redraw(void)
{
    const Settings & conf = Settings::Get();

    if(!hide)
    {
	RedrawArea(Players::FriendColors());
	RedrawCursor();
    }
    else
    if(!conf.ExtGameHideInterface() || conf.ShowRadar())
	AGG::GetICN((conf.ExtGameEvilInterface() ? ICN::HEROLOGE : ICN::HEROLOGO), 0).Blit(x, y);

    // redraw border
    if(conf.ExtGameHideInterface() && conf.ShowRadar())
    {
	border.Redraw();
    }
}
예제 #8
0
void BlinkCursor::OnInput(TextRenderer& txt_rndr)
{
    ChangeState(txt_rndr, PendingCursor::Instance());
    RedrawCursor(txt_rndr);
}