////////////////////////////////////////////////////////////////////////////
// XBMC tells us we should get ready to start rendering. This function
// is called once when the screensaver is activated by XBMC.
//
extern "C" void Start()
{
	srand((u32)time(null));
	gMatrixTrails = new CMatrixTrails();
	if (!gMatrixTrails)
		return;
	gTimer = new CTimer();
	gTimer->Init();
        char path[1024];
        XBMC->GetSetting("__addonpath__", path);
        std::string p2(path);
        p2 += "/resources/MatrixTrails.tga";

	if (!gMatrixTrails->RestoreDevice(&gRender, p2.c_str()))
		ADDON_Stop();
}
////////////////////////////////////////////////////////////////////////////
// XBMC tells us we should get ready to start rendering. This function
// is called once when the screensaver is activated by XBMC.
//
extern "C" void Start()
{
  srand((u32)time(null));
  gPlanestate = new CPlanestate(gCfgProbability);
  if (!gPlanestate)
    return;
  gTimer = new CTimer();
  gTimer->Init();
  if (!gPlanestate->RestoreDevice(&gRender))
    ADDON_Stop();

  // make sure these add up to 1
  float sum = gCfgProbability[0]+gCfgProbability[1]+gCfgProbability[2]+gCfgProbability[3];
  for (size_t i=0;i<4;++i)
    gCfgProbability[i] /= sum;
}
Exemple #3
0
//-- Destroy-------------------------------------------------------------------
// Do everything before unload of this add-on
// !!! Add-on master function !!!
//-----------------------------------------------------------------------------
extern "C" void ADDON_Destroy()
{
  ADDON_Stop();
}