From 886b7205df1355054eda3cb72b65c77ec8a40d73 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 6 Dec 2007 11:19:36 +0000 Subject: added [tab] to change visualization preset git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@682 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UVisualizer.pas | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'Game/Code/Classes/UVisualizer.pas') 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; -- cgit v1.2.3