示例#1
0
bool bullet::RenderFunc(float dt)
{
    if (!GetEnable())
    {
        return false;
	}
	/*
	hgeTriple t;
	t.v[0].x = m_v1_onscr.x;
	t.v[0].y = m_v1_onscr.y;

	t.v[1].x = m_v1_onscr.x + 1.0f;
	t.v[1].y = m_v1_onscr.y;

	t.v[2].x = m_v1_onscr.x;
	t.v[2].y = m_v1_onscr.y + 1.0f;


	m_hge->Gfx_RenderTriple(&t);
       */


    //hgeFont *fnt = GETFONT(SYS_FONT_TYPE);

    //fnt->printf(float x,float y,int align,const char * format,...)
    DWORD color = 0xffffffff;
    DWORD color1 = 0xffff0000;
    DWORD color2 = 0xffff0000;
    DWORD color3 = 0xff800000;
    
    m_hge->Gfx_RenderLine(m_v1_onscr.x,m_v1_onscr.y,
                          m_v1_onscr.x+0.5f,m_v1_onscr.y,
                          color,
                          1.0f);
    m_hge->Gfx_RenderLine(m_v1_onscr1.x,m_v1_onscr1.y,
                          m_v1_onscr1.x+0.5f,m_v1_onscr1.y,
                          color1,
                          0.5f);
    m_hge->Gfx_RenderLine(m_v1_onscr2.x,m_v1_onscr2.y,
                          m_v1_onscr2.x+0.5f,m_v1_onscr2.y,
                          color2,
                          0.5f);
    m_hge->Gfx_RenderLine(m_v1_onscr3.x,m_v1_onscr3.y,
                          m_v1_onscr3.x+0.5f,m_v1_onscr3.y,
                          color3,
                          0.5f);



    return false;
}
示例#2
0
void MkWindowBaseNode::SetEnable(bool enable)
{
	if (IsQuadForm())
	{
		bool oldEnable = GetEnable();
		if (oldEnable && (!enable)) // turn off
		{
			SetFormState(MkWindowThemeFormData::eS_Disable);
		}
		else if ((!oldEnable) && enable) // turn on
		{
			SetFormState(MkWindowThemeFormData::eS_Normal);
		}
	}

	m_Attribute.Assign(ePA_SNA_Enable, enable);
}
示例#3
0
DatabaseQuery* Draw::GetDataToFetch() {
	const DTime& start_time = m_index.GetStartTime();
	assert(start_time.IsValid());

	PeriodType period = start_time.GetPeriod();

	int d = m_values.m_view.Start();

	DatabaseQuery* q = NULL;

	if (m_draw_info == NULL)
		return q;

	if (GetEnable() == false)
		return q;

	bool no_max_probes = !m_draw_info->IsValid() || m_draw_info->GetParam()->GetIPKParam()->GetFormulaType() == TParam::LUA_AV;
	for (size_t i = 0; i < m_values.len(); ++i) {
		ValueInfo &v = m_values.Get(i);

		if (v.state != ValueInfo::EMPTY) 
			continue;
		
		DTime pt = GetDTimeOfIndex(i - d);
		if (period == PERIOD_T_DAY)
			v.max_probes = 1;
		else if (no_max_probes)
			v.max_probes = 0;
		else {
			DTime ptn = pt + m_index.GetDateRes() + m_index.GetTimeRes();
			v.max_probes = (ptn.GetTime() - pt.GetTime()).GetMinutes() / 10;
		}

		v.state = ValueInfo::PENDING;
		
		if (q == NULL)
			q = CreateDataQuery(m_draw_info, period, m_draw_no);
		AddTimeToDataQuery(q, pt.GetTime().GetTicks());
	}

	return q;
}
示例#4
0
bool bullet::FrameFunc(float dt)
{
    if (!GetEnable())
    {
        return false;
	}
    m_time +=dt;
	
    FLOAT arc = m_r*M_PI/180.0f;
	x = m_time*m_power*cosf(arc) + m_v1.x;
	y = m_time*m_power*sinf(arc) - m_time*m_time*4.9f + m_v1.y; //4.9=9.8/2
    FPOINT v1;
	v1.Set(x,y);

    // ДІРэВагА
    if (m_time/0.5f == 0.0f)
    m_v1_onscr3 = m_v1_onscr2;
    m_v1_onscr2 = m_v1_onscr1;
    m_v1_onscr1 = m_v1_onscr;

	m_tank2->WorldToScreen(v1,m_v1_onscr);

	if (m_v1_onscr.x <0 || m_v1_onscr.x > m_tank2->m_state.m_ScreenW ||
		m_v1_onscr.y <0 || m_v1_onscr.y > m_tank2->m_state.m_ScreenH)
	{
	    // out of screen
        SetEnable(false);
	}

    if (ContactCheck())
    {
	    // Contact
        SetEnable(false);

    }

	
    return false;
}