Skip to content

Commit

Permalink
[squash] Vortex: fixed add-on directories to not hard-coded to specia…
Browse files Browse the repository at this point in the history
…l://xbmc/addons/
  • Loading branch information
Anton Fedchin committed May 27, 2015
1 parent c29a075 commit 927cb04
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
25 changes: 21 additions & 4 deletions xbmc/visualizations/Vortex/VortexVis/Core/Vortex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ class TrackInfo
char Rating;
};

char g_TexturePath[ 512 ] = "special://xbmc/addons/visualization.vortex/resources/Textures/";
char g_PresetPath[ 512 ] = "special://xbmc/addons/visualization.vortex/resources/Presets/";
char g_TransitionPath[ 512 ] = "special://xbmc//addons/visualization.vortex/resources/Transitions/";
char g_AnnouncePath[ 512 ] = "special://xbmc/addons/visualization.vortex/resources/Announcements/";
char g_pluginPath[ MAX_PATH ];
char g_TexturePath[ MAX_PATH ];
char g_PresetPath[ MAX_PATH ];
char g_TransitionPath[ MAX_PATH ];
char g_AnnouncePath[ MAX_PATH ];

class FileHolder
{
Expand Down Expand Up @@ -306,9 +307,25 @@ int GetRandomPreset()
return nextPreset;
}

void Vortex::InitPaths(void)
{
strcpy(g_TexturePath, g_pluginPath);
strcat(g_TexturePath, "/resources/Textures/");

strcpy(g_PresetPath, g_pluginPath);
strcat(g_PresetPath, "/resources/Presets/");

strcpy(g_TransitionPath, g_pluginPath);
strcat(g_TransitionPath, "/resources/Transitions/");

strcpy(g_AnnouncePath, g_pluginPath);
strcat(g_AnnouncePath, "/resources/Announcements/");
}

void Vortex::Init( ID3D11DeviceContext* pD3DContext, int iPosX, int iPosY, int iWidth, int iHeight, float fPixelRatio)
{
InitTime();
InitPaths();

DebugConsole::Init();
Renderer::Init( pD3DContext, iPosX, iPosY, iWidth, iHeight, fPixelRatio );
Expand Down
1 change: 1 addition & 0 deletions xbmc/visualizations/Vortex/VortexVis/Core/Vortex.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Vortex
void SaveSettings();

private:
void InitPaths(void);
bool InitAngelScript();
asIScriptEngine* m_pScriptEngine;
};
Expand Down
4 changes: 3 additions & 1 deletion xbmc/visualizations/Vortex/VortexXBMC/VortexXBMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@


Vortex* g_Vortex = NULL;
extern char g_pluginPath[];

// settings vector
//StructSetting** g_structSettings;
Expand All @@ -39,7 +40,8 @@ extern "C" ADDON_STATUS ADDON_Create(void* hdl, void* props)
VIS_PROPS* visprops = (VIS_PROPS*)props;

g_Vortex = new Vortex;
g_Vortex->Init((ID3D11DeviceContext*)visprops->device, visprops->x, visprops->y, visprops->width, visprops->height, visprops->pixelRatio);
strcpy(g_pluginPath, visprops->presets);
g_Vortex->Init(reinterpret_cast<ID3D11DeviceContext*>(visprops->device), visprops->x, visprops->y, visprops->width, visprops->height, visprops->pixelRatio);

return ADDON_STATUS_NEED_SAVEDSETTINGS;
}
Expand Down

0 comments on commit 927cb04

Please sign in to comment.