Exemple #1
0
void PrintStatus(char *text)
{
    gfxSetDrMd(m_gc, GFX_JAM_1);
    gfxSetRect(0, 320);

    gfxSetPens(m_gc, 249, 254, GFX_SAME_PEN);

    gfxPrint(m_gc, text, 10, GFX_PRINT_SHADOW | GFX_PRINT_CENTER);
}
Exemple #2
0
void plPrintInfo(char *person)
{
    char info[80];

    sprintf(info, "%s", &person[1]);

    gfxSetRect(2, 320);
    gfxSetPens(m_gc, 249, GFX_SAME_PEN, GFX_SAME_PEN);
    gfxPrint(m_gc, info, 12, GFX_PRINT_CENTER);
}
Exemple #3
0
void plDrawWait(U32 sec)
{
    char time[10];

    sprintf(time, "%.2d:%.2d", (U32) (sec / 60), (U32) (sec % 60));

    gfxSetDrMd(m_gc, GFX_JAM_2);
    gfxSetPens(m_gc, 248, GFX_SAME_PEN, GFX_SAME_PEN);
    gfxSetRect(0, 320);
    gfxPrint(m_gc, time, 31, GFX_PRINT_CENTER);
    gfxSetDrMd(m_gc, GFX_JAM_1);
}
Exemple #4
0
void plDisplayInfo(void)
{
    char info[80];

    dbGetObjectName(OL_NR(GetNthNode(PersonsList, CurrentPerson)), info);

    gfxSetPens(m_gc, 0, 0, 0);
    gfxRectFill(m_gc, 0, 0, 120, 10);

    gfxSetRect(2, 320);
    gfxSetPens(m_gc, 248, GFX_SAME_PEN, GFX_SAME_PEN);
    gfxPrint(m_gc, info, 2, GFX_PRINT_LEFT | GFX_PRINT_SHADOW);
}
Exemple #5
0
void plDisplayTimer(U32 time, ubyte doSpotsImmediatly)
{
    char info[80];
    U32 oldTimer = -1;

    if (!time)
	time = CurrentTimer(plSys) / PLANING_CORRECT_TIME;

    if (GamePlayMode & GP_GUARD_DESIGN) {
	sprintf(info, "x:%d, y:%d   %s %.2d:%.2d:%.2d %s",
		livGetXPos(Planing_Name[CurrentPerson]),
		livGetYPos(Planing_Name[CurrentPerson]), txtTimer,
		(U32) (time / 3600), (U32) ((time / 60) % 60),
		(U32) (time % 60), txtSeconds);

	gfxSetPens(m_gc, 0, 0, 0);
	gfxRectFill(m_gc, 120, 0, 320, 10);

	gfxSetRect(2, 320);
	gfxSetPens(m_gc, 248, GFX_SAME_PEN, GFX_SAME_PEN);
	gfxPrint(m_gc, info, 2, GFX_PRINT_RIGHT);
    } else {
	sprintf(info, "%s %.2d:%.2d:%.2d %s", txtTimer, (U32) (time / 3600),
		(U32) ((time / 60) % 60), (U32) (time % 60), txtSeconds);

	gfxSetPens(m_gc, 0, 0, 0);
	gfxRectFill(m_gc, 220, 0, 320, 10);

	gfxSetRect(2, 320);
	gfxSetPens(m_gc, 248, GFX_SAME_PEN, GFX_SAME_PEN);
	gfxPrint(m_gc, info, 2, GFX_PRINT_RIGHT);
    }

    if (doSpotsImmediatly || (oldTimer != CurrentTimer(plSys))) {
	oldTimer = CurrentTimer(plSys);
	lsMoveAllSpots(time);
    }
}
Exemple #6
0
void gfxRenderer::DrawButton( int state, int style, float x, float y, float width, float height, const char* title )
{
	if(state & igItemStates::PRESSED)
	{
		gfxDrawRectangle(x, y, width, height, GFX_STYLE_ELEM_PRESSED);
	} else if(state & igItemStates::HOVER)
	{
		gfxDrawRectangle(x, y, width, height, GFX_STYLE_ELEM_HOVER);
	} else
	{
		gfxDrawRectangle(x, y, width, height, GFX_STYLE_NONE);
	}

	gfxPrint(x+width/2.0f, y+height/2.0f, title, GFX_STYLE_NONE); 
}
Exemple #7
0
void gfxRenderer::DrawMove( int state, int style, float& x, float& y, float prevX, float prevY, float width, float height, const char* title )
{
	// draw button
	if(state & igItemStates::PRESSED)
	{
		gfxDrawRectangle(prevX, prevY, width, height, GFX_STYLE_ELEM_PRESSED);
	} else if(state & igItemStates::HOVER)
	{
		gfxDrawRectangle(prevX, prevY, width, height, GFX_STYLE_ELEM_HOVER);
	} else
	{
		gfxDrawRectangle(prevX, prevY, width, height, GFX_STYLE_NONE);
	}

	gfxPrint(prevX + width/2.0f, prevY + height/2.0f, title, GFX_STYLE_NONE);
}
Exemple #8
0
void gfxRenderer::DrawTextBox( int state, int style, float x, float y, float width, float height, const std::string& value, int textCharPos )
{
	// draw text box
	if(state & igItemStates::PRESSED)
	{
		gfxDrawRectangle(x, y, width, height, GFX_STYLE_ELEM_PRESSED);
	} else if(state & igItemStates::HOVER)
	{
		gfxDrawRectangle(x, y, width, height, GFX_STYLE_ELEM_HOVER);
	} else
	{
		gfxDrawRectangle(x, y, width, height, GFX_STYLE_NONE);
	}

	gfxPrint(x + width/2.0f, y + height/2.0f, value.c_str(), GFX_STYLE_NONE, state & igItemStates::TEXT_FOCUS ? textCharPos : -1); 
}
Exemple #9
0
void igRenderer::DrawTextBox( int state, int style, float x, float y, float width, float height, const std::string& value, int textCharPos, int textCharPos2)
{
	// draw text box
	if(state & igItemStates::PRESSED)
	{
		gfxDrawRectangle(x, y, width, height, GFX_STYLE_ELEM_PRESSED);
	} else if(state & igItemStates::HOVER)
	{
		gfxDrawRectangle(x, y, width, height, GFX_STYLE_ELEM_HOVER);
	} else
	{
		gfxDrawRectangle(x, y, width, height, GFX_STYLE_TEXTBOX_BG);
	}

	int pipePos = state & igItemStates::TEXT_FOCUS ? textCharPos : -1;
	int pipe2Pos = state & igItemStates::TEXT_FOCUS ? textCharPos2 : -1;
	if(time % 500 >= 250 && textCharPos == textCharPos2)
		pipePos = -1;

	if(pipePos > pipe2Pos)
		std::swap(pipePos, pipe2Pos);

	gfxPrint(x + width/2.0f, y + height/2.0f, value.c_str(), GFX_STYLE_NONE, pipePos, pipe2Pos); 
}