diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-02-12 10:30:58 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-02-12 10:30:58 +0000 |
commit | 9e696510eb04ce60cbfb8fa88629c66a9384c0f2 (patch) | |
tree | 93ecddcfacf9d54a0cf3d07a2e8acfea54274925 /Game/Code/Classes/UVisualizer.pas | |
parent | b2e0b65ac9d338fd76a564239feaec2cb4b85b36 (diff) | |
download | usdx-9e696510eb04ce60cbfb8fa88629c66a9384c0f2.tar.gz usdx-9e696510eb04ce60cbfb8fa88629c66a9384c0f2.tar.xz usdx-9e696510eb04ce60cbfb8fa88629c66a9384c0f2.zip |
UVisualizer uses the system dependant default game-path now
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@843 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/UVisualizer.pas | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/Game/Code/Classes/UVisualizer.pas b/Game/Code/Classes/UVisualizer.pas index 22c168a2..2f584299 100644 --- a/Game/Code/Classes/UVisualizer.pas +++ b/Game/Code/Classes/UVisualizer.pas @@ -36,6 +36,7 @@ implementation uses
UGraphic,
+ UMain,
ULog;
var
@@ -46,10 +47,15 @@ const gy = 24;
fps = 30;
texsize = 512;
- visualsDir = 'Visuals'; // TODO: move this to a place common for all visualizers
- projectMDir = visualsDir+'/projectM';
- presetsDir = projectMDir+'/presets';
- fontsDir = projectMDir+'/fonts';
+
+var
+ ProjectMPath : string;
+ presetsDir : string;
+ fontsDir : string;
+
+ // FIXME: dirty fix needed because the init method is not
+ // called yet.
+ inited: boolean;
type
TVideoPlayback_ProjectM = class( TInterfacedObject, IVideoPlayback, IVideoVisualization )
@@ -78,8 +84,8 @@ type procedure RestoreOpenGLState();
public
- constructor create();
- procedure init();
+ constructor Create();
+ procedure Init();
function GetName: String;
function Open( aFileName : string): boolean; // true if succeed
@@ -97,14 +103,22 @@ type end;
-constructor TVideoPlayback_ProjectM.create();
+constructor TVideoPlayback_ProjectM.Create();
begin
RndPCMcount := 0;
end;
-procedure TVideoPlayback_ProjectM.init();
+procedure TVideoPlayback_ProjectM.Init();
begin
+ // FIXME: dirty fix needed because the init method is not
+ // called yet.
+ inited := true;
+
+ ProjectMPath := VisualsPath + 'projectM' + PathDelim;
+ presetsDir := ProjectMPath + 'presets';
+ fontsDir := ProjectMPath + 'fonts';
+
VisualizerStarted := False;
VisualizerPaused := False;
@@ -212,6 +226,11 @@ procedure TVideoPlayback_ProjectM.VisualizerStart; var
initResult: Cardinal;
begin
+ // FIXME: dirty fix needed because the init method is not
+ // called yet.
+ if (not inited) then
+ Init();
+
VisualizerStarted := True;
pm := TProjectM.Create(gx, gy, fps, texsize, ScreenW, ScreenH,
|