Example #1
0
	~FlagBaseSFXStateMachine( )
	{
		Term( );
	}
Example #2
0
/*
--------------------------------------------------------------------------------
Terminate EXTVIN driver
(Standard instances management. Driver specific implementations should be put in Term() function.)
--------------------------------------------------------------------------------
*/
ST_ErrorCode_t STEXTVIN_Term(const ST_DeviceName_t DeviceName, const STEXTVIN_TermParams_t *const TermParams_p)
{
    stextvin_Unit_t *Unit_p;
    S32 DeviceIndex = INVALID_DEVICE_INDEX, UnitIndex;
    BOOL Found = FALSE;
    ST_ErrorCode_t ErrorCode = ST_NO_ERROR;

    /* Exit now if parameters are bad */
    if ((TermParams_p == NULL) ||                       /* There must be parameters ! */
        (strlen(DeviceName) > (ST_MAX_DEVICE_NAME - 1)) || /* Device name length should be respected */
        ((((const char *) DeviceName)[0]) == '\0')            /* Device name should not be empty */
       )
    {
        return(ST_ERROR_BAD_PARAMETER);
    }

    EnterCriticalSection();

    if (!FirstInitDone)
    {
        ErrorCode = ST_ERROR_UNKNOWN_DEVICE;
    }
    else
    {
        /* Check if device already initialised and return error if NOT so */
        DeviceIndex = GetIndexOfDeviceNamed(DeviceName);
        if (DeviceIndex == INVALID_DEVICE_INDEX)
        {
            /* Device name not found */
            ErrorCode = ST_ERROR_UNKNOWN_DEVICE;
        }
        else
        {
            /* Check if there is still 'open' on this device */
/*            Found = FALSE;*/
            UnitIndex = 0;
            Unit_p = STEXTVIN_UnitArray;
            while ((UnitIndex < STEXTVIN_MAX_UNIT) && (!Found))
            {
                Found = ((Unit_p->Device_p == &DeviceArray[DeviceIndex]) && (Unit_p->UnitValidity == STEXTVIN_VALID_UNIT));
                Unit_p++;
                UnitIndex++;
            }

            if (Found)
            {
                if (TermParams_p->ForceTerminate)
                {
                    UnitIndex = 0;
                    Unit_p = STEXTVIN_UnitArray;
                    while (UnitIndex < STEXTVIN_MAX_UNIT)
                    {
                        if ((Unit_p->Device_p == &DeviceArray[DeviceIndex]) && (Unit_p->UnitValidity == STEXTVIN_VALID_UNIT))
                        {
                            /* Found an open instance: close it ! */
                            ErrorCode = Close(Unit_p);
                            if (ErrorCode != ST_NO_ERROR)
                            {
                                /* If error: don't care, force close to force terminate... */
                                ErrorCode = ST_NO_ERROR;
                            }
                            /* Un-register opened handle whatever the error */
                            Unit_p->UnitValidity = 0;

                            STTBX_Report((STTBX_REPORT_LEVEL_INFO, "Handle closed on device '%s'", Unit_p->Device_p->DeviceName));
                        }
                        Unit_p++;
                        UnitIndex++;
                    }
                } /* End ForceTerminate: closed all opened handles */
                else
                {
                    /* Can't term if there are handles still opened, and ForceTerminate not set */
                    ErrorCode = ST_ERROR_OPEN_HANDLE;
                }
            } /* End found handle not closed */

            /* Terminate if OK */
            if (ErrorCode == ST_NO_ERROR)
            {
                /* API specific terminations */
                ErrorCode = Term(&DeviceArray[DeviceIndex], TermParams_p);
                /* Don't leave instance semi-terminated: terminate as much as possible */
                /* free device */
                DeviceArray[DeviceIndex].DeviceName[0] = '\0';

                STTBX_Report((STTBX_REPORT_LEVEL_INFO, "Device '%s' terminated", DeviceName));
            } /* End terminate OK */
        } /* End valid device */
    } /* End FirstInitDone */

    LeaveCriticalSection();

    return(ErrorCode);
} /* End of STEXTVIN_Term() function */
Example #3
0
CSaveLoadMgr::~CSaveLoadMgr( )
{
	Term( );
}
Example #4
0
CD3DEffectMgr::~CD3DEffectMgr()
{
	Term();
}
//-----------------------------------------------------------------------------
CLTAudioInfoResponse::~CLTAudioInfoResponse()
{
	Term();
}
Example #6
0
//--------------------------------------------------------------------------
void WindowsWindow::Init(WindowsVideo& kVideo, const char* pcTitle,
	int32_t x, int32_t y, int32_t w, int32_t h, uint32_t u32Flags)
{
	Term();
	LPWSTR lpwstrTitle = WindowsVideo::UTF8ToWSTR(pcTitle);
	DWORD dwStyle = FlagsToWindowStyle(u32Flags);

	int32_t flag_x = x >> 28;
	int32_t flag_y = y >> 28;
	x = flag_x ? 0 : x;
	y = flag_y ? 0 : y;
	RECT windowRect = { x, y, w, h };
	AdjustWindowRect(&windowRect, dwStyle, FALSE);

	VE_ASSERT(w > 0 && w < UINT16_MAX && h > 0 && h < UINT16_MAX);
	m_u16Width = (uint16_t)w;
	m_u16Height = (uint16_t)h;

	w = windowRect.right - windowRect.left;
	h = windowRect.bottom - windowRect.top;

	switch (flag_x)
	{
	case 1:
		x = CW_USEDEFAULT;
		break;
	case 2:
		x = (GetSystemMetrics(SM_CXSCREEN) - w) >> 1;
		break;
	default:
		x = windowRect.left;
		break;
	}
	switch (flag_y)
	{
	case 1:
		y = CW_USEDEFAULT;
		break;
	case 2:
		y = (GetSystemMetrics(SM_CYSCREEN) - h) >> 1;
		break;
	default:
		y = windowRect.top;
		break;
	}

	x = x == CW_USEDEFAULT ? x : vtd::max(x, 0);
	y = y == CW_USEDEFAULT ? y : vtd::max(y, 0);

	m_hHandle = CreateWindowW(kVideo.m_wstrClassName, lpwstrTitle, dwStyle,
		x, y, w, h, nullptr, nullptr, kVideo.m_hInstance, this);

	VeFree(lpwstrTitle);

	if (!m_hHandle)
	{
		m_u16Width = 0;
		m_u16Height = 0;
		THROW("Couldn't create window");
	}

	if (VE_MASK_HAS_ALL(u32Flags, VE_WINDOW_SHOWN))
	{
		int32_t i32Show = SW_SHOW;
		if (VE_MASK_HAS_ALL(dwStyle, WS_THICKFRAME))
		{
			switch (u32Flags & 0xF)
			{
			case VE_WINDOW_MINIMIZED:
				i32Show = SW_SHOWMINIMIZED;
				break;
			case VE_WINDOW_MAXIMIZED:
				i32Show = SW_SHOWMAXIMIZED;
				break;
			case VE_WINDOW_DEPSTARTUP:
				i32Show = kVideo.m_i32CmdShow;
				break;
			default:
				break;
			}
		}
		ShowWindow(m_hHandle, i32Show);
	}

	m_u32Flags = u32Flags & (VE_WINDOW_ALLOW_HIGHDPI | VE_WINDOW_FOREIGN);
	UpdateFlags();

	kVideo.m_kWindowList.attach_back(m_kNode);
}
Example #7
0
CAnimationSpooler::~CAnimationSpooler()
{
   Term();
}
Example #8
0
inline std::pair<bool, Term> ps_truncate_term(const Term &t, const T &max_degree, const symbol_set &)
{
    return std::make_pair(true, Term(math::truncate_degree(t.m_cf, max_degree), t.m_key));
}
Example #9
0
inline std::pair<bool, Term> ps_truncate_term(const Term &t, const T &max_degree, const symbol_set &s)
{
    // The truncation level for the coefficient must be modified in order to take
    // into account the degree of the key.
    return std::make_pair(true, Term(math::truncate_degree(t.m_cf, max_degree - t.m_key.ldegree(s)), t.m_key));
}
Example #10
0
CClientButeMgr::~CClientButeMgr()
{
	Term();

	delete[] m_aNumDebugLevels;
}
Example #11
0
CDoomsDayMissionMgr::~CDoomsDayMissionMgr()
{
	Term( );
}
Example #12
0
/* <Expression> ::= <Term> <Expression Prime> */
void SyntaxAnalyzer::Expression()
{
    Term();
    ExpressionPrime();
    logger.Log("<Expression ::= <Term><Expression Prime>");
}
Example #13
0
CDebrisMgr::~CDebrisMgr()
{
	Term();
}
Example #14
0
CTrkObjList::~CTrkObjList()
{
   Term();
}
Example #15
0
CDebrisSystemFX::~CDebrisSystemFX( void )
{
	Term();
}
Example #16
0
inline std::pair<bool, Term> ps_truncate_term(const Term &t, const T &max_degree, const std::vector<std::string> &names,
                                              const symbol_set::positions &p, const symbol_set &s)
{
    return std::make_pair(true,
                          Term(math::truncate_degree(t.m_cf, max_degree - t.m_key.ldegree(p, s), names), t.m_key));
}
Example #17
0
//--------------------------------------------------------------------------
WindowsWindow::~WindowsWindow()
{
	VE_TRY_CALL(Term());
}
Example #18
0
CSkillsButeMgr::~CSkillsButeMgr()
{
	Term();
}
Example #19
0
void CAnimationSpooler::CancelJobs()
{
   Term();
}
Example #20
0
//-----------------------------------------------------------------------------
CLTClientContext::~CLTClientContext()
{
	Term();
}
Example #21
0
CSoundDB::~CSoundDB()
{
    Term();
}
Example #22
0
CIntelMgr::~CIntelMgr()
{
    Term();
}
Example #23
0
CTriggerTypeMgr::~CTriggerTypeMgr()
{
	Term();
}
Example #24
0
CFxMgr::~CFxMgr()
{
	// Call Term()

	Term();
}
Example #25
0
BanIPMgr_Impl::~BanIPMgr_Impl( )
{
	Term( );
}
Example #26
0
/*
--------------------------------------------------------------------------------
Terminate xxxxx driver
(Standard instances management. Driver specific implementations should be put in Term() function.)
--------------------------------------------------------------------------------
*/
ST_ErrorCode_t LAYCOMPO_Term(const ST_DeviceName_t DeviceName, const STLAYER_TermParams_t *const TermParams_p)
{
    laycompo_Unit_t *Unit_p;
    S32 DeviceIndex = INVALID_DEVICE_INDEX, UnitIndex;
    BOOL Found = FALSE;
    ST_ErrorCode_t Err = ST_NO_ERROR;

    /* Exit now if parameters are bad */
    if ((TermParams_p == NULL) ||                       /* There must be parameters ! */
        (strlen(DeviceName) > ST_MAX_DEVICE_NAME - 1) || /* Device name length should be respected */
        (strcmp(&DeviceName[0], "\0")==0)            /* Device name should not be empty */
       )
    {
        return(ST_ERROR_BAD_PARAMETER);
    }

    EnterCriticalSection();

    if (!FirstInitDone)
    {
        Err = ST_ERROR_UNKNOWN_DEVICE;
    }
    else
    {
        /* Check if device already initialised and return error if NOT so */
        DeviceIndex = GetIndexOfDeviceNamed(DeviceName);
        if (DeviceIndex == INVALID_DEVICE_INDEX)
        {
            /* Device name not found */
            Err = ST_ERROR_UNKNOWN_DEVICE;
        }
        else
        {
            /* Check if there is still 'open' on this device */
/*            Found = FALSE;*/
            UnitIndex = 0;
            Unit_p = UnitArray;
            while ((UnitIndex < LAYCOMPO_MAX_UNIT) && (!Found))
            {
                Found = ((Unit_p->Device_p == &DeviceArray[DeviceIndex]) && (Unit_p->UnitValidity == LAYCOMPO_VALID_UNIT));
                Unit_p++;
                UnitIndex++;
            }

            if (Found)
            {
                if (TermParams_p->ForceTerminate)
                {
                    UnitIndex = 0;
                    Unit_p = UnitArray;
                    while (UnitIndex < LAYCOMPO_MAX_UNIT)
                    {
                        if ((Unit_p->Device_p == &DeviceArray[DeviceIndex]) && (Unit_p->UnitValidity == LAYCOMPO_VALID_UNIT))
                        {
                            /* Found an open instance: close it ! */
                            Err = Close(Unit_p);
                            if (Err == ST_NO_ERROR)
                            {
                                /* Un-register opened handle */
                                Unit_p->UnitValidity = 0;

                                STTBX_Report((STTBX_REPORT_LEVEL_INFO, "Handle closed on device '%s'", Unit_p->Device_p->DeviceName));
                            }
                            else
                            {
                                /* Problem: this should not happen
                                Fail to terminate ? No because of force */
                                Err = ST_NO_ERROR;
                            }
                        }
                        Unit_p++;
                        UnitIndex++;
                    }
                } /* End ForceTerminate: closed all opened handles */
                else
                {
                    /* Can't term if there are handles still opened, and ForceTerminate not set */
                    Err = ST_ERROR_OPEN_HANDLE;
                }
            } /* End found handle not closed */

            /* Terminate if OK */
            if (Err == ST_NO_ERROR)
            {
                /* API specific terminations */
                Err = Term(&DeviceArray[DeviceIndex], TermParams_p);

                if (Err == ST_NO_ERROR)
                {
                    /* Get semaphore before deleting it */
                    STOS_SemaphoreWait(DeviceArray[DeviceIndex].CtrlAccess_p);

                    /* Free device semaphore */
                    STOS_SemaphoreDelete(NULL,DeviceArray[DeviceIndex].CtrlAccess_p);

                    /* Device found: desallocate memory, free device */
                    DeviceArray[DeviceIndex].DeviceName[0] = '\0';

                    STTBX_Report((STTBX_REPORT_LEVEL_INFO, "Device '%s' terminated", DeviceName));
                }
            } /* End terminate OK */
        } /* End valid device */
    } /* End FirstInitDone */

    LeaveCriticalSection();

    return(Err);
} /* End of LAYCOMPO_Term() function */
Example #27
0
CRadarTypeMgr::~CRadarTypeMgr()
{
	Term();
}
Example #28
0
CTrackedNodeContext::~CTrackedNodeContext()
{
	Term();
}
Example #29
0
CScreenHostLevels::~CScreenHostLevels()
{
	Term();
}
Example #30
0
CBaseSpriteFX::~CBaseSpriteFX()
{
	Term();
}