Пример #1
0
 Boole ExtendedTimer::CheckHours(const ExtendedTimer::TimeStruct Struct)
 {
     if(GetStruct(Struct).Hours > 24)
     {
         Integer GoesInto = GetStruct(Struct).Hours / 24;
         Integer Remainder = GetStruct(Struct).Hours - GoesInto * 24;
         GetStruct(Struct).Hours = Remainder;
         GetStruct(Struct).Days+=GoesInto;
         return true;
     }else{ return false; }
 }
Пример #2
0
 Boole ExtendedTimer::CheckMinutes(const ExtendedTimer::TimeStruct Struct)
 {
     if(GetStruct(Struct).Minutes > 60)
     {
         Integer GoesInto = GetStruct(Struct).Minutes / 60;
         Integer Remainder = GetStruct(Struct).Minutes - GoesInto * 60;
         GetStruct(Struct).Minutes = Remainder;
         GetStruct(Struct).Hours+=GoesInto;
         return true;
     }else{ return false; }
 }
Пример #3
0
 Boole ExtendedTimer::CheckMilliSeconds(const ExtendedTimer::TimeStruct Struct)
 {
     if(GetStruct(Struct).Milliseconds > 1000)
     {
         Integer GoesInto = GetStruct(Struct).Milliseconds * 0.001;
         Integer Remainder = GetStruct(Struct).Milliseconds - GoesInto * 1000;
         GetStruct(Struct).Milliseconds = Remainder;
         GetStruct(Struct).Seconds+=GoesInto;
         return true;
     }else{ return false; }
 }
Пример #4
0
 ExtendedTimer& ExtendedTimer::SetMinutes(Integer Min, const ExtendedTimer::TimeStruct Struct)
 {
     GetStruct(Struct).Minutes = Min;
     CheckMinutes(Struct);
     CheckHours(Struct);
     return *this;
 }
Пример #5
0
 ExtendedTimer& ExtendedTimer::SetSeconds(Integer Sec, const ExtendedTimer::TimeStruct Struct)
 {
     GetStruct(Struct).Seconds = Sec;
     CheckSeconds(Struct);
     CheckMinutes(Struct);
     CheckHours(Struct);
     return *this;
 }
Пример #6
0
    void VirtualMachine::RegisterPrimStruct(const ChelaType *primitive, const std::string &name)
    {
        // Get the associated class.
        Structure* assoc = GetStruct(runtimeModule, name);

        // Register it.
        primitiveMap.insert(std::make_pair(primitive, assoc));
        primitiveReverseMap.insert(std::make_pair(assoc, primitive));
    }
Пример #7
0
void SetAlsaVolume(long volume) {
    const char *card = "default";
    const char *selem_name = "Master";
    // snd_mixer_selem_set_playback_volume_all(elem, volume * max / 100);
    struct alsa_control_struct c_struct = GetStruct(card,selem_name);
    snd_mixer_selem_set_playback_volume_all(c_struct.elem, volume);

    snd_mixer_close(c_struct.handle);
}
Пример #8
0
void GetAlsaVolume(long* volume) {
    const char *card = "default";
    const char *selem_name = "Master";
    // snd_mixer_selem_get_playback_volume_range(elem, &min, &max);
    struct alsa_control_struct c_struct = GetStruct(card,selem_name);
    snd_mixer_selem_get_playback_volume(c_struct.elem,0,volume);

    snd_mixer_close(c_struct.handle);
}
Пример #9
0
 ExtendedTimer& ExtendedTimer::SetMilliseconds(Integer MS, const ExtendedTimer::TimeStruct Struct)
 {
     GetStruct(Struct).Milliseconds = MS;
     CheckMilliSeconds(Struct);
     CheckSeconds(Struct);
     CheckMinutes(Struct);
     CheckHours(Struct);
     return *this;
 }
Пример #10
0
HRESULT BiffReader::GetVector3Padded(Vertex3Ds* vec)
{
    float data[4];
    HRESULT hr = GetStruct(data, 4 * sizeof(float));
    if (SUCCEEDED(hr))
    {
        vec->x = data[0];
        vec->y = data[1];
        vec->z = data[2];
    }
    return hr;
}
Пример #11
0
HRESULT BiffReader::Load()
	{
	int tag = 0;
	while (tag != FID(ENDB))
		{
		if (m_version > 30)
			{
			GetIntNoHash(&m_bytesinrecordremaining);
			}

		const HRESULT hr = GetInt(&tag);

		BOOL fContinue = fFalse;
		if (hr == S_OK)
			{
			fContinue = m_piloadable->LoadToken(tag, this);
			}

		if (!fContinue)
			{
			return E_FAIL;
			}

		if (m_version > 30)
			{
			if (m_bytesinrecordremaining > 0)
				{
				BYTE * const szT = new BYTE[m_bytesinrecordremaining];
				GetStruct(szT, m_bytesinrecordremaining);
				delete [] szT;
				}
			}
		}

	return S_OK;
	}
Пример #12
0
 ExtendedTimer& ExtendedTimer::SetMicroseconds(Integer MS, const ExtendedTimer::TimeStruct Struct)
 {
     GetStruct(Struct).Microseconds = MS;
     CheckAll(Struct);
     return *this;
 }
Пример #13
0
 Integer ExtendedTimer::GetMinutes(const ExtendedTimer::TimeStruct Struct)
 {
     return GetStruct(Struct).Minutes;
 }
Пример #14
0
 ExtendedTimer& ExtendedTimer::SetHours(Integer Hr, const ExtendedTimer::TimeStruct Struct)
 {
     GetStruct(Struct).Hours = Hr;
     CheckHours(Struct);
     return *this;
 }
Пример #15
0
HRESULT BiffReader::GetVector3(Vertex3Ds* vec)
{
    assert(sizeof(Vertex3Ds) == 3 * sizeof(float));     // fields need to be contiguous
    return GetStruct(&vec->x, 3 * sizeof(float));
}
Пример #16
0
 ExtendedTimer& ExtendedTimer::SetDays(Integer Day, const ExtendedTimer::TimeStruct Struct)
 {
     GetStruct(Struct).Days = Day;
     return *this;
 }
Пример #17
0
 Integer ExtendedTimer::GetSeconds(const ExtendedTimer::TimeStruct Struct)
 {
     return GetStruct(Struct).Seconds;
 }
//---------------------------------------------------------------------------
UEProperty::Info UEStructProperty::GetInfo() const
{
	return Info::Create(PropertyType::CustomStruct, GetElementSize(), true, "struct " + MakeUniqueCppName(GetStruct()));
}
Пример #19
0
 Integer ExtendedTimer::GetDays(const ExtendedTimer::TimeStruct Struct)
 {
     return GetStruct(Struct).Days;
 }
Пример #20
0
 Integer ExtendedTimer::GetHours(const ExtendedTimer::TimeStruct Struct)
 {
     return GetStruct(Struct).Hours;
 }