Пример #1
0
void UnitSpriteGroup::DrawText(sint32 x, sint32 y, MBCHAR const * s)
{
#ifndef __MAKESPR__
	primitives_DrawText(g_screenManager->GetSurface(), x+1, y+1, s, g_colorSet->GetColorRef(COLOR_BLACK), 1);
	primitives_DrawText(g_screenManager->GetSurface(), x, y, s, g_colorSet->GetColorRef(COLOR_WHITE), 1);
#endif
}
Пример #2
0
void LineGraph::LabelAxes(void)
{
	MBCHAR		s[80];

	if (m_enableXNumber)
	{
		if (m_enablePrecision) sprintf(s, "%#.3f", m_xmin);
		else sprintf(s, "%d", (sint32)m_xmin);

		primitives_DrawText(m_surface, m_graphRect.left, m_graphRect.bottom + (m_events?20:0),
								s, g_colorSet->GetColorRef(COLOR_WHITE), TRUE);

		if (m_enablePrecision) sprintf(s, "%#.3f", m_xmax);
		else sprintf(s, "%d", (sint32)m_xmax);

        primitives_DrawText(m_surface, std::max(0L, m_graphRect.right-35L), m_graphRect.bottom + (m_events?20:0),
								s, g_colorSet->GetColorRef(COLOR_WHITE), TRUE);
	}

	if (m_enableXLabel)
	{
		sint32 len = textutils_GetWidth(m_surface, m_xAxisName);
		sint32 xpos = m_graphRect.left + (m_graphRect.right - m_graphRect.left) / 2 - len / 2;
		primitives_DrawText(m_surface, xpos, m_graphRect.bottom + 2 + (m_events?20:0), m_xAxisName,	g_colorSet->GetColorRef(COLOR_WHITE), TRUE);
	}

	if (m_enableYNumber)
	{
		if (m_enablePrecision) sprintf(s, "%#.1f", m_ymin);
		else sprintf(s, "%d", (sint32)m_ymin);

        primitives_DrawText(m_surface,
                            std::max(0L, m_graphRect.left-45L),
                            std::max(0L, m_graphRect.bottom-15L),
							s,
                            g_colorSet->GetColorRef(COLOR_WHITE),
                            TRUE
                           );

		if (m_enablePrecision) sprintf(s, "%#.1f", m_ymax);
		else sprintf(s, "%d", (sint32)m_ymax);

        primitives_DrawText(m_surface,
                            std::max(0L, m_graphRect.left-45L),
                            m_graphRect.top,
							s,
                            g_colorSet->GetColorRef(COLOR_WHITE),
                            TRUE
                           );
	}
}
Пример #3
0
void DataCheck::draw_crc(aui_Surface *surf, char str1[80], sint32 t, sint32 x, sint32 y) const
{
	MBCHAR	str2[80];

	primitives_DrawText(surf, x, y, (MBCHAR *)str1, 0, 0);

	if (IsChanged(t))
	{
		sprintf(str2, "***");
		primitives_DrawText(surf, x+100, y, (MBCHAR *)str2, 3050, 1);
	}

	sprintf (str2, "%08X %08X %08X %08X  %4.2lf", m_crc[t][CRC_ARRAY_0], m_crc[t][CRC_ARRAY_1], m_crc[t][CRC_ARRAY_2], m_crc[t][CRC_ARRAY_3], (double)(m_time[t]) / CLOCKS_PER_SEC);
	primitives_DrawText(surf, x+125, y, (MBCHAR *)str2, 0, 0);
}
Пример #4
0
void Splash::AddHilitedTextNL(MBCHAR const *text)
{
	if (g_c3ui)
	{
		aui_Surface * surface = g_c3ui->Secondary();

		if (!surface) return;

		primitives_DrawText(surface, 
		                    m_textX, m_textY, 
		                    text, 
		                    g_colorSet->GetColorRef(COLOR_YELLOW), 
		                    true
		                   );

		m_textY += k_SPLASH_TEXT_INC;
		if (m_textY >= surface->Height()) m_textY = k_SPLASH_FIRST_Y;

		if (g_theProfileDB && g_theProfileDB->IsUseDirectXBlitter())
		{
			g_c3ui->BltSecondaryToPrimary(k_AUI_BLITTER_FLAG_COPY);
	}
		else
		{
			g_c3ui->BltSecondaryToPrimary(k_AUI_BLITTER_FLAG_COPY | k_AUI_BLITTER_FLAG_FAST);
		}
	}
}
Пример #5
0
void DataCheck::draw_time(aui_Surface *surf, sint32 x, sint32 y) const
{
	MBCHAR s[80];

	sprintf(s, "Total time %4.2lf", (double)(m_total_time) / CLOCKS_PER_SEC);
	primitives_DrawText(surf, x, y, s, 0, 0);
}
Пример #6
0
void LineGraph::DrawIndicator(void)
{
	sint32 xpos;
	MBCHAR s[80];

    double xnorm = (m_indicatorValue - m_xmin) / (m_xmax - m_xmin);
	xpos = sint32(m_graphRect.left + xnorm * (m_graphRect.right-m_graphRect.left));

	primitives_DrawLine16(m_surface, xpos, m_graphRect.top + 1,
							xpos, m_graphRect.bottom - 1,
							g_colorSet->GetColor(COLOR_YELLOW));

	sprintf(s, "%#.3f", m_indicatorValue);
	sint32 len = textutils_GetWidth(m_surface, s);
	primitives_DrawText(m_surface, xpos - (len/2), m_graphRect.top+15, s, g_colorSet->GetColorRef(COLOR_YELLOW), TRUE);
}
Пример #7
0
void Splash::AddText(MBCHAR const * text)
{
	if (g_c3ui)
	{
		primitives_DrawText(g_c3ui->Secondary(), 
		                    m_textX, m_textY, 
		                    text, 
		                    g_colorSet->GetColorRef(COLOR_WHITE), 
		                    true
		                   );

		if (g_theProfileDB && g_theProfileDB->IsUseDirectXBlitter())
		{
			g_c3ui->BltSecondaryToPrimary(k_AUI_BLITTER_FLAG_COPY);
		}
		else
		{
			g_c3ui->BltSecondaryToPrimary(k_AUI_BLITTER_FLAG_COPY | k_AUI_BLITTER_FLAG_FAST);
		}
	}
}
Пример #8
0
void testloop(aui_Surface *surf)

{

	static int tcount = 0;

    if (tcount == 0) {
        g_theTestPather = new UnitAstar;
    }

	tcount++;

    if (tcount < 37) {
        return;
    }





    MapPoint start, dest, pos;
    if (!g_tiledMap->GetMouseTilePos(dest))
         return;

    if (dest.x < 0)
        return;
    if (dest.y < 0)
        return;

  sint32 i, j;
    for (i=0; i<50; i++) {
        for (j=0; j<100; j++) {
            pos.Set(i, j, 0);
            g_theWorld->SetColor(pos, 0);
        }
    }
    sint32 c = 0;
    if (0 < good_path.Num()) {
     for (good_path.Start(pos); !good_path.IsEnd(); good_path.Next(pos)) {
        g_theWorld->SetColor(pos, c);
     }
   }

    if (0 < bad_path.Num()) {
     for (bad_path.Start(pos); !bad_path.IsEnd(); bad_path.Next(pos)) {
        g_theWorld->SetColor(pos, c);
     }
    }

    PLAYER_INDEX s_player;
    ID s_item;
    SELECT_TYPE s_state;
    sint32 s_index;

   g_selected_item->GetTopCurItem(s_player, s_item,
                             s_state,  s_index);

double dis;
double total_cost;






sint32 is_broken_path;

   if (s_state == SELECT_TYPE_LOCAL_ARMY) {

g_theTestPather->FindPath(*(g_player[s_player]->GetArmy(s_index)),
                          dest, good_path, is_broken_path, bad_path,
                          total_cost);





   } else {
       return ;
   }

     char str[80];
    sprintf (str, " (%d %d)", dest.x, dest.y);
    primitives_DrawText(surf, 100, 550, (MBCHAR *)str, RGB(20,0,0), 0);

     c = pixelutils_RGB(0,30, 0);
     for (good_path.Start(pos); !good_path.IsEnd(); good_path.Next(pos)) {
         g_theWorld->SetColor(pos, c);
     }

     c = pixelutils_RGB(1,1,1);
    for (bad_path.Start(pos); !bad_path.IsEnd(); bad_path.Next(pos)) {
       g_theWorld->SetColor(pos, c);
    }

    WhackScreen();

}