コード例 #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
ファイル: VirtualMachine.cpp プロジェクト: ronsaldo/chela
    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
ファイル: volume.c プロジェクト: V07D/fbalsatray
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
ファイル: volume.c プロジェクト: V07D/fbalsatray
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
ファイル: fileio.cpp プロジェクト: paulftw/vpinball
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
ファイル: fileio.cpp プロジェクト: paulftw/vpinball
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
ファイル: fileio.cpp プロジェクト: paulftw/vpinball
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;
 }
コード例 #18
0
//---------------------------------------------------------------------------
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;
 }