aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-12-06 11:19:36 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-12-06 11:19:36 +0000
commit886b7205df1355054eda3cb72b65c77ec8a40d73 (patch)
treeb4901b040da2d45f03a9400e25027d5b1edb0271 /Game
parent553ee1ad981964a3689e6510d5813dbff0f2119c (diff)
downloadusdx-886b7205df1355054eda3cb72b65c77ec8a40d73.tar.gz
usdx-886b7205df1355054eda3cb72b65c77ec8a40d73.tar.xz
usdx-886b7205df1355054eda3cb72b65c77ec8a40d73.zip
added [tab] to change visualization preset
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@682 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UVisualizer.pas33
-rw-r--r--Game/Code/Screens/UScreenSing.pas6
2 files changed, 39 insertions, 0 deletions
diff --git a/Game/Code/Classes/UVisualizer.pas b/Game/Code/Classes/UVisualizer.pas
index 6fb5b7a7..08e4b594 100644
--- a/Game/Code/Classes/UVisualizer.pas
+++ b/Game/Code/Classes/UVisualizer.pas
@@ -133,6 +133,39 @@ end;
procedure TVideoPlayback_ProjectM.MoveTo(Time: real);
begin
+ // this code MAY be able to be cut down... but Im not 100% sure..
+ // in here, we cant realy move to a specific time, since its all random generated
+ // but a call to this function will change the preset, which changes the pattern
+ projectM_reset(pm);
+
+ pm^.fullscreen := 0;
+ pm^.renderTarget^.texsize := texsize;
+ pm^.gx := gx;
+ pm^.gy := gy;
+ pm^.fps := fps;
+ pm^.renderTarget^.usePbuffers := 0;
+
+ pm^.fontURL := PChar(projectM_Dir+'/fonts');
+ pm^.presetURL := PChar(projectM_Dir+'/presets');
+
+ glPushAttrib(GL_ALL_ATTRIB_BITS);
+ projectM_init(pm);
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glMatrixMode(GL_TEXTURE);
+ glPushMatrix();
+
+ projectM_resetGL(pm, ScreenW, ScreenH);
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
+ glMatrixMode(GL_TEXTURE);
+ glPopMatrix();
+ glPopAttrib();
+
end;
function TVideoPlayback_ProjectM.getPosition: real;
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas
index b3b92446..e62b9339 100644
--- a/Game/Code/Screens/UScreenSing.pas
+++ b/Game/Code/Screens/UScreenSing.pas
@@ -157,6 +157,12 @@ begin
VideoPlayback.play;
end;
+
+ SDLK_TAB: //Change Visualization Preset
+ begin
+ if AktSong.VideoLoaded then
+ VideoPlayback.MoveTo( now ); // move to a random position
+ end;
SDLK_RETURN:
begin