From 873f177f08dc7c4fe2d7e50bbe7709df98e238d3 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 27 Aug 2008 14:58:32 +0000 Subject: rename Screen part2 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1306 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 1398 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1398 insertions(+) create mode 100644 src/screens/UScreenCredits.pas (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas new file mode 100644 index 00000000..f7f1fca7 --- /dev/null +++ b/src/screens/UScreenCredits.pas @@ -0,0 +1,1398 @@ +unit UScreenCredits; + +interface + +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + +{$I switches.inc} + + +uses + UMenu, + SDL, + SDL_Image, + UDisplay, + UTexture, + gl, + UMusic, + UFiles, + SysUtils, + UThemes, + //ULCD, + //ULight, + UGraphicClasses; + +type + TCreditsStages=(InitialDelay,Intro,MainPart,Outro); + + TScreenCredits = class(TMenu) + public + + Credits_X: Real; + Credits_Time: Cardinal; + Credits_Alpha: Cardinal; + CTime: Cardinal; + CTime_hold: Cardinal; + ESC_Alpha: Integer; + + credits_entry_tex: TTexture; + credits_entry_dx_tex: TTexture; + credits_bg_tex: TTexture; + credits_bg_ovl: TTexture; +// credits_bg_logo: TTexture; + credits_bg_scrollbox_left: TTexture; + credits_blindguard: TTexture; + credits_blindy: TTexture; + credits_canni: TTexture; + credits_commandio: TTexture; + credits_lazyjoker: TTexture; + credits_mog: TTexture; + credits_mota: TTexture; + credits_skillmaster: TTexture; + credits_whiteshark: TTexture; + intro_layer01: TTexture; + intro_layer02: TTexture; + intro_layer03: TTexture; + intro_layer04: TTexture; + intro_layer05: TTexture; + intro_layer06: TTexture; + intro_layer07: TTexture; + intro_layer08: TTexture; + intro_layer09: TTexture; + outro_bg: TTexture; + outro_esc: TTexture; + outro_exd: TTexture; + + deluxe_slidein: cardinal; + + CurrentScrollText: String; + NextScrollUpdate: Real; + EndofLastScrollingPart: Cardinal; + CurrentScrollStart, CurrentScrollEnd: Integer; + + CRDTS_Stage: TCreditsStages; + + myTex: glUint; + mysdlimage,myconvertedsdlimage: PSDL_Surface; + + Fadeout: boolean; + constructor Create; override; + function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override; + function Draw: boolean; override; + procedure onShow; override; + procedure onHide; override; + procedure DrawCredits; + procedure Draw_FunkyText; + end; + +const + Funky_Text: AnsiString = + 'Grandma Deluxe has arrived! Thanks to Corvus5 for the massive work on UltraStar, Wome for the nice tune you´re hearing, '+ + 'all the people who put massive effort and work in new songs (don´t forget UltraStar w/o songs would be nothing), ppl from '+ + 'irc helping us - eBandit and Gabari, scene ppl who really helped instead of compiling and running away. Greetings to DennisTheMenace for betatesting, '+ + 'Demoscene.tv, pouet.net, KakiArts, Sourceforge,..'; + + + Timings: array[0..21] of Cardinal=( + 20, // 0 Delay vor Start + + 149, // 1 Ende erster Intro Zoom + 155, // 2 Start 2. Action im Intro + 170, // 3 Ende Separation im Intro + 271, // 4 Anfang Zoomout im Intro + 0, // 5 unused + 261, // 6 Start fade-to-white im Intro + + 271, // 7 Start Main Part + 280, // 8 Start On-Beat-Sternchen Main Part + + 396, // 9 Start BlindGuard + 666, // 10 Start blindy + 936, // 11 Start Canni + 1206, // 12 Start Commandio + 1476, // 13 Start LazyJoker + 1746, // 14 Start Mog + 2016, // 15 Start Mota + 2286, // 16 Start SkillMaster + 2556, // 17 Start WhiteShark + 2826, // 18 Ende Whiteshark + 3096, // 19 Start FadeOut Mainscreen + 3366, // 20 Ende Credits Tune + 60); // 21 start flare im intro + + + sdl32bpprgba: TSDL_Pixelformat=(palette: nil; + BitsPerPixel: 32; + BytesPerPixel: 4; + Rloss: 0; + Gloss: 0; + Bloss: 0; + Aloss: 0; + Rshift: 0; + Gshift: 8; + Bshift: 16; + Ashift: 24; + Rmask: $000000ff; + Gmask: $0000ff00; + Bmask: $00ff0000; + Amask: $ff000000; + colorkey: 0; + alpha: 255 ); + + +implementation + +uses + ULog, + UGraphic, + UMain, + UIni, + USongs, + Textgl, + ULanguage, + UCommon, + Math; + + +function TScreenCredits.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; +begin + Result := true; + If (PressedDown) Then + begin // Key Down + case PressedKey of + + SDLK_ESCAPE, + SDLK_BACKSPACE : + begin + FadeTo(@ScreenMain); + AudioPlayback.PlaySound(SoundLib.Back); + end; +{ SDLK_SPACE: + begin + setlength(CTime_hold,length(CTime_hold)+1); + CTime_hold[high(CTime_hold)]:=CTime; + end; +} + end;//esac + end; //fi +end; + +constructor TScreenCredits.Create; +begin + inherited Create; + + credits_bg_tex := Texture.LoadTexture(true, 'CRDTS_BG', TEXTURE_TYPE_PLAIN, 0); + credits_bg_ovl := Texture.LoadTexture(true, 'CRDTS_OVL', TEXTURE_TYPE_TRANSPARENT, 0); + + credits_blindguard := Texture.LoadTexture(true, 'CRDTS_blindguard', TEXTURE_TYPE_TRANSPARENT, 0); + credits_blindy := Texture.LoadTexture(true, 'CRDTS_blindy', TEXTURE_TYPE_TRANSPARENT, 0); + credits_canni := Texture.LoadTexture(true, 'CRDTS_canni', TEXTURE_TYPE_TRANSPARENT, 0); + credits_commandio := Texture.LoadTexture(true, 'CRDTS_commandio', TEXTURE_TYPE_TRANSPARENT, 0); + credits_lazyjoker := Texture.LoadTexture(true, 'CRDTS_lazyjoker', TEXTURE_TYPE_TRANSPARENT, 0); + credits_mog := Texture.LoadTexture(true, 'CRDTS_mog', TEXTURE_TYPE_TRANSPARENT, 0); + credits_mota := Texture.LoadTexture(true, 'CRDTS_mota', TEXTURE_TYPE_TRANSPARENT, 0); + credits_skillmaster := Texture.LoadTexture(true, 'CRDTS_skillmaster', TEXTURE_TYPE_TRANSPARENT, 0); + credits_whiteshark := Texture.LoadTexture(true, 'CRDTS_whiteshark', TEXTURE_TYPE_TRANSPARENT, 0); + + intro_layer01 := Texture.LoadTexture(true, 'INTRO_L01', TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer02 := Texture.LoadTexture(true, 'INTRO_L02', TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer03 := Texture.LoadTexture(true, 'INTRO_L03', TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer04 := Texture.LoadTexture(true, 'INTRO_L04', TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer05 := Texture.LoadTexture(true, 'INTRO_L05', TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer06 := Texture.LoadTexture(true, 'INTRO_L06', TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer07 := Texture.LoadTexture(true, 'INTRO_L07', TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer08 := Texture.LoadTexture(true, 'INTRO_L08', TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer09 := Texture.LoadTexture(true, 'INTRO_L09', TEXTURE_TYPE_TRANSPARENT, 0); + + outro_bg := Texture.LoadTexture(true, 'OUTRO_BG', TEXTURE_TYPE_PLAIN, 0); + outro_esc := Texture.LoadTexture(true, 'OUTRO_ESC', TEXTURE_TYPE_TRANSPARENT, 0); + outro_exd := Texture.LoadTexture(true, 'OUTRO_EXD', TEXTURE_TYPE_TRANSPARENT, 0); + + CRDTS_Stage:=InitialDelay; +end; + +function TScreenCredits.Draw: boolean; +begin + DrawCredits; + Draw:=true; +end; + +function pixfmt_eq(fmt1,fmt2: TSDL_Pixelformat): boolean; +begin + if (fmt1.BitsPerPixel = fmt2.BitsPerPixel) and + (fmt1.BytesPerPixel = fmt2.BytesPerPixel) and + (fmt1.Rloss = fmt2.Rloss) and + (fmt1.Gloss = fmt2.Gloss) and + (fmt1.Bloss = fmt2.Bloss) and + (fmt1.Rmask = fmt2.Rmask) and + (fmt1.Gmask = fmt2.Gmask) and + (fmt1.Bmask = fmt2.Bmask) and + (fmt1.Rshift = fmt2.Rshift) and + (fmt1.Gshift = fmt2.Gshift) and + (fmt1.Bshift = fmt2.Bshift) + then + pixfmt_eq:=True + else + pixfmt_eq:=False; +end; + +function inttohexstr(i: cardinal):pchar; +var helper, i2, c:cardinal; + tmpstr: string; +begin + helper:=0; + i2:=i; + tmpstr:=''; + for c:=1 to 8 do + begin + helper:=(helper shl 4) or (i2 and $f); + i2:=i2 shr 4; + end; + for c:=1 to 8 do + begin + i2:=helper and $f; + helper := helper shr 4; + case i2 of + 0: tmpstr:=tmpstr+'0'; + 1: tmpstr:=tmpstr+'1'; + 2: tmpstr:=tmpstr+'2'; + 3: tmpstr:=tmpstr+'3'; + 4: tmpstr:=tmpstr+'4'; + 5: tmpstr:=tmpstr+'5'; + 6: tmpstr:=tmpstr+'6'; + 7: tmpstr:=tmpstr+'7'; + 8: tmpstr:=tmpstr+'8'; + 9: tmpstr:=tmpstr+'9'; + 10: tmpstr:=tmpstr+'a'; + 11: tmpstr:=tmpstr+'b'; + 12: tmpstr:=tmpstr+'c'; + 13: tmpstr:=tmpstr+'d'; + 14: tmpstr:=tmpstr+'e'; + 15: tmpstr:=tmpstr+'f'; + end; + end; + inttohexstr:=pchar(tmpstr); +end; + +procedure TScreenCredits.onShow; +begin + inherited; + + CRDTS_Stage:=InitialDelay; + Credits_X := 580; + deluxe_slidein := 0; + Credits_Alpha := 0; + //Music.SetLoop(true); Loop looped ned, so ne scheisse - loop loops not, shit + AudioPlayback.Open(soundpath + 'wome-credits-tune.mp3'); //danke kleinster liebster weeeetüüüüü!! - thank you wetü +// Music.Play; + CTime:=0; +// setlength(CTime_hold,0); + + mysdlimage:=IMG_Load('test.png'); + if assigned(mysdlimage) then + begin + showmessage('opened image via SDL_Image'+#13#10+ + 'Width: '+inttostr(mysdlimage^.w)+#13#10+ + 'Height: '+inttostr(mysdlimage^.h)+#13#10+ + 'BitsPP: '+inttostr(mysdlimage^.format.BitsPerPixel)+#13#10+ + 'BytesPP: '+inttostr(mysdlimage^.format.BytesPerPixel)+#13#10+ + 'Rloss: '+inttostr(mysdlimage^.format.Rloss)+#13#10+ + 'Gloss: '+inttostr(mysdlimage^.format.Gloss)+#13#10+ + 'Bloss: '+inttostr(mysdlimage^.format.Bloss)+#13#10+ + 'Aloss: '+inttostr(mysdlimage^.format.Aloss)+#13#10+ + 'Rshift: '+inttostr(mysdlimage^.format.Rshift)+#13#10+ + 'Gshift: '+inttostr(mysdlimage^.format.Gshift)+#13#10+ + 'Bshift: '+inttostr(mysdlimage^.format.Bshift)+#13#10+ + 'Ashift: '+inttostr(mysdlimage^.format.Ashift)+#13#10+ + 'Rmask: '+inttohexstr(mysdlimage^.format.Rmask)+#13#10+ + 'Gmask: '+inttohexstr(mysdlimage^.format.Gmask)+#13#10+ + 'Bmask: '+inttohexstr(mysdlimage^.format.Bmask)+#13#10+ + 'Amask: '+inttohexstr(mysdlimage^.format.Amask)+#13#10+ + 'ColKey: '+inttostr(mysdlimage^.format.Colorkey)+#13#10+ + 'Alpha: '+inttostr(mysdlimage^.format.Alpha)); + + if pixfmt_eq(mysdlimage^.format^,sdl32bpprgba) then + showmessage('equal pixelformats') + else + showmessage('different pixelformats'); + + myconvertedsdlimage:=SDL_ConvertSurface(mysdlimage,@sdl32bpprgba,SDL_SWSURFACE); + glGenTextures(1,@myTex); + glBindTexture(GL_TEXTURE_2D, myTex); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexImage2D( GL_TEXTURE_2D, 0, 4, myconvertedsdlimage^.w, myconvertedsdlimage^.h, 0, + GL_RGBA, GL_UNSIGNED_BYTE, myconvertedsdlimage^.pixels ); + SDL_FreeSurface(mysdlimage); + SDL_FreeSurface(myconvertedsdlimage); + end + else + showmessage('could not open file - test.png'); + +end; + +procedure TScreenCredits.onHide; +begin + AudioPlayback.Stop; +end; + +Procedure TScreenCredits.Draw_FunkyText; +var + S: Integer; + X,Y,A: Real; + visibleText: PChar; +begin + SetFontSize(10); + //Init ScrollingText + if (CTime = Timings[7]) then + begin + //Set Position of Text + Credits_X := 600; + CurrentScrollStart:=1; + CurrentScrollEnd:=1; + end; + + if (CTime > Timings[7]) and (CurrentScrollStart < length(Funky_Text)) then + begin + X:=0; + visibleText:=pchar(Copy(Funky_Text, CurrentScrollStart, CurrentScrollEnd)); + for S := 0 to length(visibleText)-1 do begin + Y:=abs(sin((Credits_X+X)*0.93{*(((Credits_X+X))/1200)}/100*pi)); + SetFontPos(Credits_X+X,538-Y*(Credits_X+X)*(Credits_X+X)*(Credits_X+X)/1000000); + A:=0; + if (Credits_X+X < 15) then A:=0; + if (Credits_X+X >=15) then A:=Credits_X+X-15; + if Credits_X+X > 32 then A:=17; + glColor4f( 230/255-40/255+Y*(Credits_X+X)/900, 200/255-30/255+Y*(Credits_X+X)/1000, 155/255-20/255+Y*(Credits_X+X)/1100, A/17); + glPrintLetter(visibleText[S]); + X := X + Fonts[ActFont].Width[Ord(visibleText[S])] * Fonts[ActFont].Tex.H / 30 * Fonts[ActFont].AspectW; + end; + if (Credits_X<0) and (CurrentScrollStart < length(Funky_Text)) then begin + Credits_X:=Credits_X + Fonts[ActFont].Width[Ord(Funky_Text[CurrentScrollStart])] * Fonts[ActFont].Tex.H / 30 * Fonts[ActFont].AspectW; + inc(CurrentScrollStart); + end; + visibleText:=pchar(Copy(Funky_Text, CurrentScrollStart, CurrentScrollEnd)); + if (Credits_X+glTextWidth(visibleText) < 600) and (CurrentScrollEnd < length(Funky_Text)) then begin + inc(CurrentScrollEnd); + end; + end; +{ // timing hack + X:=5; + SetFontStyle (2); + SetFontItalic(False); + SetFontSize(9); + glColor4f(1, 1, 1, 1); + for S:=0 to high(CTime_hold) do begin + visibleText:=pchar(inttostr(CTime_hold[S])); + SetFontPos (500, X); + glPrint (Addr(visibleText[0])); + X:=X+20; + end;} +end; + +procedure Start3D; +begin + glMatrixMode(GL_PROJECTION); + glPushMatrix; + glLoadIdentity; + glFrustum(-0.3*4/3,0.3*4/3,-0.3,0.3,1,1000); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity; +end; +procedure End3D; +begin + glMatrixMode(GL_PROJECTION); + glPopMatrix; + glMatrixMode(GL_MODELVIEW); +end; + +procedure TScreenCredits.DrawCredits; +var +T{*, I*}: Cardinal; // Auto Removed, Unused Variable (I) // Auto Removed, Unused Variable (I) +// X: Real; // Auto Removed, Unused Variable +// Ver: PChar; // Auto Removed, Unused Variable +// RuntimeStr: AnsiString; // Auto Removed, Unused Variable + Data: TFFTData; + j,k,l:cardinal; +f,g{*, h*}: Real; // Auto Removed, Unused Variable (h) // Auto Removed, Unused Variable (h) + STime:cardinal; + Delay:cardinal; + +// myPixel: longword; // Auto Removed, Unused Variable +// myColor: Cardinal; // Auto Removed, Unused Variable + myScale: Real; + myAngle: Real; + + +const myLogoCoords: Array[0..27,0..1] of Cardinal = ((39,32),(84,32),(100,16),(125,24), + (154,31),(156,58),(168,32),(203,36), + (258,34),(251,50),(274,93),(294,84), + (232,54),(278,62),(319,34),(336,92), + (347,23),(374,32),(377,58),(361,83), + (385,91),(405,91),(429,35),(423,51), + (450,32),(485,34),(444,91),(486,93)); + +begin + //dis does teh muiwk y0r + AudioPlayback.GetFFTData(Data); + + Log.LogStatus('',' JB-1'); + + T := SDL_GetTicks() div 33; + if T <> Credits_Time then + begin + Credits_Time := T; + inc(CTime); + inc(CTime_hold); + Credits_X := Credits_X-2; + + Log.LogStatus('',' JB-2'); + if (CRDTS_Stage=InitialDelay) and (CTime=Timings[0]) then + begin +// CTime:=Timings[20]; +// CRDTS_Stage:=Outro; + + CRDTS_Stage:=Intro; + CTime:=0; + AudioPlayback.Play; + + end; + if (CRDTS_Stage=Intro) and (CTime=Timings[7]) then + begin + CRDTS_Stage:=MainPart; + end; + if (CRDTS_Stage=MainPart) and (CTime=Timings[20]) then + begin + CRDTS_Stage:=Outro; + end; + end; + + Log.LogStatus('',' JB-3'); + + //draw background + if CRDTS_Stage=InitialDelay then + begin + glClearColor(0,0,0,0); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); + end + else + if CRDTS_Stage=Intro then + begin + Start3D; + glPushMatrix; + + glClearColor(0,0,0,0); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); + + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + if CTime < Timings[1] then begin + myScale:= 0.5+0.5*(Timings[1]-CTime)/(Timings[1]); // slowly move layers together + myAngle:=cos((CTime)*pi/((Timings[1])*2)); // and make logo face towards camera + end else begin // this is the part when the logo stands still + myScale:=0.5; + myAngle:=0; + end; + if CTime > Timings[2] then begin + myScale:= 0.5+0.5*(CTime-Timings[2])/(Timings[3]-Timings[2]); // get some space between layers + myAngle:=0; + end; +// if CTime > Timings[3] then myScale:=1; // keep the space between layers + glTranslatef(0,0,-5+0.5*myScale); + if CTime > Timings[3] then myScale:=1; // keep the space between layers + if CTime > Timings[3] then begin // make logo rotate left and grow +// myScale:=(CTime-Timings[4])/(Timings[7]-Timings[4]); + glRotatef(20*sqr(CTime-Timings[3])/sqr((Timings[7]-Timings[3])/2),0,0,1); + glScalef(1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1); + end; + if CTime < Timings[2] then + glRotatef(30*myAngle,0.5*myScale+myScale,1+myScale,0); +// glScalef(0.5,0.5,0.5); + glScalef(4/3,-1,1); + glColor4f(1, 1, 1, 1); + + glBindTexture(GL_TEXTURE_2D, intro_layer01.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, -0.4 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, -0.4 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, -0.4 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, -0.4 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer02.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, -0.3 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, -0.3 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, -0.3 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, -0.3 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer03.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, -0.2 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, -0.2 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, -0.2 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, -0.2 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer04.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, -0.1 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, -0.1 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, -0.1 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, -0.1 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer05.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer06.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0.1 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0.1 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0.1 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0.1 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer07.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0.2 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0.2 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0.2 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0.2 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer08.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0.3 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0.3 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0.3 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0.3 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer09.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0.22 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0.22 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0.22 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0.22 * myScale); + glEnd; + gldisable(gl_texture_2d); + glDisable(GL_BLEND); + + glPopMatrix; + End3D; + + // do some sparkling effects + if (CTime < Timings[1]) and (CTime > Timings[21]) then + begin + for k:=1 to 3 do begin + l:=410+floor((CTime-Timings[21])/(Timings[1]-Timings[21])*(536-410))+RandomRange(-5,5); + j:=floor((Timings[1]-CTime)/22)+RandomRange(285,301); + GoldenRec.Spawn(l, j, 1, 16, 0, -1, Flare, 0); + end; + end; + + // fade to white at end + if Ctime > Timings[6] then + begin + glColor4f(1,1,1,sqr(Ctime-Timings[6])*(Ctime-Timings[6])/sqr(Timings[7]-Timings[6])); + glEnable(GL_BLEND); + glBegin(GL_QUADS); + glVertex2f(0,0); + glVertex2f(0,600); + glVertex2f(800,600); + glVertex2f(800,0); + glEnd; + glDisable(GL_BLEND); + end; + + end; + if (CRDTS_Stage=MainPart) then + // main credits screen background, scroller, logo and girl + begin + + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + glColor4f(1, 1, 1, 1); + glBindTexture(GL_TEXTURE_2D, credits_bg_tex.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(0, 0); + glTexCoord2f(0,600/1024);glVertex2f(0, 600); + glTexCoord2f(800/1024,600/1024); glVertex2f(800, 600); + glTexCoord2f(800/1024,0);glVertex2f(800, 0); + glEnd; + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + + // draw scroller + Draw_FunkyText; + +//######################################################################### +// draw credits names + + +Log.LogStatus('',' JB-4'); + +// BlindGuard (von links oben reindrehen, nach rechts unten rausdrehen) - (rotate in from upper left, rotate out to lower right) + STime:=Timings[9]-10; + Delay:=Timings[10]-Timings[9]; + if CTime > STime then + begin + k:=0; + ESC_Alpha:=20; + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); + if ESC_Alpha >20 then ESC_Alpha:=20; + if ((CTime-STime)<20) then ESC_Alpha:=20; + if CTime <=STime+10 then j:=CTime-STime else j:=10; + if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + + if (CTime >= STime+10) and (CTime<=STime+12) then begin + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + end; + + glPushMatrix; + gltranslatef(0,329,0); + if CTime <= STime+10 then begin glrotatef((CTime-STime)*9+270,0,0,1);end; + gltranslatef(223,0,0); + if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin + gltranslatef(223,0,0); + glrotatef((integer(CTime)-(integer(STime+Delay)-10))*-9,0,0,1); + gltranslatef(-223,0,0); + end; + glBindTexture(GL_TEXTURE_2D, credits_blindguard.TexNum); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(-163, -129); + glTexCoord2f(0,1);glVertex2f(-163, 129); + glTexCoord2f(1,1); glVertex2f(163, 129); + glTexCoord2f(1,0);glVertex2f(163, -129); + glEnd; + gldisable(gl_texture_2d); + gldisable(GL_BLEND); + glPopMatrix; + end; + +// Blindy (zoom von 0 auf volle grösse und drehung, zoom auf doppelte grösse und nach rechts oben schieben) - (zoom from 0 to full size and rotation, zoom zo doubble size and shift to upper right) + STime:=Timings[10]-10; + Delay:=Timings[11]-Timings[10]+5; + if CTime > STime then + begin + k:=0; + ESC_Alpha:=20; + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + + if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); + if ESC_Alpha >20 then ESC_Alpha:=20; + if ((CTime-STime)<20) then ESC_Alpha:=20; + if CTime <=STime+10 then j:=CTime-STime else j:=10; + if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + + if (CTime >= STime+20) and (CTime<=STime+22) then begin + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + end; + + glPushMatrix; + gltranslatef(223,329,0); + if CTime <= STime+20 then begin + j:=CTime-Stime; + glscalef(j*j/400,j*j/400,j*j/400); + glrotatef(j*18.0,0,0,1); + end; + if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin + j:=CTime-(STime+Delay-10); + f:=j*10.0; + gltranslatef(f*3,-f,0); + glscalef(1+j/10,1+j/10,1+j/10); + glrotatef(j*9.0,0,0,1); + end; + glBindTexture(GL_TEXTURE_2D, credits_blindy.TexNum); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(-163, -129); + glTexCoord2f(0,1);glVertex2f(-163, 129); + glTexCoord2f(1,1); glVertex2f(163, 129); + glTexCoord2f(1,0);glVertex2f(163, -129); + glEnd; + gldisable(gl_texture_2d); + gldisable(GL_BLEND); + glPopMatrix; + end; + +// Canni (von links reinschieben, nach rechts oben rausschieben) - (shift in from left, shift out to upper right) + STime:=Timings[11]-10; + Delay:=Timings[12]-Timings[11]+5; + if CTime > STime then + begin + k:=0; + ESC_Alpha:=20; + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + + if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); + if ESC_Alpha >20 then ESC_Alpha:=20; + if ((CTime-STime)<20) then ESC_Alpha:=20; + if CTime <=STime+10 then j:=CTime-STime else j:=10; + if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + + if (CTime >= STime+10) and (CTime<=STime+12) then begin + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + end; + + glPushMatrix; + gltranslatef(223,329,0); + if CTime <= STime+10 then begin + gltranslatef(((CTime-STime)*21.0)-210,0,0); + end; + if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin + j:=(CTime-(STime+Delay-10))*21; + gltranslatef(j,-j/2,0); + end; + glBindTexture(GL_TEXTURE_2D, credits_canni.TexNum); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(-163, -129); + glTexCoord2f(0,1);glVertex2f(-163, 129); + glTexCoord2f(1,1); glVertex2f(163, 129); + glTexCoord2f(1,0);glVertex2f(163, -129); + glEnd; + gldisable(gl_texture_2d); + gldisable(GL_BLEND); + glPopMatrix; + end; + +// Commandio (von unten reinklappen, nach rechts oben rausklappen) - (flip in from down, flip out to upper right) + STime:=Timings[12]-10; + Delay:=Timings[13]-Timings[12]; + if CTime > STime then + begin + k:=0; + ESC_Alpha:=20; + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + + if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); + if ESC_Alpha >20 then ESC_Alpha:=20; + if ((CTime-STime)<20) then ESC_Alpha:=20; + if CTime <=STime+10 then j:=CTime-STime else j:=10; + if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + + if (CTime >= STime+10) and (CTime<=STime+12) then begin + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + end; + + glPushMatrix; + gltranslatef(223,329,0); + if CTime <= STime+10 then + f:=258.0-25.8*(CTime-STime) + else + f:=0; + g:=0; + if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin + j:=CTime-(STime+Delay-10); + g:=32.6*j; + end; + glBindTexture(GL_TEXTURE_2D, credits_commandio.TexNum); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(-163+g-f*1.5, -129+f*1.5-g/2); + glTexCoord2f(0,1);glVertex2f(-163+g*1.5, 129-(g*1.5*258/326)); + glTexCoord2f(1,1); glVertex2f(163+g, 129+g/4); + glTexCoord2f(1,0);glVertex2f(163+f*1.5+g/4, -129+f*1.5-g/4); + glEnd; + gldisable(gl_texture_2d); + gldisable(GL_BLEND); + glPopMatrix; + end; + +// lazy joker (just scrolls from left to right, no twinkling stars, no on-beat flashing) + STime:=Timings[13]-35; + Delay:=Timings[14]-Timings[13]+5; + if CTime > STime then + begin + k:=0; + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + + if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); + if ESC_Alpha >20 then ESC_Alpha:=20; + if ((CTime-STime)>10) and ((CTime-STime)<20) then ESC_Alpha:=20; + ESC_Alpha:=10; + f:=CTime-STime; + if CTime <=STime+40 then j:=CTime-STime else j:=40; + if (CTime >=STime+Delay-40) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + glColor4f(1, 1, 1, ESC_Alpha/20*j*j/1600); + + glPushMatrix; + gltranslatef(180+(f-70),329,0); + glBindTexture(GL_TEXTURE_2D, credits_lazyjoker.TexNum); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(-163, -129); + glTexCoord2f(0,1);glVertex2f(-163, 129); + glTexCoord2f(1,1); glVertex2f(163, 129); + glTexCoord2f(1,0);glVertex2f(163, -129); + glEnd; + gldisable(gl_texture_2d); + gldisable(GL_BLEND); + glPopMatrix; + end; + +// Mog (von links reinklappen, nach rechts unten rausklappen) - (flip in from right, flip out to lower right) + STime:=Timings[14]-10; + Delay:=Timings[15]-Timings[14]+5; + if CTime > STime then + begin + k:=0; + ESC_Alpha:=20; + + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + + if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); + if ESC_Alpha >20 then ESC_Alpha:=20; + if ((CTime-STime)<20) then ESC_Alpha:=20; + if CTime <=STime+10 then j:=CTime-STime else j:=10; + if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + + if (CTime >= STime+10) and (CTime<=STime+12) then begin + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + end; + + glPushMatrix; + gltranslatef(223,329,0); + if CTime <= STime+10 then + f:=326.0-32.6*(CTime-STime) + else + f:=0; + + g:=0; + if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin + j:=CTime-(STime+Delay-10); + g:=32.6*j; + end; + glBindTexture(GL_TEXTURE_2D, credits_mog.TexNum); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(-163+g*1.5, -129+g*1.5); + glTexCoord2f(0,1);glVertex2f(-163+g*1.2, 129+g); + glTexCoord2f(1,1); glVertex2f(163-f+g/2, 129+f*1.5+g/4); + glTexCoord2f(1,0);glVertex2f(163-f+g*1.5, -129-f*1.5); + glEnd; + gldisable(gl_texture_2d); + gldisable(GL_BLEND); + glPopMatrix; + end; + +// Mota (von rechts oben reindrehen, nach links unten rausschieben und verkleinern und dabei drehen) - (rotate in from upper right, shift out to lower left while shrinking and rotateing) + STime:=Timings[15]-10; + Delay:=Timings[16]-Timings[15]+5; + if CTime > STime then + begin + k:=0; + ESC_Alpha:=20; + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + + if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); + if ESC_Alpha >20 then ESC_Alpha:=20; + if ((CTime-STime)<20) then ESC_Alpha:=20; + if CTime <=STime+10 then j:=CTime-STime else j:=10; + if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + + if (CTime >= STime+10) and (CTime<=STime+12) then begin + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + end; + + glPushMatrix; + gltranslatef(223,329,0); + if CTime <= STime+10 then begin + gltranslatef(223,0,0); + glrotatef((10-(CTime-STime))*9,0,0,1); + gltranslatef(-223,0,0); + end; + if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin + j:=CTime-(STime+Delay-10); + f:=j*10.0; + gltranslatef(-f*2,-f,0); + glscalef(1-j/10,1-j/10,1-j/10); + glrotatef(-j*9.0,0,0,1); + end; + glBindTexture(GL_TEXTURE_2D, credits_mota.TexNum); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(-163, -129); + glTexCoord2f(0,1);glVertex2f(-163, 129); + glTexCoord2f(1,1); glVertex2f(163, 129); + glTexCoord2f(1,0);glVertex2f(163, -129); + glEnd; + gldisable(gl_texture_2d); + gldisable(GL_BLEND); + glPopMatrix; + end; + +// Skillmaster (von rechts unten reinschieben, nach rechts oben rausdrehen) - (shift in from lower right, rotate out to upper right) + STime:=Timings[16]-10; + Delay:=Timings[17]-Timings[16]+5; + if CTime > STime then + begin + k:=0; + ESC_Alpha:=20; + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + + if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); + if ESC_Alpha >20 then ESC_Alpha:=20; + if ((CTime-STime)<20) then ESC_Alpha:=20; + if CTime <=STime+10 then j:=CTime-STime else j:=10; + if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + + if (CTime >= STime+10) and (CTime<=STime+12) then begin + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + end; + + glPushMatrix; + gltranslatef(223,329,0); + if CTime <= STime+10 then begin + j:=STime+10-CTime; + f:=j*10.0; + gltranslatef(+f*2,+f/2,0); + end; + if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin + j:=CTime-(STime+Delay-10); + gltranslatef(0,-223,0); + glrotatef(integer(j)*-9,0,0,1); + gltranslatef(0,223,0); + glrotatef(j*9,0,0,1); + end; + glBindTexture(GL_TEXTURE_2D, credits_skillmaster.TexNum); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(-163, -129); + glTexCoord2f(0,1);glVertex2f(-163, 129); + glTexCoord2f(1,1); glVertex2f(163, 129); + glTexCoord2f(1,0);glVertex2f(163, -129); + glEnd; + gldisable(gl_texture_2d); + gldisable(GL_BLEND); + glPopMatrix; + end; + +// WhiteShark (von links unten reinklappen, nach rechts oben rausklappen) - (flip in from lower left, flip out to upper right) + STime:=Timings[17]-10; + Delay:=Timings[18]-Timings[17]; + if CTime > STime then + begin + k:=0; + ESC_Alpha:=20; + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + + if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); + if ESC_Alpha >20 then ESC_Alpha:=20; + if ((CTime-STime)<20) then ESC_Alpha:=20; + if CTime <=STime+10 then j:=CTime-STime else j:=10; + if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + + if (CTime >= STime+10) and (CTime<=STime+12) then begin + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); + end; + + glPushMatrix; + gltranslatef(223,329,0); + if CTime <= STime+10 then + f:=326.0-32.6*(CTime-STime) + else + f:=0; + + if (CTime >= STime+Delay-10) and (CTime <= STime+Delay) then + begin + j:=CTime-(STime+Delay-10); + g:=32.6*j; + end + else + begin + g:=0; + end; + + glBindTexture(GL_TEXTURE_2D, credits_whiteshark.TexNum); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(-163-f+g, -129+f/4-g/2); + glTexCoord2f(0,1);glVertex2f(-163-f/4+g, 129+g/2+f/4); + glTexCoord2f(1,1); glVertex2f(163-f*1.2+g/4, 129+f/2-g/4); + glTexCoord2f(1,0);glVertex2f(163-f*1.5+g/4, -129+f*1.5+g/4); + glEnd; + gldisable(gl_texture_2d); + gldisable(GL_BLEND); + glPopMatrix; + end; + + + Log.LogStatus('',' JB-103'); + +// #################################################################### +// do some twinkle stuff (kinda on beat) + if (CTime > Timings[8] ) and + (CTime < Timings[19] ) then + begin + k := 0; + + try + for j:=0 to 40 do + begin + if ( j < length( Data ) ) AND + ( k < length( Data ) ) then + begin + if Data[j] >= Data[k] then + k:=j; + end; + end; + except + end; + + if Data[k]>0.2 then + begin + l := RandomRange(6,16); + j := RandomRange(0,27); + + GoldenRec.Spawn(myLogoCoords[j,0], myLogoCoords[j,1], 16-l, l, 0, -1, PerfectNote, 0); + end; + end; + +//################################################# +// draw the rest of the main screen (girl and logo + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glColor4f(1, 1, 1, 1); + glBindTexture(GL_TEXTURE_2D, credits_bg_ovl.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(800-393, 0); + glTexCoord2f(0,600/1024);glVertex2f(800-393, 600); + glTexCoord2f(393/512,600/1024); glVertex2f(800, 600); + glTexCoord2f(393/512,0);glVertex2f(800, 0); + glEnd; +{ glBindTexture(GL_TEXTURE_2D, credits_bg_logo.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(0, 0); + glTexCoord2f(0,112/128);glVertex2f(0, 112); + glTexCoord2f(497/512,112/128); glVertex2f(497, 112); + glTexCoord2f(497/512,0);glVertex2f(497, 0); + glEnd; +} + gldisable(gl_texture_2d); + glDisable(GL_BLEND); + + // fade out at end of main part + if Ctime > Timings[19] then + begin + glColor4f(0,0,0,(Ctime-Timings[19])/(Timings[20]-Timings[19])); + glEnable(GL_BLEND); + glBegin(GL_QUADS); + glVertex2f(0,0); + glVertex2f(0,600); + glVertex2f(800,600); + glVertex2f(800,0); + glEnd; + glDisable(GL_BLEND); + end; + end + else + if (CRDTS_Stage=Outro) then + begin + if CTime=Timings[20] then begin + CTime_hold:=0; + AudioPlayback.Stop; + AudioPlayback.Open(soundpath + 'credits-outro-tune.mp3'); + AudioPlayback.SetVolume(0.2); + AudioPlayback.SetLoop(True); + AudioPlayback.Play; + end; + if CTime_hold > 231 then begin + AudioPlayback.Play; + Ctime_hold:=0; + end; + glClearColor(0,0,0,0); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); + + // do something useful + // outro background + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + glColor4f(1, 1, 1, 1); + glBindTexture(GL_TEXTURE_2D, outro_bg.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(0, 0); + glTexCoord2f(0,600/1024);glVertex2f(0, 600); + glTexCoord2f(800/1024,600/1024); glVertex2f(800, 600); + glTexCoord2f(800/1024,0);glVertex2f(800, 0); + glEnd; + + //outro overlays + glColor4f(1, 1, 1, (1+sin(CTime/15))/3+1/3); + glBindTexture(GL_TEXTURE_2D, outro_esc.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(0, 0); + glTexCoord2f(0,223/256);glVertex2f(0, 223); + glTexCoord2f(487/512,223/256); glVertex2f(487, 223); + glTexCoord2f(487/512,0);glVertex2f(487, 0); + glEnd; + + ESC_Alpha:=20; + if (RandomRange(0,20) > 18) and (ESC_Alpha=20) then + ESC_Alpha:=0 + else inc(ESC_Alpha); + if ESC_Alpha > 20 then ESC_Alpha:=20; + glColor4f(1, 1, 1, ESC_Alpha/20); + glBindTexture(GL_TEXTURE_2D, outro_exd.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(800-310, 600-247); + glTexCoord2f(0,247/256);glVertex2f(800-310, 600); + glTexCoord2f(310/512,247/256); glVertex2f(800, 600); + glTexCoord2f(310/512,0);glVertex2f(800, 600-247); + glEnd; + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + + // outro scrollers? + // ... + end; + +{ // draw credits runtime counter + SetFontStyle (2); + SetFontItalic(False); + SetFontSize(9); + SetFontPos (5, 5); + glColor4f(1, 1, 1, 1); +// RuntimeStr:='CTime: '+inttostr(floor(CTime/30.320663991914489602156136106092))+'.'+inttostr(floor(CTime/3.0320663991914489602156136106092)-floor(CTime/30.320663991914489602156136106092)*10); + RuntimeStr:='CTime: '+inttostr(CTime); + glPrint (Addr(RuntimeStr[1])); +} + + + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glColor4f(1, 1, 1, 1); + glBindTexture(GL_TEXTURE_2D, myTex); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex2f(100, 100); + glTexCoord2f(0,1);glVertex2f(100, 200); + glTexCoord2f(1,1); glVertex2f(200, 200); + glTexCoord2f(1,0);glVertex2f(200, 100); + glEnd; + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + + + // make the stars shine + GoldenRec.Draw; +end; + +end. -- cgit v1.2.3 From 36db9a046b5bb3e60968236a0c24c88e4b18fb82 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 9 Sep 2008 15:58:31 +0000 Subject: ulcd and debug stuff removed git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1355 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 83 ------------------------------------------ 1 file changed, 83 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index f7f1fca7..03dc09ed 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -8,7 +8,6 @@ interface {$I switches.inc} - uses UMenu, SDL, @@ -20,8 +19,6 @@ uses UFiles, SysUtils, UThemes, - //ULCD, - //ULight, UGraphicClasses; type @@ -74,9 +71,6 @@ type CRDTS_Stage: TCreditsStages; - myTex: glUint; - mysdlimage,myconvertedsdlimage: PSDL_Surface; - Fadeout: boolean; constructor Create; override; function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override; @@ -122,26 +116,6 @@ const 3366, // 20 Ende Credits Tune 60); // 21 start flare im intro - - sdl32bpprgba: TSDL_Pixelformat=(palette: nil; - BitsPerPixel: 32; - BytesPerPixel: 4; - Rloss: 0; - Gloss: 0; - Bloss: 0; - Aloss: 0; - Rshift: 0; - Gshift: 8; - Bshift: 16; - Ashift: 24; - Rmask: $000000ff; - Gmask: $0000ff00; - Bmask: $00ff0000; - Amask: $ff000000; - colorkey: 0; - alpha: 255 ); - - implementation uses @@ -289,48 +263,6 @@ begin // Music.Play; CTime:=0; // setlength(CTime_hold,0); - - mysdlimage:=IMG_Load('test.png'); - if assigned(mysdlimage) then - begin - showmessage('opened image via SDL_Image'+#13#10+ - 'Width: '+inttostr(mysdlimage^.w)+#13#10+ - 'Height: '+inttostr(mysdlimage^.h)+#13#10+ - 'BitsPP: '+inttostr(mysdlimage^.format.BitsPerPixel)+#13#10+ - 'BytesPP: '+inttostr(mysdlimage^.format.BytesPerPixel)+#13#10+ - 'Rloss: '+inttostr(mysdlimage^.format.Rloss)+#13#10+ - 'Gloss: '+inttostr(mysdlimage^.format.Gloss)+#13#10+ - 'Bloss: '+inttostr(mysdlimage^.format.Bloss)+#13#10+ - 'Aloss: '+inttostr(mysdlimage^.format.Aloss)+#13#10+ - 'Rshift: '+inttostr(mysdlimage^.format.Rshift)+#13#10+ - 'Gshift: '+inttostr(mysdlimage^.format.Gshift)+#13#10+ - 'Bshift: '+inttostr(mysdlimage^.format.Bshift)+#13#10+ - 'Ashift: '+inttostr(mysdlimage^.format.Ashift)+#13#10+ - 'Rmask: '+inttohexstr(mysdlimage^.format.Rmask)+#13#10+ - 'Gmask: '+inttohexstr(mysdlimage^.format.Gmask)+#13#10+ - 'Bmask: '+inttohexstr(mysdlimage^.format.Bmask)+#13#10+ - 'Amask: '+inttohexstr(mysdlimage^.format.Amask)+#13#10+ - 'ColKey: '+inttostr(mysdlimage^.format.Colorkey)+#13#10+ - 'Alpha: '+inttostr(mysdlimage^.format.Alpha)); - - if pixfmt_eq(mysdlimage^.format^,sdl32bpprgba) then - showmessage('equal pixelformats') - else - showmessage('different pixelformats'); - - myconvertedsdlimage:=SDL_ConvertSurface(mysdlimage,@sdl32bpprgba,SDL_SWSURFACE); - glGenTextures(1,@myTex); - glBindTexture(GL_TEXTURE_2D, myTex); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); - glTexImage2D( GL_TEXTURE_2D, 0, 4, myconvertedsdlimage^.w, myconvertedsdlimage^.h, 0, - GL_RGBA, GL_UNSIGNED_BYTE, myconvertedsdlimage^.pixels ); - SDL_FreeSurface(mysdlimage); - SDL_FreeSurface(myconvertedsdlimage); - end - else - showmessage('could not open file - test.png'); - end; procedure TScreenCredits.onHide; @@ -1376,21 +1308,6 @@ Log.LogStatus('',' JB-4'); glPrint (Addr(RuntimeStr[1])); } - - glEnable(GL_TEXTURE_2D); - glEnable(GL_BLEND); - glColor4f(1, 1, 1, 1); - glBindTexture(GL_TEXTURE_2D, myTex); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(100, 100); - glTexCoord2f(0,1);glVertex2f(100, 200); - glTexCoord2f(1,1); glVertex2f(200, 200); - glTexCoord2f(1,0);glVertex2f(200, 100); - glEnd; - glDisable(GL_TEXTURE_2D); - glDisable(GL_BLEND); - - // make the stars shine GoldenRec.Draw; end; -- cgit v1.2.3 From 3b5af758a1ffb8c02c3fad2ef0acbc0c241b3de5 Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 12 Sep 2008 13:19:17 +0000 Subject: removed resource.inc git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1371 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 239 +++++++++++++++++++++++------------------ 1 file changed, 133 insertions(+), 106 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index 03dc09ed..812d1f78 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -34,33 +34,33 @@ type CTime_hold: Cardinal; ESC_Alpha: Integer; - credits_entry_tex: TTexture; - credits_entry_dx_tex: TTexture; - credits_bg_tex: TTexture; - credits_bg_ovl: TTexture; -// credits_bg_logo: TTexture; + credits_entry: TTexture; + credits_entry_dx: TTexture; + credits_bg_tex: TTexture; + credits_bg_ovl: TTexture; + //credits_bg_logo: TTexture; credits_bg_scrollbox_left: TTexture; - credits_blindguard: TTexture; - credits_blindy: TTexture; - credits_canni: TTexture; - credits_commandio: TTexture; - credits_lazyjoker: TTexture; - credits_mog: TTexture; - credits_mota: TTexture; + credits_blindguard: TTexture; + credits_blindy: TTexture; + credits_canni: TTexture; + credits_commandio: TTexture; + credits_lazyjoker: TTexture; + credits_mog: TTexture; + credits_mota: TTexture; credits_skillmaster: TTexture; - credits_whiteshark: TTexture; - intro_layer01: TTexture; - intro_layer02: TTexture; - intro_layer03: TTexture; - intro_layer04: TTexture; - intro_layer05: TTexture; - intro_layer06: TTexture; - intro_layer07: TTexture; - intro_layer08: TTexture; - intro_layer09: TTexture; - outro_bg: TTexture; - outro_esc: TTexture; - outro_exd: TTexture; + credits_whiteshark: TTexture; + intro_layer01: TTexture; + intro_layer02: TTexture; + intro_layer03: TTexture; + intro_layer04: TTexture; + intro_layer05: TTexture; + intro_layer06: TTexture; + intro_layer07: TTexture; + intro_layer08: TTexture; + intro_layer09: TTexture; + outro_bg: TTexture; + outro_esc: TTexture; + outro_exd: TTexture; deluxe_slidein: cardinal; @@ -82,12 +82,35 @@ type end; const - Funky_Text: AnsiString = + Funky_Text: string = 'Grandma Deluxe has arrived! Thanks to Corvus5 for the massive work on UltraStar, Wome for the nice tune you´re hearing, '+ 'all the people who put massive effort and work in new songs (don´t forget UltraStar w/o songs would be nothing), ppl from '+ 'irc helping us - eBandit and Gabari, scene ppl who really helped instead of compiling and running away. Greetings to DennisTheMenace for betatesting, '+ 'Demoscene.tv, pouet.net, KakiArts, Sourceforge,..'; + CRDTS_BG_FILE = 'credits_v5_bg.png'; + CRDTS_OVL_FILE = 'credits_v5_overlay.png'; + CRDTS_blindguard_FILE = 'names_blindguard.png'; + CRDTS_blindy_FILE = 'names_blindy.png'; + CRDTS_canni_FILE = 'names_canni.png'; + CRDTS_commandio_FILE = 'names_commandio.png'; + CRDTS_lazyjoker_FILE = 'names_lazyjoker.png'; + CRDTS_mog_FILE = 'names_mog.png'; + CRDTS_mota_FILE = 'names_mota.png'; + CRDTS_skillmaster_FILE = 'names_skillmaster.png'; + CRDTS_whiteshark_FILE = 'names_whiteshark.png'; + INTRO_L01_FILE = 'intro-l-01.png'; + INTRO_L02_FILE = 'intro-l-02.png'; + INTRO_L03_FILE = 'intro-l-03.png'; + INTRO_L04_FILE = 'intro-l-04.png'; + INTRO_L05_FILE = 'intro-l-05.png'; + INTRO_L06_FILE = 'intro-l-06.png'; + INTRO_L07_FILE = 'intro-l-07.png'; + INTRO_L08_FILE = 'intro-l-08.png'; + INTRO_L09_FILE = 'intro-l-09.png'; + OUTRO_BG_FILE = 'outro-bg.png'; + OUTRO_ESC_FILE = 'outro-esc.png'; + OUTRO_EXD_FILE = 'outro-exit-dark.png'; Timings: array[0..21] of Cardinal=( 20, // 0 Delay vor Start @@ -143,46 +166,51 @@ begin FadeTo(@ScreenMain); AudioPlayback.PlaySound(SoundLib.Back); end; -{ SDLK_SPACE: + { + SDLK_SPACE: begin setlength(CTime_hold,length(CTime_hold)+1); CTime_hold[high(CTime_hold)]:=CTime; end; -} + } end;//esac end; //fi end; constructor TScreenCredits.Create; +var + CreditsPath: string; begin inherited Create; - credits_bg_tex := Texture.LoadTexture(true, 'CRDTS_BG', TEXTURE_TYPE_PLAIN, 0); - credits_bg_ovl := Texture.LoadTexture(true, 'CRDTS_OVL', TEXTURE_TYPE_TRANSPARENT, 0); - - credits_blindguard := Texture.LoadTexture(true, 'CRDTS_blindguard', TEXTURE_TYPE_TRANSPARENT, 0); - credits_blindy := Texture.LoadTexture(true, 'CRDTS_blindy', TEXTURE_TYPE_TRANSPARENT, 0); - credits_canni := Texture.LoadTexture(true, 'CRDTS_canni', TEXTURE_TYPE_TRANSPARENT, 0); - credits_commandio := Texture.LoadTexture(true, 'CRDTS_commandio', TEXTURE_TYPE_TRANSPARENT, 0); - credits_lazyjoker := Texture.LoadTexture(true, 'CRDTS_lazyjoker', TEXTURE_TYPE_TRANSPARENT, 0); - credits_mog := Texture.LoadTexture(true, 'CRDTS_mog', TEXTURE_TYPE_TRANSPARENT, 0); - credits_mota := Texture.LoadTexture(true, 'CRDTS_mota', TEXTURE_TYPE_TRANSPARENT, 0); - credits_skillmaster := Texture.LoadTexture(true, 'CRDTS_skillmaster', TEXTURE_TYPE_TRANSPARENT, 0); - credits_whiteshark := Texture.LoadTexture(true, 'CRDTS_whiteshark', TEXTURE_TYPE_TRANSPARENT, 0); - - intro_layer01 := Texture.LoadTexture(true, 'INTRO_L01', TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer02 := Texture.LoadTexture(true, 'INTRO_L02', TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer03 := Texture.LoadTexture(true, 'INTRO_L03', TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer04 := Texture.LoadTexture(true, 'INTRO_L04', TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer05 := Texture.LoadTexture(true, 'INTRO_L05', TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer06 := Texture.LoadTexture(true, 'INTRO_L06', TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer07 := Texture.LoadTexture(true, 'INTRO_L07', TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer08 := Texture.LoadTexture(true, 'INTRO_L08', TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer09 := Texture.LoadTexture(true, 'INTRO_L09', TEXTURE_TYPE_TRANSPARENT, 0); - - outro_bg := Texture.LoadTexture(true, 'OUTRO_BG', TEXTURE_TYPE_PLAIN, 0); - outro_esc := Texture.LoadTexture(true, 'OUTRO_ESC', TEXTURE_TYPE_TRANSPARENT, 0); - outro_exd := Texture.LoadTexture(true, 'OUTRO_EXD', TEXTURE_TYPE_TRANSPARENT, 0); + CreditsPath := ResourcesPath + 'credits/'; + + credits_bg_tex := Texture.LoadTexture(CreditsPath + CRDTS_BG_FILE, TEXTURE_TYPE_PLAIN, 0); + credits_bg_ovl := Texture.LoadTexture(CreditsPath + CRDTS_OVL_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + + credits_blindguard := Texture.LoadTexture(CreditsPath + CRDTS_blindguard_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + credits_blindy := Texture.LoadTexture(CreditsPath + CRDTS_blindy_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + credits_canni := Texture.LoadTexture(CreditsPath + CRDTS_canni_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + credits_commandio := Texture.LoadTexture(CreditsPath + CRDTS_commandio_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + credits_lazyjoker := Texture.LoadTexture(CreditsPath + CRDTS_lazyjoker_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + credits_mog := Texture.LoadTexture(CreditsPath + CRDTS_mog_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + credits_mota := Texture.LoadTexture(CreditsPath + CRDTS_mota_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + credits_skillmaster := Texture.LoadTexture(CreditsPath + CRDTS_skillmaster_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + credits_whiteshark := Texture.LoadTexture(CreditsPath + CRDTS_whiteshark_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + + intro_layer01 := Texture.LoadTexture(CreditsPath + INTRO_L01_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer02 := Texture.LoadTexture(CreditsPath + INTRO_L02_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer03 := Texture.LoadTexture(CreditsPath + INTRO_L03_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer04 := Texture.LoadTexture(CreditsPath + INTRO_L04_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer05 := Texture.LoadTexture(CreditsPath + INTRO_L05_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer06 := Texture.LoadTexture(CreditsPath + INTRO_L06_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer07 := Texture.LoadTexture(CreditsPath + INTRO_L07_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer08 := Texture.LoadTexture(CreditsPath + INTRO_L08_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer09 := Texture.LoadTexture(CreditsPath + INTRO_L09_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + + outro_bg := Texture.LoadTexture(CreditsPath + OUTRO_BG_FILE, TEXTURE_TYPE_PLAIN, 0); + outro_esc := Texture.LoadTexture(CreditsPath + OUTRO_ESC_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + outro_exd := Texture.LoadTexture(CreditsPath + OUTRO_EXD_FILE, TEXTURE_TYPE_TRANSPARENT, 0); CRDTS_Stage:=InitialDelay; end; @@ -258,11 +286,11 @@ begin Credits_X := 580; deluxe_slidein := 0; Credits_Alpha := 0; - //Music.SetLoop(true); Loop looped ned, so ne scheisse - loop loops not, shit - AudioPlayback.Open(soundpath + 'wome-credits-tune.mp3'); //danke kleinster liebster weeeetüüüüü!! - thank you wetü -// Music.Play; + //Music.SetLoop(true); loop loops not, shit + AudioPlayback.Open(soundpath + 'wome-credits-tune.mp3'); // thank you wetue + //Music.Play; CTime:=0; -// setlength(CTime_hold,0); + //setlength(CTime_hold,0); end; procedure TScreenCredits.onHide; @@ -310,7 +338,7 @@ begin inc(CurrentScrollEnd); end; end; -{ // timing hack + { // timing hack X:=5; SetFontStyle (2); SetFontItalic(False); @@ -321,7 +349,8 @@ begin SetFontPos (500, X); glPrint (Addr(visibleText[0])); X:=X+20; - end;} + end; + } end; procedure Start3D; @@ -342,30 +371,24 @@ end; procedure TScreenCredits.DrawCredits; var -T{*, I*}: Cardinal; // Auto Removed, Unused Variable (I) // Auto Removed, Unused Variable (I) -// X: Real; // Auto Removed, Unused Variable -// Ver: PChar; // Auto Removed, Unused Variable -// RuntimeStr: AnsiString; // Auto Removed, Unused Variable + T: Cardinal; Data: TFFTData; j,k,l:cardinal; -f,g{*, h*}: Real; // Auto Removed, Unused Variable (h) // Auto Removed, Unused Variable (h) + f,g: Real; STime:cardinal; Delay:cardinal; - -// myPixel: longword; // Auto Removed, Unused Variable -// myColor: Cardinal; // Auto Removed, Unused Variable myScale: Real; myAngle: Real; - - -const myLogoCoords: Array[0..27,0..1] of Cardinal = ((39,32),(84,32),(100,16),(125,24), - (154,31),(156,58),(168,32),(203,36), - (258,34),(251,50),(274,93),(294,84), - (232,54),(278,62),(319,34),(336,92), - (347,23),(374,32),(377,58),(361,83), - (385,91),(405,91),(429,35),(423,51), - (450,32),(485,34),(444,91),(486,93)); - +const + myLogoCoords: Array[0..27,0..1] of Cardinal = ( + (39,32),(84,32),(100,16),(125,24), + (154,31),(156,58),(168,32),(203,36), + (258,34),(251,50),(274,93),(294,84), + (232,54),(278,62),(319,34),(336,92), + (347,23),(374,32),(377,58),(361,83), + (385,91),(405,91),(429,35),(423,51), + (450,32),(485,34),(444,91),(486,93) + ); begin //dis does teh muiwk y0r AudioPlayback.GetFFTData(Data); @@ -383,13 +406,11 @@ begin Log.LogStatus('',' JB-2'); if (CRDTS_Stage=InitialDelay) and (CTime=Timings[0]) then begin -// CTime:=Timings[20]; -// CRDTS_Stage:=Outro; - + //CTime:=Timings[20]; + //CRDTS_Stage:=Outro; CRDTS_Stage:=Intro; CTime:=0; AudioPlayback.Play; - end; if (CRDTS_Stage=Intro) and (CTime=Timings[7]) then begin @@ -433,17 +454,17 @@ begin myScale:= 0.5+0.5*(CTime-Timings[2])/(Timings[3]-Timings[2]); // get some space between layers myAngle:=0; end; -// if CTime > Timings[3] then myScale:=1; // keep the space between layers + //if CTime > Timings[3] then myScale:=1; // keep the space between layers glTranslatef(0,0,-5+0.5*myScale); if CTime > Timings[3] then myScale:=1; // keep the space between layers if CTime > Timings[3] then begin // make logo rotate left and grow -// myScale:=(CTime-Timings[4])/(Timings[7]-Timings[4]); + //myScale:=(CTime-Timings[4])/(Timings[7]-Timings[4]); glRotatef(20*sqr(CTime-Timings[3])/sqr((Timings[7]-Timings[3])/2),0,0,1); glScalef(1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1); end; if CTime < Timings[2] then glRotatef(30*myAngle,0.5*myScale+myScale,1+myScale,0); -// glScalef(0.5,0.5,0.5); + //glScalef(0.5,0.5,0.5); glScalef(4/3,-1,1); glColor4f(1, 1, 1, 1); @@ -563,13 +584,13 @@ begin // draw scroller Draw_FunkyText; -//######################################################################### -// draw credits names + //######################################################################### + // draw credits names -Log.LogStatus('',' JB-4'); + Log.LogStatus('',' JB-4'); -// BlindGuard (von links oben reindrehen, nach rechts unten rausdrehen) - (rotate in from upper left, rotate out to lower right) + // BlindGuard (rotate in from upper left, rotate out to lower right) STime:=Timings[9]-10; Delay:=Timings[10]-Timings[9]; if CTime > STime then @@ -633,7 +654,7 @@ Log.LogStatus('',' JB-4'); glPopMatrix; end; -// Blindy (zoom von 0 auf volle grösse und drehung, zoom auf doppelte grösse und nach rechts oben schieben) - (zoom from 0 to full size and rotation, zoom zo doubble size and shift to upper right) + // Blindy (zoom from 0 to full size and rotation, zoom zo doubble size and shift to upper right) STime:=Timings[10]-10; Delay:=Timings[11]-Timings[10]+5; if CTime > STime then @@ -703,7 +724,7 @@ Log.LogStatus('',' JB-4'); glPopMatrix; end; -// Canni (von links reinschieben, nach rechts oben rausschieben) - (shift in from left, shift out to upper right) + // Canni (shift in from left, shift out to upper right) STime:=Timings[11]-10; Delay:=Timings[12]-Timings[11]+5; if CTime > STime then @@ -768,7 +789,7 @@ Log.LogStatus('',' JB-4'); glPopMatrix; end; -// Commandio (von unten reinklappen, nach rechts oben rausklappen) - (flip in from down, flip out to upper right) + // Commandio (flip in from down, flip out to upper right) STime:=Timings[12]-10; Delay:=Timings[13]-Timings[12]; if CTime > STime then @@ -835,7 +856,7 @@ Log.LogStatus('',' JB-4'); glPopMatrix; end; -// lazy joker (just scrolls from left to right, no twinkling stars, no on-beat flashing) + // lazy joker (just scrolls from left to right, no twinkling stars, no on-beat flashing) STime:=Timings[13]-35; Delay:=Timings[14]-Timings[13]+5; if CTime > STime then @@ -882,7 +903,7 @@ Log.LogStatus('',' JB-4'); glPopMatrix; end; -// Mog (von links reinklappen, nach rechts unten rausklappen) - (flip in from right, flip out to lower right) + // Mog (flip in from right, flip out to lower right) STime:=Timings[14]-10; Delay:=Timings[15]-Timings[14]+5; if CTime > STime then @@ -951,7 +972,7 @@ Log.LogStatus('',' JB-4'); glPopMatrix; end; -// Mota (von rechts oben reindrehen, nach links unten rausschieben und verkleinern und dabei drehen) - (rotate in from upper right, shift out to lower left while shrinking and rotateing) + // Mota (rotate in from upper right, shift out to lower left while shrinking and rotateing) STime:=Timings[15]-10; Delay:=Timings[16]-Timings[15]+5; if CTime > STime then @@ -1021,7 +1042,7 @@ Log.LogStatus('',' JB-4'); glPopMatrix; end; -// Skillmaster (von rechts unten reinschieben, nach rechts oben rausdrehen) - (shift in from lower right, rotate out to upper right) + // Skillmaster (shift in from lower right, rotate out to upper right) STime:=Timings[16]-10; Delay:=Timings[17]-Timings[16]+5; if CTime > STime then @@ -1091,7 +1112,7 @@ Log.LogStatus('',' JB-4'); glPopMatrix; end; -// WhiteShark (von links unten reinklappen, nach rechts oben rausklappen) - (flip in from lower left, flip out to upper right) + // WhiteShark (flip in from lower left, flip out to upper right) STime:=Timings[17]-10; Delay:=Timings[18]-Timings[17]; if CTime > STime then @@ -1167,8 +1188,9 @@ Log.LogStatus('',' JB-4'); Log.LogStatus('',' JB-103'); -// #################################################################### -// do some twinkle stuff (kinda on beat) + // #################################################################### + // do some twinkle stuff (kinda on beat) + if (CTime > Timings[8] ) and (CTime < Timings[19] ) then begin @@ -1196,8 +1218,9 @@ Log.LogStatus('',' JB-4'); end; end; -//################################################# -// draw the rest of the main screen (girl and logo + //################################################# + // draw the rest of the main screen (girl and logo + glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); @@ -1209,14 +1232,17 @@ Log.LogStatus('',' JB-4'); glTexCoord2f(393/512,600/1024); glVertex2f(800, 600); glTexCoord2f(393/512,0);glVertex2f(800, 0); glEnd; -{ glBindTexture(GL_TEXTURE_2D, credits_bg_logo.TexNum); + + { + glBindTexture(GL_TEXTURE_2D, credits_bg_logo.TexNum); glbegin(gl_quads); glTexCoord2f(0,0);glVertex2f(0, 0); glTexCoord2f(0,112/128);glVertex2f(0, 112); glTexCoord2f(497/512,112/128); glVertex2f(497, 112); glTexCoord2f(497/512,0);glVertex2f(497, 0); glEnd; -} + } + gldisable(gl_texture_2d); glDisable(GL_BLEND); @@ -1297,16 +1323,17 @@ Log.LogStatus('',' JB-4'); // ... end; -{ // draw credits runtime counter + { + // draw credits runtime counter SetFontStyle (2); SetFontItalic(False); SetFontSize(9); SetFontPos (5, 5); glColor4f(1, 1, 1, 1); -// RuntimeStr:='CTime: '+inttostr(floor(CTime/30.320663991914489602156136106092))+'.'+inttostr(floor(CTime/3.0320663991914489602156136106092)-floor(CTime/30.320663991914489602156136106092)*10); + //RuntimeStr:='CTime: '+inttostr(floor(CTime/30.320663991914489602156136106092))+'.'+inttostr(floor(CTime/3.0320663991914489602156136106092)-floor(CTime/30.320663991914489602156136106092)*10); RuntimeStr:='CTime: '+inttostr(CTime); glPrint (Addr(RuntimeStr[1])); -} + } // make the stars shine GoldenRec.Draw; -- cgit v1.2.3 From f16756422a5dbb24ce1b751bb9e2bb1de4f19713 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 23 Sep 2008 21:17:50 +0000 Subject: added file headers git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1404 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index 812d1f78..197fb076 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -1,3 +1,28 @@ +{* UltraStar Deluxe - Karaoke Game + * + * UltraStar Deluxe is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + *} + unit UScreenCredits; interface -- cgit v1.2.3 From 2f768387f3849699320229a5b756db78af1207a2 Mon Sep 17 00:00:00 2001 From: tobigun Date: Sun, 19 Oct 2008 16:24:59 +0000 Subject: The size given to TextGL.SetSize() now expresses the size in pixel (formerly it was 1/3 of the pixel-size). For theme and plugin compatibility the following functions multiply the size with 3: - UScreenSingModi.Print - TTheme.ThemeLoadText - TTheme.ThemeLoadSelectSlide TODO: Convert the themes/plugins and remove the "*3" git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1459 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index 197fb076..fca65359 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -329,7 +329,7 @@ var X,Y,A: Real; visibleText: PChar; begin - SetFontSize(10); + SetFontSize(30); //Init ScrollingText if (CTime = Timings[7]) then begin @@ -367,7 +367,7 @@ begin X:=5; SetFontStyle (2); SetFontItalic(False); - SetFontSize(9); + SetFontSize(27); glColor4f(1, 1, 1, 1); for S:=0 to high(CTime_hold) do begin visibleText:=pchar(inttostr(CTime_hold[S])); @@ -1352,7 +1352,7 @@ begin // draw credits runtime counter SetFontStyle (2); SetFontItalic(False); - SetFontSize(9); + SetFontSize(27); SetFontPos (5, 5); glColor4f(1, 1, 1, 1); //RuntimeStr:='CTime: '+inttostr(floor(CTime/30.320663991914489602156136106092))+'.'+inttostr(floor(CTime/3.0320663991914489602156136106092)-floor(CTime/30.320663991914489602156136106092)*10); -- cgit v1.2.3 From e8a388e32a4563ac9ea0895ca6c7cdf83cf9d3ec Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 28 Oct 2008 18:57:02 +0000 Subject: - glPrint(Pchar) -> glPrint(string) - glPrintLetter removed - font engine handles FT_PIXEL_MODE_MONO as FT_Glyph_To_Bitmap(FT_RENDER_MODE_NORMAL) might return a 1bit/pixel black/white image instead of 8bit/pixel gray shaded one (happened with 16px japanese glyphs of simsun.ttf, latin ones were correct). git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1482 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 63 +++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 23 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index fca65359..7e85c5d4 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -327,39 +327,56 @@ Procedure TScreenCredits.Draw_FunkyText; var S: Integer; X,Y,A: Real; - visibleText: PChar; + visibleText: string; begin SetFontSize(30); + //Init ScrollingText if (CTime = Timings[7]) then begin //Set Position of Text Credits_X := 600; - CurrentScrollStart:=1; - CurrentScrollEnd:=1; + CurrentScrollStart := 1; + CurrentScrollEnd := 1; end; - if (CTime > Timings[7]) and (CurrentScrollStart < length(Funky_Text)) then + if (CTime > Timings[7]) and + (CurrentScrollStart < length(Funky_Text)) then begin - X:=0; - visibleText:=pchar(Copy(Funky_Text, CurrentScrollStart, CurrentScrollEnd)); - for S := 0 to length(visibleText)-1 do begin - Y:=abs(sin((Credits_X+X)*0.93{*(((Credits_X+X))/1200)}/100*pi)); - SetFontPos(Credits_X+X,538-Y*(Credits_X+X)*(Credits_X+X)*(Credits_X+X)/1000000); - A:=0; - if (Credits_X+X < 15) then A:=0; - if (Credits_X+X >=15) then A:=Credits_X+X-15; - if Credits_X+X > 32 then A:=17; - glColor4f( 230/255-40/255+Y*(Credits_X+X)/900, 200/255-30/255+Y*(Credits_X+X)/1000, 155/255-20/255+Y*(Credits_X+X)/1100, A/17); - glPrintLetter(visibleText[S]); - X := X + Fonts[ActFont].Width[Ord(visibleText[S])] * Fonts[ActFont].Tex.H / 30 * Fonts[ActFont].AspectW; + X := 0; + visibleText := Copy(Funky_Text, CurrentScrollStart, CurrentScrollEnd); + + for S := 1 to length(visibleText) do + begin + Y := abs(sin((Credits_X+X)*0.93{*(((Credits_X+X))/1200)}/100*pi)); + SetFontPos(Credits_X+X, 538-Y*(Credits_X+X)*(Credits_X+X)*(Credits_X+X)/1000000); + + if (Credits_X + X > 32) then + A := 17 + else if (Credits_X + X >= 15) then + A := Credits_X + X - 15 + else + A := 0; + + glColor4f(230/255-40/255+Y*(Credits_X+X)/900, + 200/255-30/255+Y*(Credits_X+X)/1000, + 155/255-20/255+Y*(Credits_X+X)/1100, + A/17); + glPrint(visibleText[S]); + X := X + glTextWidth(visibleText[S]); end; - if (Credits_X<0) and (CurrentScrollStart < length(Funky_Text)) then begin - Credits_X:=Credits_X + Fonts[ActFont].Width[Ord(Funky_Text[CurrentScrollStart])] * Fonts[ActFont].Tex.H / 30 * Fonts[ActFont].AspectW; + + if (Credits_X < 0) and (CurrentScrollStart < length(Funky_Text)) then + begin + Credits_X := Credits_X + glTextWidth(Funky_Text[CurrentScrollStart]); inc(CurrentScrollStart); end; - visibleText:=pchar(Copy(Funky_Text, CurrentScrollStart, CurrentScrollEnd)); - if (Credits_X+glTextWidth(visibleText) < 600) and (CurrentScrollEnd < length(Funky_Text)) then begin + + visibleText := Copy(Funky_Text, CurrentScrollStart, CurrentScrollEnd); + + if (Credits_X + glTextWidth(visibleText) < 600) and + (CurrentScrollEnd < length(Funky_Text)) then + begin inc(CurrentScrollEnd); end; end; @@ -370,9 +387,9 @@ begin SetFontSize(27); glColor4f(1, 1, 1, 1); for S:=0 to high(CTime_hold) do begin - visibleText:=pchar(inttostr(CTime_hold[S])); + visibleText:=inttostr(CTime_hold[S]); SetFontPos (500, X); - glPrint (Addr(visibleText[0])); + glPrint (visibleText[0]); X:=X+20; end; } @@ -1357,7 +1374,7 @@ begin glColor4f(1, 1, 1, 1); //RuntimeStr:='CTime: '+inttostr(floor(CTime/30.320663991914489602156136106092))+'.'+inttostr(floor(CTime/3.0320663991914489602156136106092)-floor(CTime/30.320663991914489602156136106092)*10); RuntimeStr:='CTime: '+inttostr(CTime); - glPrint (Addr(RuntimeStr[1])); + glPrint (RuntimeStr[1]); } // make the stars shine -- cgit v1.2.3 From c6b630485c605900405e15fac7ff0f75a780815a Mon Sep 17 00:00:00 2001 From: tobigun Date: Mon, 12 Jan 2009 17:04:44 +0000 Subject: removed unused functions git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1567 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 57 ------------------------------------------ 1 file changed, 57 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index 7e85c5d4..6d410a97 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -246,63 +246,6 @@ begin Draw:=true; end; -function pixfmt_eq(fmt1,fmt2: TSDL_Pixelformat): boolean; -begin - if (fmt1.BitsPerPixel = fmt2.BitsPerPixel) and - (fmt1.BytesPerPixel = fmt2.BytesPerPixel) and - (fmt1.Rloss = fmt2.Rloss) and - (fmt1.Gloss = fmt2.Gloss) and - (fmt1.Bloss = fmt2.Bloss) and - (fmt1.Rmask = fmt2.Rmask) and - (fmt1.Gmask = fmt2.Gmask) and - (fmt1.Bmask = fmt2.Bmask) and - (fmt1.Rshift = fmt2.Rshift) and - (fmt1.Gshift = fmt2.Gshift) and - (fmt1.Bshift = fmt2.Bshift) - then - pixfmt_eq:=True - else - pixfmt_eq:=False; -end; - -function inttohexstr(i: cardinal):pchar; -var helper, i2, c:cardinal; - tmpstr: string; -begin - helper:=0; - i2:=i; - tmpstr:=''; - for c:=1 to 8 do - begin - helper:=(helper shl 4) or (i2 and $f); - i2:=i2 shr 4; - end; - for c:=1 to 8 do - begin - i2:=helper and $f; - helper := helper shr 4; - case i2 of - 0: tmpstr:=tmpstr+'0'; - 1: tmpstr:=tmpstr+'1'; - 2: tmpstr:=tmpstr+'2'; - 3: tmpstr:=tmpstr+'3'; - 4: tmpstr:=tmpstr+'4'; - 5: tmpstr:=tmpstr+'5'; - 6: tmpstr:=tmpstr+'6'; - 7: tmpstr:=tmpstr+'7'; - 8: tmpstr:=tmpstr+'8'; - 9: tmpstr:=tmpstr+'9'; - 10: tmpstr:=tmpstr+'a'; - 11: tmpstr:=tmpstr+'b'; - 12: tmpstr:=tmpstr+'c'; - 13: tmpstr:=tmpstr+'d'; - 14: tmpstr:=tmpstr+'e'; - 15: tmpstr:=tmpstr+'f'; - end; - end; - inttohexstr:=pchar(tmpstr); -end; - procedure TScreenCredits.onShow; begin inherited; -- cgit v1.2.3 From 458111738476004a914af6fd3e117eb84a35ab6a Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 7 Mar 2009 01:06:07 +0000 Subject: unclutter UMain.pas. Create UPath.pas. Tests on all platformssvn statussvn status git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1625 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index 6d410a97..6e5c5ba7 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -34,6 +34,7 @@ interface {$I switches.inc} uses + SysUtils, UMenu, SDL, SDL_Image, @@ -42,7 +43,6 @@ uses gl, UMusic, UFiles, - SysUtils, UThemes, UGraphicClasses; @@ -167,16 +167,16 @@ const implementation uses - ULog, - UGraphic, - UMain, - UIni, - USongs, - Textgl, - ULanguage, - UCommon, - Math; - + Math, + ULog, + UGraphic, + UMain, + UIni, + USongs, + Textgl, + ULanguage, + UCommon, + UPath; function TScreenCredits.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; begin -- cgit v1.2.3 From c7f5d683c1eae49e30ee42a76557661f57311b9e Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 25 Apr 2009 10:09:59 +0000 Subject: Cosmetics. No code change git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1694 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 942 +++++++++++++++++++++++------------------ 1 file changed, 538 insertions(+), 404 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index 6e5c5ba7..2982fe24 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -34,17 +34,17 @@ interface {$I switches.inc} uses - SysUtils, - UMenu, - SDL, - SDL_Image, - UDisplay, - UTexture, - gl, - UMusic, - UFiles, - UThemes, - UGraphicClasses; + SysUtils, + UMenu, + SDL, + SDL_Image, + UDisplay, + UTexture, + gl, + UMusic, + UFiles, + UThemes, + UGraphicClasses; type TCreditsStages=(InitialDelay,Intro,MainPart,Outro); @@ -52,12 +52,12 @@ type TScreenCredits = class(TMenu) public - Credits_X: Real; - Credits_Time: Cardinal; - Credits_Alpha: Cardinal; - CTime: Cardinal; - CTime_hold: Cardinal; - ESC_Alpha: Integer; + Credits_X: real; + Credits_Time: cardinal; + Credits_Alpha: cardinal; + CTime: cardinal; + CTime_hold: cardinal; + ESC_Alpha: integer; credits_entry: TTexture; credits_entry_dx: TTexture; @@ -89,16 +89,16 @@ type deluxe_slidein: cardinal; - CurrentScrollText: String; - NextScrollUpdate: Real; - EndofLastScrollingPart: Cardinal; - CurrentScrollStart, CurrentScrollEnd: Integer; + CurrentScrollText: string; + NextScrollUpdate: real; + EndofLastScrollingPart: cardinal; + CurrentScrollStart, CurrentScrollEnd: integer; CRDTS_Stage: TCreditsStages; Fadeout: boolean; constructor Create; override; - function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override; + function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override; function Draw: boolean; override; procedure onShow; override; procedure onHide; override; @@ -113,7 +113,7 @@ const 'irc helping us - eBandit and Gabari, scene ppl who really helped instead of compiling and running away. Greetings to DennisTheMenace for betatesting, '+ 'Demoscene.tv, pouet.net, KakiArts, Sourceforge,..'; - CRDTS_BG_FILE = 'credits_v5_bg.png'; + CRDTS_BG_FILE = 'credits_v5_bg.png'; CRDTS_OVL_FILE = 'credits_v5_overlay.png'; CRDTS_blindguard_FILE = 'names_blindguard.png'; CRDTS_blindy_FILE = 'names_blindy.png'; @@ -137,7 +137,7 @@ const OUTRO_ESC_FILE = 'outro-esc.png'; OUTRO_EXD_FILE = 'outro-exit-dark.png'; - Timings: array[0..21] of Cardinal=( + Timings: array[0..21] of cardinal=( 20, // 0 Delay vor Start 149, // 1 Ende erster Intro Zoom @@ -178,10 +178,10 @@ uses UCommon, UPath; -function TScreenCredits.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; +function TScreenCredits.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; begin Result := true; - If (PressedDown) Then + if (PressedDown) then begin // Key Down case PressedKey of @@ -243,14 +243,14 @@ end; function TScreenCredits.Draw: boolean; begin DrawCredits; - Draw:=true; + Draw := true; end; procedure TScreenCredits.onShow; begin inherited; - CRDTS_Stage:=InitialDelay; + CRDTS_Stage := InitialDelay; Credits_X := 580; deluxe_slidein := 0; Credits_Alpha := 0; @@ -268,8 +268,8 @@ end; Procedure TScreenCredits.Draw_FunkyText; var - S: Integer; - X,Y,A: Real; + S: integer; + X,Y,A: real; visibleText: string; begin SetFontSize(30); @@ -326,46 +326,47 @@ begin { // timing hack X:=5; SetFontStyle (2); - SetFontItalic(False); + SetFontItalic(false); SetFontSize(27); glColor4f(1, 1, 1, 1); - for S:=0 to high(CTime_hold) do begin - visibleText:=inttostr(CTime_hold[S]); - SetFontPos (500, X); - glPrint (visibleText[0]); - X:=X+20; + for S:=0 to high(CTime_hold) do + begin + visibleText := inttostr(CTime_hold[S]); + SetFontPos (500, X); + glPrint(visibleText[0]); + X := X + 20; end; } end; procedure Start3D; begin - glMatrixMode(GL_PROJECTION); - glPushMatrix; - glLoadIdentity; - glFrustum(-0.3*4/3,0.3*4/3,-0.3,0.3,1,1000); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity; + glMatrixMode(GL_PROJECTION); + glPushMatrix; + glLoadIdentity; + glFrustum(-0.3*4/3,0.3*4/3,-0.3,0.3,1,1000); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity; end; procedure End3D; begin - glMatrixMode(GL_PROJECTION); - glPopMatrix; - glMatrixMode(GL_MODELVIEW); + glMatrixMode(GL_PROJECTION); + glPopMatrix; + glMatrixMode(GL_MODELVIEW); end; procedure TScreenCredits.DrawCredits; var - T: Cardinal; - Data: TFFTData; - j,k,l:cardinal; - f,g: Real; - STime:cardinal; - Delay:cardinal; - myScale: Real; - myAngle: Real; + T: cardinal; + Data: TFFTData; + j, k, l: cardinal; + f, g: real; + STime: cardinal; + Delay: cardinal; + myScale: real; + myAngle: real; const - myLogoCoords: Array[0..27,0..1] of Cardinal = ( + myLogoCoords: array[0..27,0..1] of cardinal = ( (39,32),(84,32),(100,16),(125,24), (154,31),(156,58),(168,32),(203,36), (258,34),(251,50),(274,93),(294,84), @@ -389,19 +390,19 @@ begin Credits_X := Credits_X-2; Log.LogStatus('',' JB-2'); - if (CRDTS_Stage=InitialDelay) and (CTime=Timings[0]) then + if (CRDTS_Stage=InitialDelay) and (CTime = Timings[0]) then begin - //CTime:=Timings[20]; - //CRDTS_Stage:=Outro; - CRDTS_Stage:=Intro; - CTime:=0; + //CTime := Timings[20]; + //CRDTS_Stage := Outro; + CRDTS_Stage := Intro; + CTime := 0; AudioPlayback.Play; end; - if (CRDTS_Stage=Intro) and (CTime=Timings[7]) then + if (CRDTS_Stage = Intro) and (CTime = Timings[7]) then begin - CRDTS_Stage:=MainPart; + CRDTS_Stage := MainPart; end; - if (CRDTS_Stage=MainPart) and (CTime=Timings[20]) then + if (CRDTS_Stage = MainPart) and (CTime = Timings[20]) then begin CRDTS_Stage:=Outro; end; @@ -410,143 +411,150 @@ begin Log.LogStatus('',' JB-3'); //draw background - if CRDTS_Stage=InitialDelay then - begin - glClearColor(0,0,0,0); - glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); - end + if CRDTS_Stage = InitialDelay then + begin + glClearColor(0,0,0,0); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); + end else - if CRDTS_Stage=Intro then - begin - Start3D; - glPushMatrix; + if CRDTS_Stage = Intro then + begin + Start3D; + glPushMatrix; - glClearColor(0,0,0,0); - glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); + glClearColor(0,0,0,0); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); - glEnable(GL_TEXTURE_2D); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - if CTime < Timings[1] then begin - myScale:= 0.5+0.5*(Timings[1]-CTime)/(Timings[1]); // slowly move layers together - myAngle:=cos((CTime)*pi/((Timings[1])*2)); // and make logo face towards camera - end else begin // this is the part when the logo stands still - myScale:=0.5; - myAngle:=0; - end; - if CTime > Timings[2] then begin - myScale:= 0.5+0.5*(CTime-Timings[2])/(Timings[3]-Timings[2]); // get some space between layers - myAngle:=0; - end; - //if CTime > Timings[3] then myScale:=1; // keep the space between layers - glTranslatef(0,0,-5+0.5*myScale); - if CTime > Timings[3] then myScale:=1; // keep the space between layers - if CTime > Timings[3] then begin // make logo rotate left and grow - //myScale:=(CTime-Timings[4])/(Timings[7]-Timings[4]); - glRotatef(20*sqr(CTime-Timings[3])/sqr((Timings[7]-Timings[3])/2),0,0,1); - glScalef(1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1); - end; - if CTime < Timings[2] then - glRotatef(30*myAngle,0.5*myScale+myScale,1+myScale,0); - //glScalef(0.5,0.5,0.5); - glScalef(4/3,-1,1); - glColor4f(1, 1, 1, 1); + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); - glBindTexture(GL_TEXTURE_2D, intro_layer01.TexNum); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, -0.4 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, -0.4 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, -0.4 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, -0.4 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer02.TexNum); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, -0.3 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, -0.3 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, -0.3 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, -0.3 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer03.TexNum); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, -0.2 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, -0.2 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, -0.2 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, -0.2 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer04.TexNum); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, -0.1 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, -0.1 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, -0.1 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, -0.1 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer05.TexNum); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer06.TexNum); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0.1 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0.1 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0.1 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0.1 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer07.TexNum); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0.2 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0.2 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0.2 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0.2 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer08.TexNum); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0.3 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0.3 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0.3 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0.3 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer09.TexNum); - glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0.22 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0.22 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0.22 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0.22 * myScale); - glEnd; - gldisable(gl_texture_2d); - glDisable(GL_BLEND); - - glPopMatrix; - End3D; + if CTime < Timings[1] then + begin + myScale := 0.5+0.5*(Timings[1]-CTime)/(Timings[1]); // slowly move layers together + myAngle := cos((CTime)*pi/((Timings[1])*2)); // and make logo face towards camera + end + else + begin // this is the part when the logo stands still + myScale := 0.5; + myAngle := 0; + end; + if CTime > Timings[2] then + begin + myScale:= 0.5+0.5*(CTime-Timings[2])/(Timings[3]-Timings[2]); // get some space between layers + myAngle:=0; + end; + //if CTime > Timings[3] then myScale:=1; // keep the space between layers + glTranslatef(0,0,-5+0.5*myScale); + if CTime > Timings[3] then + myScale:=1; // keep the space between layers + if CTime > Timings[3] then + begin // make logo rotate left and grow + //myScale:=(CTime-Timings[4])/(Timings[7]-Timings[4]); + glRotatef(20*sqr(CTime-Timings[3])/sqr((Timings[7]-Timings[3])/2),0,0,1); + glScalef(1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1); + end; + if CTime < Timings[2] then + glRotatef(30*myAngle,0.5*myScale+myScale,1+myScale,0); + //glScalef(0.5,0.5,0.5); + glScalef(4/3,-1,1); + glColor4f(1, 1, 1, 1); - // do some sparkling effects - if (CTime < Timings[1]) and (CTime > Timings[21]) then - begin - for k:=1 to 3 do begin - l:=410+floor((CTime-Timings[21])/(Timings[1]-Timings[21])*(536-410))+RandomRange(-5,5); - j:=floor((Timings[1]-CTime)/22)+RandomRange(285,301); - GoldenRec.Spawn(l, j, 1, 16, 0, -1, Flare, 0); - end; - end; + glBindTexture(GL_TEXTURE_2D, intro_layer01.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, -0.4 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, -0.4 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, -0.4 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, -0.4 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer02.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, -0.3 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, -0.3 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, -0.3 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, -0.3 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer03.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, -0.2 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, -0.2 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, -0.2 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, -0.2 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer04.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, -0.1 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, -0.1 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, -0.1 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, -0.1 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer05.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer06.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0.1 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0.1 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0.1 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0.1 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer07.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0.2 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0.2 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0.2 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0.2 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer08.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0.3 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0.3 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0.3 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0.3 * myScale); + glEnd; + glBindTexture(GL_TEXTURE_2D, intro_layer09.TexNum); + glbegin(gl_quads); + glTexCoord2f(0,0);glVertex3f(-1, -1, 0.22 * myScale); + glTexCoord2f(0,1);glVertex3f(-1, 1, 0.22 * myScale); + glTexCoord2f(1,1); glVertex3f(1, 1, 0.22 * myScale); + glTexCoord2f(1,0);glVertex3f(1, -1, 0.22 * myScale); + glEnd; + gldisable(gl_texture_2d); + glDisable(GL_BLEND); + + glPopMatrix; + End3D; + + // do some sparkling effects + if (CTime < Timings[1]) and (CTime > Timings[21]) then + begin + for k:=1 to 3 do + begin + l:=410+floor((CTime-Timings[21])/(Timings[1]-Timings[21])*(536-410))+RandomRange(-5,5); + j:=floor((Timings[1]-CTime)/22)+RandomRange(285,301); + GoldenRec.Spawn(l, j, 1, 16, 0, -1, Flare, 0); + end; + end; - // fade to white at end - if Ctime > Timings[6] then - begin - glColor4f(1,1,1,sqr(Ctime-Timings[6])*(Ctime-Timings[6])/sqr(Timings[7]-Timings[6])); - glEnable(GL_BLEND); - glBegin(GL_QUADS); - glVertex2f(0,0); - glVertex2f(0,600); - glVertex2f(800,600); - glVertex2f(800,0); - glEnd; - glDisable(GL_BLEND); - end; + // fade to white at end + if Ctime > Timings[6] then + begin + glColor4f(1,1,1,sqr(Ctime-Timings[6])*(Ctime-Timings[6])/sqr(Timings[7]-Timings[6])); + glEnable(GL_BLEND); + glBegin(GL_QUADS); + glVertex2f(0,0); + glVertex2f(0,600); + glVertex2f(800,600); + glVertex2f(800,0); + glEnd; + glDisable(GL_BLEND); + end; - end; + end; if (CRDTS_Stage=MainPart) then // main credits screen background, scroller, logo and girl begin @@ -572,38 +580,50 @@ begin //######################################################################### // draw credits names - Log.LogStatus('',' JB-4'); // BlindGuard (rotate in from upper left, rotate out to lower right) - STime:=Timings[9]-10; - Delay:=Timings[10]-Timings[9]; + STime := Timings[9]-10; + Delay := Timings[10]-Timings[9]; if CTime > STime then begin k:=0; - ESC_Alpha:=20; + ESC_Alpha := 20; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); - if ESC_Alpha >20 then ESC_Alpha:=20; - if ((CTime-STime)<20) then ESC_Alpha:=20; - if CTime <=STime+10 then j:=CTime-STime else j:=10; - if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + if Data[k] > 0.25 then + ESC_Alpha := 5 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; + if ((CTime - STime) < 20) then + ESC_Alpha := 20; + if CTime <= STime + 10 then + j := CTime - STime + else + j := 10; + if (CTime >= STime + Delay - 10) then + if (CTime <= STime + Delay) then + j := (STime + Delay) - CTime + else + j := 0; glColor4f(1, 1, 1, ESC_Alpha/20*j/10); - if (CTime >= STime+10) and (CTime<=STime+12) then begin + if (CTime >= STime + 10) and (CTime <= STime + 12) then + begin GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); @@ -617,22 +637,25 @@ begin glPushMatrix; gltranslatef(0,329,0); - if CTime <= STime+10 then begin glrotatef((CTime-STime)*9+270,0,0,1);end; + if CTime <= STime + 10 then + glrotatef((CTime - STime) * 9 + 270,0,0,1); gltranslatef(223,0,0); - if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin - gltranslatef(223,0,0); - glrotatef((integer(CTime)-(integer(STime+Delay)-10))*-9,0,0,1); - gltranslatef(-223,0,0); - end; + if CTime >= STime + Delay - 10 then + if CTime <= STime + Delay then + begin + gltranslatef(223,0,0); + glrotatef((integer(CTime) - (integer(STime + Delay) - 10))*-9,0,0,1); + gltranslatef(-223,0,0); + end; glBindTexture(GL_TEXTURE_2D, credits_blindguard.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163, -129); - glTexCoord2f(0,1);glVertex2f(-163, 129); - glTexCoord2f(1,1); glVertex2f(163, 129); - glTexCoord2f(1,0);glVertex2f(163, -129); + glTexCoord2f(0,0);glVertex2f(-163, -129); + glTexCoord2f(0,1);glVertex2f(-163, 129); + glTexCoord2f(1,1);glVertex2f( 163, 129); + glTexCoord2f(1,0);glVertex2f( 163, -129); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); @@ -640,35 +663,47 @@ begin end; // Blindy (zoom from 0 to full size and rotation, zoom zo doubble size and shift to upper right) - STime:=Timings[10]-10; - Delay:=Timings[11]-Timings[10]+5; + STime := Timings[10] - 10; + Delay := Timings[11] - Timings[10] + 5; if CTime > STime then begin - k:=0; - ESC_Alpha:=20; + k := 0; + ESC_Alpha := 20; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - - if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); - if ESC_Alpha >20 then ESC_Alpha:=20; - if ((CTime-STime)<20) then ESC_Alpha:=20; - if CTime <=STime+10 then j:=CTime-STime else j:=10; - if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + if Data[k] > 0.25 then + ESC_Alpha := 5 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; + if ((CTime - STime) < 20) then + ESC_Alpha := 20; + if CTime <= STime + 10 then + j := CTime - STime + else + j := 10; + if (CTime >= STime + Delay - 10) then + if (CTime <= STime + Delay) then + j := (STime + Delay) - CTime + else + j := 0; glColor4f(1, 1, 1, ESC_Alpha/20*j/10); - if (CTime >= STime+20) and (CTime<=STime+22) then begin + if (CTime >= STime+20) and (CTime<=STime+22) then + begin GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); @@ -682,18 +717,21 @@ begin glPushMatrix; gltranslatef(223,329,0); - if CTime <= STime+20 then begin - j:=CTime-Stime; + if CTime <= STime + 20 then + begin + j := CTime - Stime; glscalef(j*j/400,j*j/400,j*j/400); glrotatef(j*18.0,0,0,1); end; - if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin - j:=CTime-(STime+Delay-10); - f:=j*10.0; - gltranslatef(f*3,-f,0); - glscalef(1+j/10,1+j/10,1+j/10); - glrotatef(j*9.0,0,0,1); - end; + if CTime >= STime + Delay - 10 then + if CTime <= STime + Delay then + begin + j := CTime - (STime + Delay - 10); + f := j * 10.0; + gltranslatef(f*3,-f,0); + glscalef(1+j/10,1+j/10,1+j/10); + glrotatef(j*9.0,0,0,1); + end; glBindTexture(GL_TEXTURE_2D, credits_blindy.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); @@ -710,35 +748,47 @@ begin end; // Canni (shift in from left, shift out to upper right) - STime:=Timings[11]-10; - Delay:=Timings[12]-Timings[11]+5; + STime := Timings[11]-10; + Delay := Timings[12]-Timings[11]+5; if CTime > STime then begin k:=0; - ESC_Alpha:=20; + ESC_Alpha := 20; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - - if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); - if ESC_Alpha >20 then ESC_Alpha:=20; - if ((CTime-STime)<20) then ESC_Alpha:=20; - if CTime <=STime+10 then j:=CTime-STime else j:=10; - if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + if Data[k] > 0.25 then + ESC_Alpha := 5 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; + if ((CTime - STime) < 20) then + ESC_Alpha := 20; + if CTime <= STime + 10 then + j := CTime - STime + else + j := 10; + if (CTime >= STime + Delay - 10) then + if (CTime <= STime + Delay) then + j := (STime + Delay) - CTime + else + j := 0; glColor4f(1, 1, 1, ESC_Alpha/20*j/10); - if (CTime >= STime+10) and (CTime<=STime+12) then begin + if (CTime >= STime + 10) and (CTime <= STime + 12) then + begin GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); @@ -752,10 +802,12 @@ begin glPushMatrix; gltranslatef(223,329,0); - if CTime <= STime+10 then begin + if CTime <= STime + 10 then + begin gltranslatef(((CTime-STime)*21.0)-210,0,0); end; - if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin + if CTime >= STime + Delay - 10 then if CTime <= STime + Delay then + begin j:=(CTime-(STime+Delay-10))*21; gltranslatef(j,-j/2,0); end; @@ -775,35 +827,47 @@ begin end; // Commandio (flip in from down, flip out to upper right) - STime:=Timings[12]-10; - Delay:=Timings[13]-Timings[12]; + STime := Timings[12]-10; + Delay := Timings[13]-Timings[12]; if CTime > STime then begin k:=0; - ESC_Alpha:=20; + ESC_Alpha := 20; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - - if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); - if ESC_Alpha >20 then ESC_Alpha:=20; - if ((CTime-STime)<20) then ESC_Alpha:=20; - if CTime <=STime+10 then j:=CTime-STime else j:=10; - if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + if Data[k] > 0.25 then + ESC_Alpha := 5 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; + if ((CTime - STime) < 20) then + ESC_Alpha := 20; + if CTime <= STime + 10 then + j := CTime - STime + else + j := 10; + if (CTime >= STime + Delay - 10) then + if (CTime <= STime + Delay) then + j := (STime + Delay) - CTime + else + j := 0; glColor4f(1, 1, 1, ESC_Alpha/20*j/10); - if (CTime >= STime+10) and (CTime<=STime+12) then begin + if (CTime >= STime + 10) and (CTime <= STime + 12) then + begin GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); @@ -817,15 +881,17 @@ begin glPushMatrix; gltranslatef(223,329,0); - if CTime <= STime+10 then + if CTime <= STime + 10 then f:=258.0-25.8*(CTime-STime) else - f:=0; - g:=0; - if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin - j:=CTime-(STime+Delay-10); - g:=32.6*j; - end; + f := 0; + g := 0; + if CTime >= STime + Delay - 10 then + if CTime <= STime + Delay then + begin + j := CTime - (STime + Delay - 10); + g := 32.6 * j; + end; glBindTexture(GL_TEXTURE_2D, credits_commandio.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); @@ -842,33 +908,44 @@ begin end; // lazy joker (just scrolls from left to right, no twinkling stars, no on-beat flashing) - STime:=Timings[13]-35; - Delay:=Timings[14]-Timings[13]+5; + STime := Timings[13]-35; + Delay := Timings[14]-Timings[13]+5; if CTime > STime then begin k:=0; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - - if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); - if ESC_Alpha >20 then ESC_Alpha:=20; - if ((CTime-STime)>10) and ((CTime-STime)<20) then ESC_Alpha:=20; + if Data[k] > 0.25 then + ESC_Alpha := 5 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; + if ((CTime-STime)>10) and ((CTime - STime) < 20) then + ESC_Alpha := 20; ESC_Alpha:=10; f:=CTime-STime; - if CTime <=STime+40 then j:=CTime-STime else j:=40; - if (CTime >=STime+Delay-40) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + if CTime <=STime+40 then + j := CTime - STime + else + j:=40; + if (CTime >=STime+Delay-40) then + if (CTime <= STime + Delay) then + j := (STime + Delay) - CTime + else + j := 0; glColor4f(1, 1, 1, ESC_Alpha/20*j*j/1600); glPushMatrix; @@ -889,36 +966,47 @@ begin end; // Mog (flip in from right, flip out to lower right) - STime:=Timings[14]-10; - Delay:=Timings[15]-Timings[14]+5; + STime := Timings[14]-10; + Delay := Timings[15]-Timings[14]+5; if CTime > STime then begin k:=0; - ESC_Alpha:=20; - + ESC_Alpha := 20; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - - if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); - if ESC_Alpha >20 then ESC_Alpha:=20; - if ((CTime-STime)<20) then ESC_Alpha:=20; - if CTime <=STime+10 then j:=CTime-STime else j:=10; - if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + if Data[k] > 0.25 then + ESC_Alpha := 5 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; + if ((CTime - STime) < 20) then + ESC_Alpha := 20; + if CTime <= STime + 10 then + j := CTime - STime + else + j := 10; + if (CTime >= STime + Delay - 10) then + if (CTime <= STime + Delay) then + j := (STime + Delay) - CTime + else + j := 0; glColor4f(1, 1, 1, ESC_Alpha/20*j/10); - if (CTime >= STime+10) and (CTime<=STime+12) then begin + if (CTime >= STime + 10) and (CTime <= STime + 12) then + begin GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); @@ -932,15 +1020,16 @@ begin glPushMatrix; gltranslatef(223,329,0); - if CTime <= STime+10 then - f:=326.0-32.6*(CTime-STime) + if CTime <= STime + 10 then + f := 326.0 - 32.6 * (CTime - STime) else - f:=0; + f := 0; - g:=0; - if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin - j:=CTime-(STime+Delay-10); - g:=32.6*j; + g := 0; + if CTime >= STime + Delay - 10 then if CTime <= STime + Delay then + begin + j := CTime - (STime + Delay - 10); + g := 32.6 * j; end; glBindTexture(GL_TEXTURE_2D, credits_mog.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -958,35 +1047,47 @@ begin end; // Mota (rotate in from upper right, shift out to lower left while shrinking and rotateing) - STime:=Timings[15]-10; - Delay:=Timings[16]-Timings[15]+5; + STime := Timings[15]-10; + Delay := Timings[16]-Timings[15]+5; if CTime > STime then begin k:=0; - ESC_Alpha:=20; + ESC_Alpha := 20; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - - if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); - if ESC_Alpha >20 then ESC_Alpha:=20; - if ((CTime-STime)<20) then ESC_Alpha:=20; - if CTime <=STime+10 then j:=CTime-STime else j:=10; - if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + if Data[k] > 0.25 then + ESC_Alpha := 5 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; + if ((CTime - STime) < 20) then + ESC_Alpha := 20; + if CTime <= STime + 10 then + j := CTime - STime + else + j := 10; + if (CTime >= STime + Delay - 10) then + if (CTime <= STime + Delay) then + j := (STime + Delay) - CTime + else + j := 0; glColor4f(1, 1, 1, ESC_Alpha/20*j/10); - if (CTime >= STime+10) and (CTime<=STime+12) then begin + if (CTime >= STime + 10) and (CTime <= STime + 12) then + begin GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); @@ -1000,18 +1101,21 @@ begin glPushMatrix; gltranslatef(223,329,0); - if CTime <= STime+10 then begin + if CTime <= STime + 10 then + begin gltranslatef(223,0,0); glrotatef((10-(CTime-STime))*9,0,0,1); gltranslatef(-223,0,0); end; - if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin - j:=CTime-(STime+Delay-10); - f:=j*10.0; - gltranslatef(-f*2,-f,0); - glscalef(1-j/10,1-j/10,1-j/10); - glrotatef(-j*9.0,0,0,1); - end; + if CTime >= STime + Delay - 10 then + if CTime <= STime + Delay then + begin + j := CTime - (STime + Delay - 10); + f := j * 10.0; + gltranslatef(-f*2,-f,0); + glscalef(1-j/10,1-j/10,1-j/10); + glrotatef(-j*9.0,0,0,1); + end; glBindTexture(GL_TEXTURE_2D, credits_mota.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); @@ -1028,35 +1132,47 @@ begin end; // Skillmaster (shift in from lower right, rotate out to upper right) - STime:=Timings[16]-10; - Delay:=Timings[17]-Timings[16]+5; + STime := Timings[16]-10; + Delay := Timings[17]-Timings[16]+5; if CTime > STime then begin k:=0; - ESC_Alpha:=20; + ESC_Alpha := 20; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - - if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); - if ESC_Alpha >20 then ESC_Alpha:=20; - if ((CTime-STime)<20) then ESC_Alpha:=20; - if CTime <=STime+10 then j:=CTime-STime else j:=10; - if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + if Data[k] > 0.25 then + ESC_Alpha := 5 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; + if ((CTime - STime) < 20) then + ESC_Alpha := 20; + if CTime <= STime + 10 then + j := CTime - STime + else + j := 10; + if (CTime >= STime + Delay - 10) then + if (CTime <= STime + Delay) then + j := (STime + Delay) - CTime + else + j := 0; glColor4f(1, 1, 1, ESC_Alpha/20*j/10); - if (CTime >= STime+10) and (CTime<=STime+12) then begin + if (CTime >= STime + 10) and (CTime <= STime + 12) then + begin GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); @@ -1070,18 +1186,21 @@ begin glPushMatrix; gltranslatef(223,329,0); - if CTime <= STime+10 then begin - j:=STime+10-CTime; - f:=j*10.0; + if CTime <= STime + 10 then + begin + j := STime + 10 - CTime; + f := j * 10.0; gltranslatef(+f*2,+f/2,0); end; - if CTime >=STime+Delay-10 then if CTime <=STime+Delay then begin - j:=CTime-(STime+Delay-10); - gltranslatef(0,-223,0); - glrotatef(integer(j)*-9,0,0,1); - gltranslatef(0,223,0); - glrotatef(j*9,0,0,1); - end; + if CTime >= STime + Delay - 10 then + if CTime <= STime + Delay then + begin + j := CTime - (STime + Delay - 10); + gltranslatef(0,-223,0); + glrotatef(integer(j)*-9,0,0,1); + gltranslatef(0,223,0); + glrotatef(j*9,0,0,1); + end; glBindTexture(GL_TEXTURE_2D, credits_skillmaster.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); @@ -1098,35 +1217,47 @@ begin end; // WhiteShark (flip in from lower left, flip out to upper right) - STime:=Timings[17]-10; - Delay:=Timings[18]-Timings[17]; + STime := Timings[17] - 10; + Delay := Timings[18] - Timings[17]; if CTime > STime then begin k:=0; - ESC_Alpha:=20; + ESC_Alpha := 20; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - - if Data[k]>0.25 then ESC_Alpha:=5 else inc(ESC_Alpha); - if ESC_Alpha >20 then ESC_Alpha:=20; - if ((CTime-STime)<20) then ESC_Alpha:=20; - if CTime <=STime+10 then j:=CTime-STime else j:=10; - if (CTime >=STime+Delay-10) then if (CTime <=STime+Delay) then j:=(STime+Delay)-CTime else j:=0; + if Data[k] > 0.25 then + ESC_Alpha := 5 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; + if ((CTime - STime) < 20) then + ESC_Alpha := 20; + if CTime <= STime + 10 then + j := CTime - STime + else + j := 10; + if (CTime >= STime + Delay - 10) then + if (CTime <= STime + Delay) then + j := (STime + Delay) - CTime + else + j := 0; glColor4f(1, 1, 1, ESC_Alpha/20*j/10); - if (CTime >= STime+10) and (CTime<=STime+12) then begin + if (CTime >= STime + 10) and (CTime <= STime + 12) then + begin GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); @@ -1140,19 +1271,19 @@ begin glPushMatrix; gltranslatef(223,329,0); - if CTime <= STime+10 then - f:=326.0-32.6*(CTime-STime) + if CTime <= STime + 10 then + f := 326.0 - 32.6 * (CTime - STime) else - f:=0; + f := 0; - if (CTime >= STime+Delay-10) and (CTime <= STime+Delay) then + if (CTime >= STime + Delay - 10) and (CTime <= STime + Delay) then begin - j:=CTime-(STime+Delay-10); - g:=32.6*j; + j := CTime - (STime + Delay - 10); + g := 32.6 * j; end else begin - g:=0; + g := 0; end; glBindTexture(GL_TEXTURE_2D, credits_whiteshark.TexNum); @@ -1160,41 +1291,40 @@ begin glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163-f+g, -129+f/4-g/2); - glTexCoord2f(0,1);glVertex2f(-163-f/4+g, 129+g/2+f/4); - glTexCoord2f(1,1); glVertex2f(163-f*1.2+g/4, 129+f/2-g/4); - glTexCoord2f(1,0);glVertex2f(163-f*1.5+g/4, -129+f*1.5+g/4); + glTexCoord2f(0,0);glVertex2f(-163-f+g, -129+f/4-g/2); + glTexCoord2f(0,1);glVertex2f(-163-f/4+g, 129+g/2+f/4); + glTexCoord2f(1,1);glVertex2f( 163-f*1.2+g/4, 129+f/2-g/4); + glTexCoord2f(1,0);glVertex2f( 163-f*1.5+g/4, -129+f*1.5+g/4); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); glPopMatrix; end; - Log.LogStatus('',' JB-103'); // #################################################################### // do some twinkle stuff (kinda on beat) - if (CTime > Timings[8] ) and - (CTime < Timings[19] ) then + if (CTime > Timings[8] ) and + (CTime < Timings[19]) then begin k := 0; try - for j:=0 to 40 do + for j := 0 to 40 do begin - if ( j < length( Data ) ) AND - ( k < length( Data ) ) then + if (j < length(Data)) and + (k < length(Data)) then begin if Data[j] >= Data[k] then - k:=j; + k := j; end; end; except end; - if Data[k]>0.2 then + if Data[k] > 0.2 then begin l := RandomRange(6,16); j := RandomRange(0,27); @@ -1246,19 +1376,21 @@ begin end; end else - if (CRDTS_Stage=Outro) then + if (CRDTS_Stage = Outro) then begin - if CTime=Timings[20] then begin - CTime_hold:=0; + if CTime = Timings[20] then + begin + CTime_hold := 0; AudioPlayback.Stop; AudioPlayback.Open(soundpath + 'credits-outro-tune.mp3'); AudioPlayback.SetVolume(0.2); - AudioPlayback.SetLoop(True); + AudioPlayback.SetLoop(true); AudioPlayback.Play; end; - if CTime_hold > 231 then begin + if CTime_hold > 231 then + begin AudioPlayback.Play; - Ctime_hold:=0; + Ctime_hold := 0; end; glClearColor(0,0,0,0); glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); @@ -1288,11 +1420,13 @@ begin glTexCoord2f(487/512,0);glVertex2f(487, 0); glEnd; - ESC_Alpha:=20; - if (RandomRange(0,20) > 18) and (ESC_Alpha=20) then - ESC_Alpha:=0 - else inc(ESC_Alpha); - if ESC_Alpha > 20 then ESC_Alpha:=20; + ESC_Alpha := 20; + if (RandomRange(0,20) > 18) and (ESC_Alpha = 20) then + ESC_Alpha := 0 + else + inc(ESC_Alpha); + if ESC_Alpha > 20 then + ESC_Alpha := 20; glColor4f(1, 1, 1, ESC_Alpha/20); glBindTexture(GL_TEXTURE_2D, outro_exd.TexNum); glbegin(gl_quads); @@ -1311,12 +1445,12 @@ begin { // draw credits runtime counter SetFontStyle (2); - SetFontItalic(False); + SetFontItalic(false); SetFontSize(27); SetFontPos (5, 5); glColor4f(1, 1, 1, 1); - //RuntimeStr:='CTime: '+inttostr(floor(CTime/30.320663991914489602156136106092))+'.'+inttostr(floor(CTime/3.0320663991914489602156136106092)-floor(CTime/30.320663991914489602156136106092)*10); - RuntimeStr:='CTime: '+inttostr(CTime); + //RuntimeStr := 'CTime: '+inttostr(floor(CTime/30.320663991914489602156136106092))+'.'+inttostr(floor(CTime/3.0320663991914489602156136106092)-floor(CTime/30.320663991914489602156136106092)*10); + RuntimeStr := 'CTime: ' + inttostr(CTime); glPrint (RuntimeStr[1]); } -- cgit v1.2.3 From d14c9c3a46da40a9f4737ddc4b9cef5d94b0fe74 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 25 Apr 2009 13:52:48 +0000 Subject: Cosmetics. No code change git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1695 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 544 +++++++++++++++++++++-------------------- 1 file changed, 274 insertions(+), 270 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index 2982fe24..1d0e5466 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -47,7 +47,7 @@ uses UGraphicClasses; type - TCreditsStages=(InitialDelay,Intro,MainPart,Outro); + TCreditsStages=(InitialDelay, Intro, MainPart, Outro); TScreenCredits = class(TMenu) public @@ -89,14 +89,14 @@ type deluxe_slidein: cardinal; - CurrentScrollText: string; - NextScrollUpdate: real; + CurrentScrollText: string; + NextScrollUpdate: real; EndofLastScrollingPart: cardinal; CurrentScrollStart, CurrentScrollEnd: integer; CRDTS_Stage: TCreditsStages; - Fadeout: boolean; + Fadeout: boolean; constructor Create; override; function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override; function Draw: boolean; override; @@ -108,8 +108,8 @@ type const Funky_Text: string = - 'Grandma Deluxe has arrived! Thanks to Corvus5 for the massive work on UltraStar, Wome for the nice tune you´re hearing, '+ - 'all the people who put massive effort and work in new songs (don´t forget UltraStar w/o songs would be nothing), ppl from '+ + 'Grandma Deluxe has arrived! Thanks to Corvus5 for the massive work on UltraStar, Wome for the nice tune you're hearing, '+ + 'all the people who put massive effort and work in new songs (don't forget UltraStar w/o songs would be nothing), ppl from '+ 'irc helping us - eBandit and Gabari, scene ppl who really helped instead of compiling and running away. Greetings to DennisTheMenace for betatesting, '+ 'Demoscene.tv, pouet.net, KakiArts, Sourceforge,..'; @@ -191,15 +191,15 @@ begin FadeTo(@ScreenMain); AudioPlayback.PlaySound(SoundLib.Back); end; - { +{ SDLK_SPACE: begin setlength(CTime_hold,length(CTime_hold)+1); CTime_hold[high(CTime_hold)]:=CTime; end; - } - end;//esac - end; //fi +} + end; // esac + end; // fi end; constructor TScreenCredits.Create; @@ -250,15 +250,15 @@ procedure TScreenCredits.onShow; begin inherited; - CRDTS_Stage := InitialDelay; - Credits_X := 580; + CRDTS_Stage := InitialDelay; + Credits_X := 580; deluxe_slidein := 0; - Credits_Alpha := 0; - //Music.SetLoop(true); loop loops not, shit + Credits_Alpha := 0; +// Music.SetLoop(true); loop loops not, shit AudioPlayback.Open(soundpath + 'wome-credits-tune.mp3'); // thank you wetue - //Music.Play; - CTime:=0; - //setlength(CTime_hold,0); +// Music.Play; + CTime := 0; +// setlength(CTime_hold,0); end; procedure TScreenCredits.onHide; @@ -268,17 +268,17 @@ end; Procedure TScreenCredits.Draw_FunkyText; var - S: integer; - X,Y,A: real; + S: integer; + X, Y, A: real; visibleText: string; begin SetFontSize(30); - //Init ScrollingText + // init ScrollingText if (CTime = Timings[7]) then begin - //Set Position of Text - Credits_X := 600; + // set position of text + Credits_X := 600; CurrentScrollStart := 1; CurrentScrollEnd := 1; end; @@ -291,8 +291,8 @@ begin for S := 1 to length(visibleText) do begin - Y := abs(sin((Credits_X+X)*0.93{*(((Credits_X+X))/1200)}/100*pi)); - SetFontPos(Credits_X+X, 538-Y*(Credits_X+X)*(Credits_X+X)*(Credits_X+X)/1000000); + Y := abs(sin((Credits_X + X) * 0.93 { * (((Credits_X + X)) / 1200) } / 100 * pi)); + SetFontPos(Credits_X + X, 538 - Y * (Credits_X + X) * (Credits_X + X) * (Credits_X + X) / 1000000); if (Credits_X + X > 32) then A := 17 @@ -301,10 +301,10 @@ begin else A := 0; - glColor4f(230/255-40/255+Y*(Credits_X+X)/900, - 200/255-30/255+Y*(Credits_X+X)/1000, - 155/255-20/255+Y*(Credits_X+X)/1100, - A/17); + glColor4f(230 / 255 - 40 / 255 + Y * (Credits_X + X)/ 900, + 200 / 255 - 30 / 255 + Y * (Credits_X + X)/ 1000, + 155 / 255 - 20 / 255 + Y * (Credits_X + X)/ 1100, + A / 17); glPrint(visibleText[S]); X := X + glTextWidth(visibleText[S]); end; @@ -323,20 +323,21 @@ begin inc(CurrentScrollEnd); end; end; - { // timing hack - X:=5; - SetFontStyle (2); - SetFontItalic(false); - SetFontSize(27); - glColor4f(1, 1, 1, 1); - for S:=0 to high(CTime_hold) do - begin - visibleText := inttostr(CTime_hold[S]); - SetFontPos (500, X); - glPrint(visibleText[0]); - X := X + 20; - end; - } +{ +// timing hack + X:=5; + SetFontStyle(2); + SetFontItalic(false); + SetFontSize(27); + glColor4f(1, 1, 1, 1); + for S := 0 to high(CTime_hold) do + begin + visibleText := inttostr(CTime_hold[S]); + SetFontPos (500, X); + glPrint(visibleText[0]); + X := X + 20; + end; +} end; procedure Start3D; @@ -344,10 +345,11 @@ begin glMatrixMode(GL_PROJECTION); glPushMatrix; glLoadIdentity; - glFrustum(-0.3*4/3,0.3*4/3,-0.3,0.3,1,1000); + glFrustum(-0.3 * 4 / 3, 0.3 * 4 / 3, -0.3, 0.3, 1, 1000); glMatrixMode(GL_MODELVIEW); glLoadIdentity; end; + procedure End3D; begin glMatrixMode(GL_PROJECTION); @@ -367,7 +369,7 @@ var myAngle: real; const myLogoCoords: array[0..27,0..1] of cardinal = ( - (39,32),(84,32),(100,16),(125,24), + ( 39,32),( 84,32),(100,16),(125,24), (154,31),(156,58),(168,32),(203,36), (258,34),(251,50),(274,93),(294,84), (232,54),(278,62),(319,34),(336,92), @@ -376,10 +378,10 @@ const (450,32),(485,34),(444,91),(486,93) ); begin - //dis does teh muiwk y0r + // dis does teh muiwk y0r to be translated :-) AudioPlayback.GetFFTData(Data); - Log.LogStatus('',' JB-1'); + Log.LogStatus('', ' JB-1'); T := SDL_GetTicks() div 33; if T <> Credits_Time then @@ -389,11 +391,11 @@ begin inc(CTime_hold); Credits_X := Credits_X-2; - Log.LogStatus('',' JB-2'); + Log.LogStatus('', ' JB-2'); if (CRDTS_Stage=InitialDelay) and (CTime = Timings[0]) then begin - //CTime := Timings[20]; - //CRDTS_Stage := Outro; +// CTime := Timings[20]; +// CRDTS_Stage := Outro; CRDTS_Stage := Intro; CTime := 0; AudioPlayback.Play; @@ -404,16 +406,16 @@ begin end; if (CRDTS_Stage = MainPart) and (CTime = Timings[20]) then begin - CRDTS_Stage:=Outro; + CRDTS_Stage := Outro; end; end; - Log.LogStatus('',' JB-3'); + Log.LogStatus('', ' JB-3'); - //draw background + // draw background if CRDTS_Stage = InitialDelay then begin - glClearColor(0,0,0,0); + glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); end else @@ -422,7 +424,7 @@ begin Start3D; glPushMatrix; - glClearColor(0,0,0,0); + glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); glEnable(GL_TEXTURE_2D); @@ -431,8 +433,8 @@ begin if CTime < Timings[1] then begin - myScale := 0.5+0.5*(Timings[1]-CTime)/(Timings[1]); // slowly move layers together - myAngle := cos((CTime)*pi/((Timings[1])*2)); // and make logo face towards camera + myScale := 0.5 + 0.5 * (Timings[1] - CTime) / (Timings[1]); // slowly move layers together + myAngle := cos((CTime) * pi / ((Timings[1]) * 2)); // and make logo face towards camera end else begin // this is the part when the logo stands still @@ -441,87 +443,87 @@ begin end; if CTime > Timings[2] then begin - myScale:= 0.5+0.5*(CTime-Timings[2])/(Timings[3]-Timings[2]); // get some space between layers - myAngle:=0; + myScale := 0.5 + 0.5 * (CTime - Timings[2]) / (Timings[3] - Timings[2]); // get some space between layers + myAngle := 0; end; - //if CTime > Timings[3] then myScale:=1; // keep the space between layers - glTranslatef(0,0,-5+0.5*myScale); +// if CTime > Timings[3] then myScale := 1; // keep the space between layers + glTranslatef(0, 0, -5 + 0.5 * myScale); if CTime > Timings[3] then - myScale:=1; // keep the space between layers + myScale := 1; // keep the space between layers if CTime > Timings[3] then begin // make logo rotate left and grow - //myScale:=(CTime-Timings[4])/(Timings[7]-Timings[4]); - glRotatef(20*sqr(CTime-Timings[3])/sqr((Timings[7]-Timings[3])/2),0,0,1); - glScalef(1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1+sqr(CTime-Timings[3])/(32*(Timings[7]-Timings[3])),1); +// myScale := (CTime - Timings[4]) / (Timings[7] - Timings[4]); + glRotatef(20 * sqr(CTime - Timings[3]) / sqr((Timings[7] - Timings[3]) / 2), 0, 0, 1); + glScalef(1 + sqr(CTime - Timings[3]) / (32 * (Timings[7] - Timings[3])), 1 + sqr(CTime - Timings[3]) / (32 * (Timings[7] - Timings[3])), 1); end; if CTime < Timings[2] then - glRotatef(30*myAngle,0.5*myScale+myScale,1+myScale,0); - //glScalef(0.5,0.5,0.5); - glScalef(4/3,-1,1); + glRotatef(30 * myAngle, 0.5 * myScale + myScale, 1 + myScale, 0); +// glScalef(0.5, 0.5, 0.5); + glScalef(4/3, -1, 1); glColor4f(1, 1, 1, 1); glBindTexture(GL_TEXTURE_2D, intro_layer01.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, -0.4 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, -0.4 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, -0.4 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, -0.4 * myScale); + glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.4 * myScale); + glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.4 * myScale); + glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.4 * myScale); + glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.4 * myScale); glEnd; glBindTexture(GL_TEXTURE_2D, intro_layer02.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, -0.3 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, -0.3 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, -0.3 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, -0.3 * myScale); + glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.3 * myScale); + glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.3 * myScale); + glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.3 * myScale); + glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.3 * myScale); glEnd; glBindTexture(GL_TEXTURE_2D, intro_layer03.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, -0.2 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, -0.2 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, -0.2 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, -0.2 * myScale); + glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.2 * myScale); + glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.2 * myScale); + glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.2 * myScale); + glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.2 * myScale); glEnd; glBindTexture(GL_TEXTURE_2D, intro_layer04.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, -0.1 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, -0.1 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, -0.1 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, -0.1 * myScale); + glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.1 * myScale); + glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.1 * myScale); + glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.1 * myScale); + glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.1 * myScale); glEnd; glBindTexture(GL_TEXTURE_2D, intro_layer05.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0 * myScale); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0 * myScale); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0 * myScale); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0 * myScale); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0 * myScale); glEnd; glBindTexture(GL_TEXTURE_2D, intro_layer06.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0.1 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0.1 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0.1 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0.1 * myScale); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.1 * myScale); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.1 * myScale); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.1 * myScale); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.1 * myScale); glEnd; glBindTexture(GL_TEXTURE_2D, intro_layer07.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0.2 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0.2 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0.2 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0.2 * myScale); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.2 * myScale); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.2 * myScale); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.2 * myScale); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.2 * myScale); glEnd; glBindTexture(GL_TEXTURE_2D, intro_layer08.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0.3 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0.3 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0.3 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0.3 * myScale); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.3 * myScale); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.3 * myScale); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.3 * myScale); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.3 * myScale); glEnd; glBindTexture(GL_TEXTURE_2D, intro_layer09.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex3f(-1, -1, 0.22 * myScale); - glTexCoord2f(0,1);glVertex3f(-1, 1, 0.22 * myScale); - glTexCoord2f(1,1); glVertex3f(1, 1, 0.22 * myScale); - glTexCoord2f(1,0);glVertex3f(1, -1, 0.22 * myScale); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.22 * myScale); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.22 * myScale); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.22 * myScale); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.22 * myScale); glEnd; gldisable(gl_texture_2d); glDisable(GL_BLEND); @@ -532,10 +534,10 @@ begin // do some sparkling effects if (CTime < Timings[1]) and (CTime > Timings[21]) then begin - for k:=1 to 3 do + for k:= 1 to 3 do begin - l:=410+floor((CTime-Timings[21])/(Timings[1]-Timings[21])*(536-410))+RandomRange(-5,5); - j:=floor((Timings[1]-CTime)/22)+RandomRange(285,301); + l := 410 + floor((CTime - Timings[21]) / (Timings[1] - Timings[21]) * (536 - 410)) + RandomRange(-5, 5); + j := floor((Timings[1] - CTime) / 22) + RandomRange(285, 301); GoldenRec.Spawn(l, j, 1, 16, 0, -1, Flare, 0); end; end; @@ -543,13 +545,13 @@ begin // fade to white at end if Ctime > Timings[6] then begin - glColor4f(1,1,1,sqr(Ctime-Timings[6])*(Ctime-Timings[6])/sqr(Timings[7]-Timings[6])); + glColor4f(1, 1, 1, sqr(CTime - Timings[6]) * (CTime - Timings[6]) / sqr(Timings[7] - Timings[6])); glEnable(GL_BLEND); glBegin(GL_QUADS); - glVertex2f(0,0); - glVertex2f(0,600); - glVertex2f(800,600); - glVertex2f(800,0); + glVertex2f( 0, 0); + glVertex2f( 0, 600); + glVertex2f(800, 600); + glVertex2f(800, 0); glEnd; glDisable(GL_BLEND); end; @@ -566,10 +568,10 @@ begin glColor4f(1, 1, 1, 1); glBindTexture(GL_TEXTURE_2D, credits_bg_tex.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(0, 0); - glTexCoord2f(0,600/1024);glVertex2f(0, 600); - glTexCoord2f(800/1024,600/1024); glVertex2f(800, 600); - glTexCoord2f(800/1024,0);glVertex2f(800, 0); + glTexCoord2f( 0, 0); glVertex2f( 0, 0); + glTexCoord2f( 0, 600/1024); glVertex2f( 0, 600); + glTexCoord2f(800/1024, 600/1024); glVertex2f(800, 600); + glTexCoord2f(800/1024, 0); glVertex2f(800, 0); glEnd; glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); @@ -580,14 +582,14 @@ begin //######################################################################### // draw credits names - Log.LogStatus('',' JB-4'); + Log.LogStatus('', ' JB-4'); // BlindGuard (rotate in from upper left, rotate out to lower right) - STime := Timings[9]-10; - Delay := Timings[10]-Timings[9]; + STime := Timings[9] - 10; + Delay := Timings[10] - Timings[9]; if CTime > STime then begin - k:=0; + k := 0; ESC_Alpha := 20; try @@ -620,7 +622,7 @@ begin j := (STime + Delay) - CTime else j := 0; - glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); if (CTime >= STime + 10) and (CTime <= STime + 12) then begin @@ -636,26 +638,26 @@ begin end; glPushMatrix; - gltranslatef(0,329,0); + gltranslatef(0, 329, 0); if CTime <= STime + 10 then - glrotatef((CTime - STime) * 9 + 270,0,0,1); - gltranslatef(223,0,0); + glrotatef((CTime - STime) * 9 + 270, 0, 0, 1); + gltranslatef(223, 0, 0); if CTime >= STime + Delay - 10 then if CTime <= STime + Delay then begin - gltranslatef(223,0,0); - glrotatef((integer(CTime) - (integer(STime + Delay) - 10))*-9,0,0,1); - gltranslatef(-223,0,0); + gltranslatef(223, 0, 0); + glrotatef((integer(CTime) - (integer(STime + Delay) - 10)) * -9, 0, 0, 1); + gltranslatef(-223, 0, 0); end; glBindTexture(GL_TEXTURE_2D, credits_blindguard.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163, -129); - glTexCoord2f(0,1);glVertex2f(-163, 129); - glTexCoord2f(1,1);glVertex2f( 163, 129); - glTexCoord2f(1,0);glVertex2f( 163, -129); + glTexCoord2f(0, 0); glVertex2f(-163, -129); + glTexCoord2f(0, 1); glVertex2f(-163, 129); + glTexCoord2f(1, 1); glVertex2f( 163, 129); + glTexCoord2f(1, 0); glVertex2f( 163, -129); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); @@ -700,7 +702,7 @@ begin j := (STime + Delay) - CTime else j := 0; - glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); if (CTime >= STime+20) and (CTime<=STime+22) then begin @@ -716,31 +718,31 @@ begin end; glPushMatrix; - gltranslatef(223,329,0); + gltranslatef(223, 329, 0); if CTime <= STime + 20 then begin j := CTime - Stime; - glscalef(j*j/400,j*j/400,j*j/400); - glrotatef(j*18.0,0,0,1); + glscalef(j * j / 400, j * j / 400, j * j / 400); + glrotatef(j * 18.0, 0, 0, 1); end; if CTime >= STime + Delay - 10 then if CTime <= STime + Delay then begin j := CTime - (STime + Delay - 10); f := j * 10.0; - gltranslatef(f*3,-f,0); - glscalef(1+j/10,1+j/10,1+j/10); - glrotatef(j*9.0,0,0,1); + gltranslatef(f * 3, -f, 0); + glscalef(1 + j / 10, 1 + j / 10, 1 + j / 10); + glrotatef(j * 9.0, 0, 0, 1); end; glBindTexture(GL_TEXTURE_2D, credits_blindy.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163, -129); - glTexCoord2f(0,1);glVertex2f(-163, 129); - glTexCoord2f(1,1); glVertex2f(163, 129); - glTexCoord2f(1,0);glVertex2f(163, -129); + glTexCoord2f(0, 0); glVertex2f(-163, -129); + glTexCoord2f(0, 1); glVertex2f(-163, 129); + glTexCoord2f(1, 1); glVertex2f( 163, 129); + glTexCoord2f(1, 0); glVertex2f( 163, -129); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); @@ -748,11 +750,11 @@ begin end; // Canni (shift in from left, shift out to upper right) - STime := Timings[11]-10; - Delay := Timings[12]-Timings[11]+5; + STime := Timings[11] - 10; + Delay := Timings[12] - Timings[11] + 5; if CTime > STime then begin - k:=0; + k := 0; ESC_Alpha := 20; try @@ -785,7 +787,7 @@ begin j := (STime + Delay) - CTime else j := 0; - glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); if (CTime >= STime + 10) and (CTime <= STime + 12) then begin @@ -801,25 +803,26 @@ begin end; glPushMatrix; - gltranslatef(223,329,0); + gltranslatef(223, 329, 0); if CTime <= STime + 10 then begin - gltranslatef(((CTime-STime)*21.0)-210,0,0); - end; - if CTime >= STime + Delay - 10 then if CTime <= STime + Delay then - begin - j:=(CTime-(STime+Delay-10))*21; - gltranslatef(j,-j/2,0); + gltranslatef(((CTime - STime) * 21.0) - 210, 0, 0); end; + if CTime >= STime + Delay - 10 then + if CTime <= STime + Delay then + begin + j := (CTime - (STime + Delay - 10)) * 21; + gltranslatef(j, -j / 2, 0); + end; glBindTexture(GL_TEXTURE_2D, credits_canni.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163, -129); - glTexCoord2f(0,1);glVertex2f(-163, 129); - glTexCoord2f(1,1); glVertex2f(163, 129); - glTexCoord2f(1,0);glVertex2f(163, -129); + glTexCoord2f(0, 0); glVertex2f(-163, -129); + glTexCoord2f(0, 1); glVertex2f(-163, 129); + glTexCoord2f(1, 1); glVertex2f( 163, 129); + glTexCoord2f(1, 0); glVertex2f( 163, -129); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); @@ -827,11 +830,11 @@ begin end; // Commandio (flip in from down, flip out to upper right) - STime := Timings[12]-10; - Delay := Timings[13]-Timings[12]; + STime := Timings[12] - 10; + Delay := Timings[13] - Timings[12]; if CTime > STime then begin - k:=0; + k := 0; ESC_Alpha := 20; try @@ -864,7 +867,7 @@ begin j := (STime + Delay) - CTime else j := 0; - glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); if (CTime >= STime + 10) and (CTime <= STime + 12) then begin @@ -880,9 +883,9 @@ begin end; glPushMatrix; - gltranslatef(223,329,0); + gltranslatef(223, 329, 0); if CTime <= STime + 10 then - f:=258.0-25.8*(CTime-STime) + f := 258.0 - 25.8 * (CTime - STime) else f := 0; g := 0; @@ -897,10 +900,10 @@ begin glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163+g-f*1.5, -129+f*1.5-g/2); - glTexCoord2f(0,1);glVertex2f(-163+g*1.5, 129-(g*1.5*258/326)); - glTexCoord2f(1,1); glVertex2f(163+g, 129+g/4); - glTexCoord2f(1,0);glVertex2f(163+f*1.5+g/4, -129+f*1.5-g/4); + glTexCoord2f(0, 0); glVertex2f(-163 + g - f * 1.5, -129 + f * 1.5 - g/2); + glTexCoord2f(0, 1); glVertex2f(-163 + g * 1.5, 129 - (g * 1.5 * 258 / 326)); + glTexCoord2f(1, 1); glVertex2f( 163 + g, 129 + g / 4); + glTexCoord2f(1, 0); glVertex2f( 163 + f * 1.5 + g / 4, -129 + f * 1.5 - g / 4); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); @@ -908,11 +911,11 @@ begin end; // lazy joker (just scrolls from left to right, no twinkling stars, no on-beat flashing) - STime := Timings[13]-35; - Delay := Timings[14]-Timings[13]+5; + STime := Timings[13] - 35; + Delay := Timings[14] - Timings[13] + 5; if CTime > STime then begin - k:=0; + k := 0; try for j := 0 to 40 do @@ -933,32 +936,32 @@ begin inc(ESC_Alpha); if ESC_Alpha > 20 then ESC_Alpha := 20; - if ((CTime-STime)>10) and ((CTime - STime) < 20) then + if ((CTime - STime) > 10) and ((CTime - STime) < 20) then ESC_Alpha := 20; - ESC_Alpha:=10; - f:=CTime-STime; - if CTime <=STime+40 then + ESC_Alpha := 10; + f := CTime - STime; + if CTime <= STime + 40 then j := CTime - STime else - j:=40; - if (CTime >=STime+Delay-40) then + j := 40; + if (CTime >= STime + Delay - 40) then if (CTime <= STime + Delay) then j := (STime + Delay) - CTime else j := 0; - glColor4f(1, 1, 1, ESC_Alpha/20*j*j/1600); + glColor4f(1, 1, 1, ESC_Alpha / 20 * j * j / 1600); glPushMatrix; - gltranslatef(180+(f-70),329,0); + gltranslatef(180 + (f - 70), 329, 0); glBindTexture(GL_TEXTURE_2D, credits_lazyjoker.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163, -129); - glTexCoord2f(0,1);glVertex2f(-163, 129); - glTexCoord2f(1,1); glVertex2f(163, 129); - glTexCoord2f(1,0);glVertex2f(163, -129); + glTexCoord2f(0, 0); glVertex2f(-163, -129); + glTexCoord2f(0, 1); glVertex2f(-163, 129); + glTexCoord2f(1, 1); glVertex2f( 163, 129); + glTexCoord2f(1, 0); glVertex2f( 163, -129); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); @@ -966,11 +969,11 @@ begin end; // Mog (flip in from right, flip out to lower right) - STime := Timings[14]-10; - Delay := Timings[15]-Timings[14]+5; + STime := Timings[14] - 10; + Delay := Timings[15] - Timings[14] + 5; if CTime > STime then begin - k:=0; + k := 0; ESC_Alpha := 20; try @@ -1003,7 +1006,7 @@ begin j := (STime + Delay) - CTime else j := 0; - glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); if (CTime >= STime + 10) and (CTime <= STime + 12) then begin @@ -1019,27 +1022,28 @@ begin end; glPushMatrix; - gltranslatef(223,329,0); + gltranslatef(223, 329, 0); if CTime <= STime + 10 then f := 326.0 - 32.6 * (CTime - STime) else f := 0; g := 0; - if CTime >= STime + Delay - 10 then if CTime <= STime + Delay then - begin - j := CTime - (STime + Delay - 10); - g := 32.6 * j; - end; + if CTime >= STime + Delay - 10 then + if CTime <= STime + Delay then + begin + j := CTime - (STime + Delay - 10); + g := 32.6 * j; + end; glBindTexture(GL_TEXTURE_2D, credits_mog.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163+g*1.5, -129+g*1.5); - glTexCoord2f(0,1);glVertex2f(-163+g*1.2, 129+g); - glTexCoord2f(1,1); glVertex2f(163-f+g/2, 129+f*1.5+g/4); - glTexCoord2f(1,0);glVertex2f(163-f+g*1.5, -129-f*1.5); + glTexCoord2f(0, 0); glVertex2f(-163 + g * 1.5, -129 + g * 1.5); + glTexCoord2f(0, 1); glVertex2f(-163 + g * 1.2, 129 + g); + glTexCoord2f(1, 1); glVertex2f( 163 - f + g / 2, 129 + f * 1.5 + g / 4); + glTexCoord2f(1, 0); glVertex2f( 163 - f + g * 1.5, -129 - f * 1.5); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); @@ -1047,11 +1051,11 @@ begin end; // Mota (rotate in from upper right, shift out to lower left while shrinking and rotateing) - STime := Timings[15]-10; - Delay := Timings[16]-Timings[15]+5; + STime := Timings[15] - 10; + Delay := Timings[16] - Timings[15] + 5; if CTime > STime then begin - k:=0; + k := 0; ESC_Alpha := 20; try @@ -1084,7 +1088,7 @@ begin j := (STime + Delay) - CTime else j := 0; - glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); if (CTime >= STime + 10) and (CTime <= STime + 12) then begin @@ -1100,31 +1104,31 @@ begin end; glPushMatrix; - gltranslatef(223,329,0); + gltranslatef(223, 329, 0); if CTime <= STime + 10 then begin - gltranslatef(223,0,0); - glrotatef((10-(CTime-STime))*9,0,0,1); - gltranslatef(-223,0,0); + gltranslatef(223, 0, 0); + glrotatef((10 - (CTime - STime)) * 9, 0, 0, 1); + gltranslatef(-223, 0, 0); end; if CTime >= STime + Delay - 10 then if CTime <= STime + Delay then begin j := CTime - (STime + Delay - 10); f := j * 10.0; - gltranslatef(-f*2,-f,0); - glscalef(1-j/10,1-j/10,1-j/10); - glrotatef(-j*9.0,0,0,1); + gltranslatef(-f * 2, -f, 0); + glscalef(1 - j / 10, 1 - j / 10, 1 - j / 10); + glrotatef(-j * 9.0, 0, 0, 1); end; glBindTexture(GL_TEXTURE_2D, credits_mota.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163, -129); - glTexCoord2f(0,1);glVertex2f(-163, 129); - glTexCoord2f(1,1); glVertex2f(163, 129); - glTexCoord2f(1,0);glVertex2f(163, -129); + glTexCoord2f(0, 0); glVertex2f(-163, -129); + glTexCoord2f(0, 1); glVertex2f(-163, 129); + glTexCoord2f(1, 1); glVertex2f( 163, 129); + glTexCoord2f(1, 0); glVertex2f( 163, -129); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); @@ -1132,11 +1136,11 @@ begin end; // Skillmaster (shift in from lower right, rotate out to upper right) - STime := Timings[16]-10; - Delay := Timings[17]-Timings[16]+5; + STime := Timings[16] - 10; + Delay := Timings[17] - Timings[16] + 5; if CTime > STime then begin - k:=0; + k := 0; ESC_Alpha := 20; try @@ -1169,7 +1173,7 @@ begin j := (STime + Delay) - CTime else j := 0; - glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); if (CTime >= STime + 10) and (CTime <= STime + 12) then begin @@ -1185,31 +1189,31 @@ begin end; glPushMatrix; - gltranslatef(223,329,0); + gltranslatef(223, 329, 0); if CTime <= STime + 10 then begin j := STime + 10 - CTime; f := j * 10.0; - gltranslatef(+f*2,+f/2,0); + gltranslatef(+f * 2, +f / 2, 0); end; if CTime >= STime + Delay - 10 then if CTime <= STime + Delay then begin j := CTime - (STime + Delay - 10); - gltranslatef(0,-223,0); - glrotatef(integer(j)*-9,0,0,1); - gltranslatef(0,223,0); - glrotatef(j*9,0,0,1); + gltranslatef(0, -223, 0); + glrotatef(integer(j) * -9, 0, 0, 1); + gltranslatef(0, 223, 0); + glrotatef(j * 9, 0, 0, 1); end; glBindTexture(GL_TEXTURE_2D, credits_skillmaster.TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163, -129); - glTexCoord2f(0,1);glVertex2f(-163, 129); - glTexCoord2f(1,1); glVertex2f(163, 129); - glTexCoord2f(1,0);glVertex2f(163, -129); + glTexCoord2f(0, 0); glVertex2f(-163, -129); + glTexCoord2f(0, 1); glVertex2f(-163, 129); + glTexCoord2f(1, 1); glVertex2f( 163, 129); + glTexCoord2f(1, 0); glVertex2f( 163, -129); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); @@ -1221,7 +1225,7 @@ begin Delay := Timings[18] - Timings[17]; if CTime > STime then begin - k:=0; + k := 0; ESC_Alpha := 20; try @@ -1254,7 +1258,7 @@ begin j := (STime + Delay) - CTime else j := 0; - glColor4f(1, 1, 1, ESC_Alpha/20*j/10); + glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); if (CTime >= STime + 10) and (CTime <= STime + 12) then begin @@ -1270,7 +1274,7 @@ begin end; glPushMatrix; - gltranslatef(223,329,0); + gltranslatef(223, 329, 0); if CTime <= STime + 10 then f := 326.0 - 32.6 * (CTime - STime) else @@ -1291,17 +1295,17 @@ begin glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(-163-f+g, -129+f/4-g/2); - glTexCoord2f(0,1);glVertex2f(-163-f/4+g, 129+g/2+f/4); - glTexCoord2f(1,1);glVertex2f( 163-f*1.2+g/4, 129+f/2-g/4); - glTexCoord2f(1,0);glVertex2f( 163-f*1.5+g/4, -129+f*1.5+g/4); + glTexCoord2f(0, 0); glVertex2f(-163 - f + g, -129 + f / 4 - g / 2); + glTexCoord2f(0, 1); glVertex2f(-163 - f / 4 + g, 129 + g / 2 + f / 4); + glTexCoord2f(1, 1); glVertex2f( 163 - f * 1.2 + g / 4, 129 + f / 2 - g / 4); + glTexCoord2f(1, 0); glVertex2f( 163 - f * 1.5 + g / 4, -129 + f * 1.5 + g / 4); glEnd; gldisable(gl_texture_2d); gldisable(GL_BLEND); glPopMatrix; end; - Log.LogStatus('',' JB-103'); + Log.LogStatus('', ' JB-103'); // #################################################################### // do some twinkle stuff (kinda on beat) @@ -1326,15 +1330,15 @@ begin if Data[k] > 0.2 then begin - l := RandomRange(6,16); - j := RandomRange(0,27); + l := RandomRange(6, 16); + j := RandomRange(0, 27); GoldenRec.Spawn(myLogoCoords[j,0], myLogoCoords[j,1], 16-l, l, 0, -1, PerfectNote, 0); end; end; //################################################# - // draw the rest of the main screen (girl and logo + // draw the rest of the main screen (girl and logo) glEnable(GL_TEXTURE_2D); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -1342,21 +1346,21 @@ begin glColor4f(1, 1, 1, 1); glBindTexture(GL_TEXTURE_2D, credits_bg_ovl.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(800-393, 0); - glTexCoord2f(0,600/1024);glVertex2f(800-393, 600); - glTexCoord2f(393/512,600/1024); glVertex2f(800, 600); - glTexCoord2f(393/512,0);glVertex2f(800, 0); + glTexCoord2f( 0, 0); glVertex2f(800-393, 0); + glTexCoord2f( 0, 600/1024); glVertex2f(800-393, 600); + glTexCoord2f(393/512, 600/1024); glVertex2f(800, 600); + glTexCoord2f(393/512, 0); glVertex2f(800, 0); glEnd; - { +{ glBindTexture(GL_TEXTURE_2D, credits_bg_logo.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(0, 0); - glTexCoord2f(0,112/128);glVertex2f(0, 112); - glTexCoord2f(497/512,112/128); glVertex2f(497, 112); - glTexCoord2f(497/512,0);glVertex2f(497, 0); + glTexCoord2f( 0, 0); glVertex2f( 0, 0); + glTexCoord2f( 0, 112/128); glVertex2f( 0, 112); + glTexCoord2f(497/512, 112/128); glVertex2f(497, 112); + glTexCoord2f(497/512, 0); glVertex2f(497, 0); glEnd; - } +} gldisable(gl_texture_2d); glDisable(GL_BLEND); @@ -1364,13 +1368,13 @@ begin // fade out at end of main part if Ctime > Timings[19] then begin - glColor4f(0,0,0,(Ctime-Timings[19])/(Timings[20]-Timings[19])); + glColor4f(0, 0, 0, (CTime - Timings[19]) / (Timings[20] - Timings[19])); glEnable(GL_BLEND); glBegin(GL_QUADS); - glVertex2f(0,0); - glVertex2f(0,600); - glVertex2f(800,600); - glVertex2f(800,0); + glVertex2f( 0, 0); + glVertex2f( 0, 600); + glVertex2f(800, 600); + glVertex2f(800, 0); glEnd; glDisable(GL_BLEND); end; @@ -1392,7 +1396,7 @@ begin AudioPlayback.Play; Ctime_hold := 0; end; - glClearColor(0,0,0,0); + glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); // do something useful @@ -1404,20 +1408,20 @@ begin glColor4f(1, 1, 1, 1); glBindTexture(GL_TEXTURE_2D, outro_bg.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(0, 0); - glTexCoord2f(0,600/1024);glVertex2f(0, 600); - glTexCoord2f(800/1024,600/1024); glVertex2f(800, 600); - glTexCoord2f(800/1024,0);glVertex2f(800, 0); + glTexCoord2f( 0, 0); glVertex2f( 0, 0); + glTexCoord2f( 0, 600/1024); glVertex2f( 0, 600); + glTexCoord2f(800/1024, 600/1024); glVertex2f(800, 600); + glTexCoord2f(800/1024, 0); glVertex2f(800, 0); glEnd; - //outro overlays - glColor4f(1, 1, 1, (1+sin(CTime/15))/3+1/3); + // outro overlays + glColor4f(1, 1, 1, (1 + sin(CTime / 15)) / 3 + 1/3); glBindTexture(GL_TEXTURE_2D, outro_esc.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(0, 0); - glTexCoord2f(0,223/256);glVertex2f(0, 223); - glTexCoord2f(487/512,223/256); glVertex2f(487, 223); - glTexCoord2f(487/512,0);glVertex2f(487, 0); + glTexCoord2f( 0, 0); glVertex2f( 0, 0); + glTexCoord2f( 0, 223/256); glVertex2f( 0, 223); + glTexCoord2f(487/512, 223/256); glVertex2f(487, 223); + glTexCoord2f(487/512, 0); glVertex2f(487, 0); glEnd; ESC_Alpha := 20; @@ -1427,13 +1431,13 @@ begin inc(ESC_Alpha); if ESC_Alpha > 20 then ESC_Alpha := 20; - glColor4f(1, 1, 1, ESC_Alpha/20); + glColor4f(1, 1, 1, ESC_Alpha / 20); glBindTexture(GL_TEXTURE_2D, outro_exd.TexNum); glbegin(gl_quads); - glTexCoord2f(0,0);glVertex2f(800-310, 600-247); - glTexCoord2f(0,247/256);glVertex2f(800-310, 600); - glTexCoord2f(310/512,247/256); glVertex2f(800, 600); - glTexCoord2f(310/512,0);glVertex2f(800, 600-247); + glTexCoord2f( 0, 0); glVertex2f(800-310, 600-247); + glTexCoord2f( 0, 247/256); glVertex2f(800-310, 600 ); + glTexCoord2f(310/512, 247/256); glVertex2f(800, 600 ); + glTexCoord2f(310/512, 0); glVertex2f(800, 600-247); glEnd; glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); @@ -1442,17 +1446,17 @@ begin // ... end; - { +{ // draw credits runtime counter - SetFontStyle (2); + SetFontStyle (2); SetFontItalic(false); SetFontSize(27); SetFontPos (5, 5); glColor4f(1, 1, 1, 1); - //RuntimeStr := 'CTime: '+inttostr(floor(CTime/30.320663991914489602156136106092))+'.'+inttostr(floor(CTime/3.0320663991914489602156136106092)-floor(CTime/30.320663991914489602156136106092)*10); +// RuntimeStr := 'CTime: ' + inttostr(floor(CTime / 30.320663991914489602156136106092)) + '.' + inttostr(floor(CTime / 3.0320663991914489602156136106092) - floor(CTime / 30.320663991914489602156136106092) * 10); RuntimeStr := 'CTime: ' + inttostr(CTime); glPrint (RuntimeStr[1]); - } +} // make the stars shine GoldenRec.Draw; -- cgit v1.2.3 From 7cf14a865954a7208f76421a396ea33c3cc87ab9 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 25 Apr 2009 18:18:53 +0000 Subject: correcting typos from cosmetics git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1699 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index 1d0e5466..def6b7de 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -108,8 +108,8 @@ type const Funky_Text: string = - 'Grandma Deluxe has arrived! Thanks to Corvus5 for the massive work on UltraStar, Wome for the nice tune you're hearing, '+ - 'all the people who put massive effort and work in new songs (don't forget UltraStar w/o songs would be nothing), ppl from '+ + 'Grandma Deluxe has arrived! Thanks to Corvus5 for the massive work on UltraStar, Wome for the nice tune you are hearing, '+ + 'all the people who put massive effort and work in new songs (do not forget UltraStar w/o songs would be nothing), ppl from '+ 'irc helping us - eBandit and Gabari, scene ppl who really helped instead of compiling and running away. Greetings to DennisTheMenace for betatesting, '+ 'Demoscene.tv, pouet.net, KakiArts, Sourceforge,..'; -- cgit v1.2.3 From 917901e8e33438c425aef50a0a7417f32d77b760 Mon Sep 17 00:00:00 2001 From: s_alexander Date: Mon, 9 Nov 2009 00:27:55 +0000 Subject: merged unicode branch (r1931) into trunk git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1939 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 97 +++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 48 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index def6b7de..b1333b4a 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -35,15 +35,16 @@ interface uses SysUtils, - UMenu, SDL, SDL_Image, + gl, + UMenu, UDisplay, UTexture, - gl, UMusic, UFiles, UThemes, + UPath, UGraphicClasses; type @@ -98,10 +99,10 @@ type Fadeout: boolean; constructor Create; override; - function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override; + function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; function Draw: boolean; override; - procedure onShow; override; - procedure onHide; override; + procedure OnShow; override; + procedure OnHide; override; procedure DrawCredits; procedure Draw_FunkyText; end; @@ -138,17 +139,17 @@ const OUTRO_EXD_FILE = 'outro-exit-dark.png'; Timings: array[0..21] of cardinal=( - 20, // 0 Delay vor Start + 20, // 0 Delay before Start - 149, // 1 Ende erster Intro Zoom - 155, // 2 Start 2. Action im Intro - 170, // 3 Ende Separation im Intro - 271, // 4 Anfang Zoomout im Intro + 149, // 1 End first Intro Zoom + 155, // 2 Start 2. Action in Intro + 170, // 3 End Separation in Intro + 271, // 4 beginning Zoomout in Intro 0, // 5 unused - 261, // 6 Start fade-to-white im Intro + 261, // 6 Start fade-to-white in Intro 271, // 7 Start Main Part - 280, // 8 Start On-Beat-Sternchen Main Part + 280, // 8 Start On-Beat-Star Main Part 396, // 9 Start BlindGuard 666, // 10 Start blindy @@ -162,7 +163,7 @@ const 2826, // 18 Ende Whiteshark 3096, // 19 Start FadeOut Mainscreen 3366, // 20 Ende Credits Tune - 60); // 21 start flare im intro + 60); // 21 start flare in intro implementation @@ -176,9 +177,9 @@ uses Textgl, ULanguage, UCommon, - UPath; + UPathUtils; -function TScreenCredits.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; +function TScreenCredits.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; begin Result := true; if (PressedDown) then @@ -204,38 +205,38 @@ end; constructor TScreenCredits.Create; var - CreditsPath: string; + CreditsPath: IPath; begin inherited Create; - CreditsPath := ResourcesPath + 'credits/'; - - credits_bg_tex := Texture.LoadTexture(CreditsPath + CRDTS_BG_FILE, TEXTURE_TYPE_PLAIN, 0); - credits_bg_ovl := Texture.LoadTexture(CreditsPath + CRDTS_OVL_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - - credits_blindguard := Texture.LoadTexture(CreditsPath + CRDTS_blindguard_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - credits_blindy := Texture.LoadTexture(CreditsPath + CRDTS_blindy_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - credits_canni := Texture.LoadTexture(CreditsPath + CRDTS_canni_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - credits_commandio := Texture.LoadTexture(CreditsPath + CRDTS_commandio_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - credits_lazyjoker := Texture.LoadTexture(CreditsPath + CRDTS_lazyjoker_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - credits_mog := Texture.LoadTexture(CreditsPath + CRDTS_mog_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - credits_mota := Texture.LoadTexture(CreditsPath + CRDTS_mota_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - credits_skillmaster := Texture.LoadTexture(CreditsPath + CRDTS_skillmaster_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - credits_whiteshark := Texture.LoadTexture(CreditsPath + CRDTS_whiteshark_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - - intro_layer01 := Texture.LoadTexture(CreditsPath + INTRO_L01_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer02 := Texture.LoadTexture(CreditsPath + INTRO_L02_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer03 := Texture.LoadTexture(CreditsPath + INTRO_L03_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer04 := Texture.LoadTexture(CreditsPath + INTRO_L04_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer05 := Texture.LoadTexture(CreditsPath + INTRO_L05_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer06 := Texture.LoadTexture(CreditsPath + INTRO_L06_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer07 := Texture.LoadTexture(CreditsPath + INTRO_L07_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer08 := Texture.LoadTexture(CreditsPath + INTRO_L08_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - intro_layer09 := Texture.LoadTexture(CreditsPath + INTRO_L09_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - - outro_bg := Texture.LoadTexture(CreditsPath + OUTRO_BG_FILE, TEXTURE_TYPE_PLAIN, 0); - outro_esc := Texture.LoadTexture(CreditsPath + OUTRO_ESC_FILE, TEXTURE_TYPE_TRANSPARENT, 0); - outro_exd := Texture.LoadTexture(CreditsPath + OUTRO_EXD_FILE, TEXTURE_TYPE_TRANSPARENT, 0); + CreditsPath := ResourcesPath.Append('credits', pdAppend); + + credits_bg_tex := Texture.LoadTexture(CreditsPath.Append(CRDTS_BG_FILE), TEXTURE_TYPE_PLAIN, 0); + credits_bg_ovl := Texture.LoadTexture(CreditsPath.Append(CRDTS_OVL_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + + credits_blindguard := Texture.LoadTexture(CreditsPath.Append(CRDTS_blindguard_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + credits_blindy := Texture.LoadTexture(CreditsPath.Append(CRDTS_blindy_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + credits_canni := Texture.LoadTexture(CreditsPath.Append(CRDTS_canni_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + credits_commandio := Texture.LoadTexture(CreditsPath.Append(CRDTS_commandio_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + credits_lazyjoker := Texture.LoadTexture(CreditsPath.Append(CRDTS_lazyjoker_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + credits_mog := Texture.LoadTexture(CreditsPath.Append(CRDTS_mog_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + credits_mota := Texture.LoadTexture(CreditsPath.Append(CRDTS_mota_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + credits_skillmaster := Texture.LoadTexture(CreditsPath.Append(CRDTS_skillmaster_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + credits_whiteshark := Texture.LoadTexture(CreditsPath.Append(CRDTS_whiteshark_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + + intro_layer01 := Texture.LoadTexture(CreditsPath.Append(INTRO_L01_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer02 := Texture.LoadTexture(CreditsPath.Append(INTRO_L02_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer03 := Texture.LoadTexture(CreditsPath.Append(INTRO_L03_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer04 := Texture.LoadTexture(CreditsPath.Append(INTRO_L04_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer05 := Texture.LoadTexture(CreditsPath.Append(INTRO_L05_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer06 := Texture.LoadTexture(CreditsPath.Append(INTRO_L06_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer07 := Texture.LoadTexture(CreditsPath.Append(INTRO_L07_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer08 := Texture.LoadTexture(CreditsPath.Append(INTRO_L08_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + intro_layer09 := Texture.LoadTexture(CreditsPath.Append(INTRO_L09_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + + outro_bg := Texture.LoadTexture(CreditsPath.Append(OUTRO_BG_FILE), TEXTURE_TYPE_PLAIN, 0); + outro_esc := Texture.LoadTexture(CreditsPath.Append(OUTRO_ESC_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + outro_exd := Texture.LoadTexture(CreditsPath.Append(OUTRO_EXD_FILE), TEXTURE_TYPE_TRANSPARENT, 0); CRDTS_Stage:=InitialDelay; end; @@ -246,7 +247,7 @@ begin Draw := true; end; -procedure TScreenCredits.onShow; +procedure TScreenCredits.OnShow; begin inherited; @@ -255,13 +256,13 @@ begin deluxe_slidein := 0; Credits_Alpha := 0; // Music.SetLoop(true); loop loops not, shit - AudioPlayback.Open(soundpath + 'wome-credits-tune.mp3'); // thank you wetue + AudioPlayback.Open(soundpath.Append('wome-credits-tune.mp3')); // thank you wetue // Music.Play; CTime := 0; // setlength(CTime_hold,0); end; -procedure TScreenCredits.onHide; +procedure TScreenCredits.OnHide; begin AudioPlayback.Stop; end; @@ -1386,7 +1387,7 @@ begin begin CTime_hold := 0; AudioPlayback.Stop; - AudioPlayback.Open(soundpath + 'credits-outro-tune.mp3'); + AudioPlayback.Open(SoundPath.Append('credits-outro-tune.mp3')); AudioPlayback.SetVolume(0.2); AudioPlayback.SetLoop(true); AudioPlayback.Play; -- cgit v1.2.3 From 588095fb82564c2abf34278e8d0767d92ccb463e Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 17 Jun 2010 13:58:55 +0000 Subject: pause bg music during credits git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2535 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index b1333b4a..a428cb15 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -251,6 +251,9 @@ procedure TScreenCredits.OnShow; begin inherited; + // pause background music + SoundLib.PauseBgMusic; + CRDTS_Stage := InitialDelay; Credits_X := 580; deluxe_slidein := 0; @@ -265,6 +268,8 @@ end; procedure TScreenCredits.OnHide; begin AudioPlayback.Stop; + + SoundLib.StartBgMusic; end; Procedure TScreenCredits.Draw_FunkyText; -- cgit v1.2.3 From f53aa00aaef03e3c28f4e9b71184ce2668472b38 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 17 Jun 2010 14:45:09 +0000 Subject: - enter credits screen after 30 seconds w/o user interaction in main screen - leave credits screen w/ left / right mouse button, enter, return, escape and backspace git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2536 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index a428cb15..b87af6bd 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -187,7 +187,8 @@ begin case PressedKey of SDLK_ESCAPE, - SDLK_BACKSPACE : + SDLK_BACKSPACE, + SDLK_RETURN : begin FadeTo(@ScreenMain); AudioPlayback.PlaySound(SoundLib.Back); -- cgit v1.2.3 From db764b0ef728dbcf746076dcfbbffa7207509262 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 30 Jun 2010 09:29:54 +0000 Subject: - code restructured (e.g.: more comments, well named comments) => its very much easier to make changes now - implemented new (working) beat detection algorithm - comments added - mouse move easter egg added to intro (needs some adjustment) - "Funky Text" still needs an updated git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2566 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 2108 +++++++++++++++++++--------------------- 1 file changed, 980 insertions(+), 1128 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index b87af6bd..468b4e84 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -47,16 +47,28 @@ uses UPath, UGraphicClasses; +{ beat detection constants and types } +const + SubChannelCount = 32; + HistoryLength = 44; + SamplesPerChannel = (FFTSize div 2) div SubChannelCount; + BeatEnergyModifier = 80; // modifies detected energy + // higher values equal a more sensitive detection + +type + TEnergyHistory = array [0..HistoryLength-1] of single; + TSubchannelHistory = array [0..SubChannelCount-1] of TEnergyHistory; + type TCreditsStages=(InitialDelay, Intro, MainPart, Outro); TScreenCredits = class(TMenu) - public + private + CreditsPath: IPath; Credits_X: real; Credits_Time: cardinal; Credits_Alpha: cardinal; - CTime: cardinal; CTime_hold: cardinal; ESC_Alpha: integer; @@ -66,15 +78,7 @@ type credits_bg_ovl: TTexture; //credits_bg_logo: TTexture; credits_bg_scrollbox_left: TTexture; - credits_blindguard: TTexture; - credits_blindy: TTexture; - credits_canni: TTexture; - credits_commandio: TTexture; - credits_lazyjoker: TTexture; - credits_mog: TTexture; - credits_mota: TTexture; - credits_skillmaster: TTexture; - credits_whiteshark: TTexture; + credits_names: array of TTexture; intro_layer01: TTexture; intro_layer02: TTexture; intro_layer03: TTexture; @@ -97,14 +101,53 @@ type CRDTS_Stage: TCreditsStages; + { beat detection } + SubChannelHistory: TSubchannelHistory; + + { mouse movement easter eggs: } + MouseMoved: boolean; + MouseX, MouseY: double; + + procedure LoadNameTextures; + + { draw different stages } + procedure DrawInitialDelay; + + { Intro } + procedure DrawIntro; + procedure DrawLayeredLogo(Separation, Scale, AngleX, AngleY, AngleZ: single); + + { Main } + procedure DrawMain; + procedure DrawMainBG; + procedure DrawFunkyText; + + procedure DrawMainFG; + + procedure DrawNames; + procedure DoLogoBling; + + { Outro } + procedure DrawOutro; + + + { beat detection } + procedure DetectBeat; + protected + { beat detection stuff + protected cause we need this information for "on beat + effect"} + LastBeatTime: cardinal; + BeatDetected: boolean; + CTime: cardinal; + public Fadeout: boolean; constructor Create; override; function ParseInput(PressedKey: cardinal; CharCode: UCS4Char; PressedDown: boolean): boolean; override; - function Draw: boolean; override; + function ParseMouse(MouseButton: integer; BtnDown: boolean; X, Y: integer): boolean; override; procedure OnShow; override; procedure OnHide; override; - procedure DrawCredits; - procedure Draw_FunkyText; + function Draw: boolean; override; end; const @@ -114,17 +157,9 @@ const 'irc helping us - eBandit and Gabari, scene ppl who really helped instead of compiling and running away. Greetings to DennisTheMenace for betatesting, '+ 'Demoscene.tv, pouet.net, KakiArts, Sourceforge,..'; +{ texture names (loaded from gameshared/resources/credits} CRDTS_BG_FILE = 'credits_v5_bg.png'; CRDTS_OVL_FILE = 'credits_v5_overlay.png'; - CRDTS_blindguard_FILE = 'names_blindguard.png'; - CRDTS_blindy_FILE = 'names_blindy.png'; - CRDTS_canni_FILE = 'names_canni.png'; - CRDTS_commandio_FILE = 'names_commandio.png'; - CRDTS_lazyjoker_FILE = 'names_lazyjoker.png'; - CRDTS_mog_FILE = 'names_mog.png'; - CRDTS_mota_FILE = 'names_mota.png'; - CRDTS_skillmaster_FILE = 'names_skillmaster.png'; - CRDTS_whiteshark_FILE = 'names_whiteshark.png'; INTRO_L01_FILE = 'intro-l-01.png'; INTRO_L02_FILE = 'intro-l-02.png'; INTRO_L03_FILE = 'intro-l-03.png'; @@ -138,32 +173,83 @@ const OUTRO_ESC_FILE = 'outro-esc.png'; OUTRO_EXD_FILE = 'outro-exit-dark.png'; - Timings: array[0..21] of cardinal=( - 20, // 0 Delay before Start - - 149, // 1 End first Intro Zoom - 155, // 2 Start 2. Action in Intro - 170, // 3 End Separation in Intro - 271, // 4 beginning Zoomout in Intro - 0, // 5 unused - 261, // 6 Start fade-to-white in Intro - - 271, // 7 Start Main Part - 280, // 8 Start On-Beat-Star Main Part - - 396, // 9 Start BlindGuard - 666, // 10 Start blindy - 936, // 11 Start Canni - 1206, // 12 Start Commandio - 1476, // 13 Start LazyJoker - 1746, // 14 Start Mog - 2016, // 15 Start Mota - 2286, // 16 Start SkillMaster - 2556, // 17 Start WhiteShark - 2826, // 18 Ende Whiteshark - 3096, // 19 Start FadeOut Mainscreen - 3366, // 20 Ende Credits Tune - 60); // 21 start flare in intro +{ some timings } + Delay_Before_Start = 20; + Intro_Flare_Start = 60; + Intro_Zoom_End = 149; + Intro_Stand_End = 155; + Intro_Separation_End = 170; + Intro_FadeToWhite_Start = 261; + Intro_Zoomout_Start = 271; + Main_Start = 271; + Main_OnBeatTwinkle_Start = 280; + Main_Names_Start = 359; + Main_Names_End = 2833; + Main_FadeOut_Start = 3096; + Tune_End = 3366; + +{ cosntants for developer names } + +type + TFadeEffect = procedure (const Tex: TTexture; Progress: double); + TCRTZ_Developer = record + Name: string; // developer name for texture loading (names_"devel".png) + Twinkle: boolean; // should there be twinkles on show + FadeIn: TFadeEffect; // fade in effect + Draw: TFadeEffect; // effect during draw + FadeOut: TFadeEffect; // fade out effect + end; + +{ effects are called with blending, texture and matrix prepared } +procedure Effect_Draw (const Tex: TTexture; Progress: double); +procedure Effect_OnBeatJitter (const Tex: TTexture; Progress: double); + +procedure Effect_Rotate_Left_Top (const Tex: TTexture; Progress: double); +procedure Effect_Rotate_Right_Bot (const Tex: TTexture; Progress: double); +procedure Effect_ZoomIn_Rotate (const Tex: TTexture; Progress: double); +procedure Effect_ZoomOut_Shift (const Tex: TTexture; Progress: double); +procedure Effect_Shift_Left (const Tex: TTexture; Progress: double); +procedure Effect_Shift_Right_Top (const Tex: TTexture; Progress: double); +procedure Effect_Flip_Bot (const Tex: TTexture; Progress: double); +procedure Effect_Flip_Right_Top (const Tex: TTexture; Progress: double); +procedure Effect_Flip_Right (const Tex: TTexture; Progress: double); +procedure Effect_Flip_Right_Bot (const Tex: TTexture; Progress: double); +procedure Effect_Rotate_Right_Top (const Tex: TTexture; Progress: double); +procedure Effect_Shift_Weird (const Tex: TTexture; Progress: double); +procedure Effect_Shift_Right_Bot (const Tex: TTexture; Progress: double); +procedure Effect_Rotate_Right_Top2(const Tex: TTexture; Progress: double); +procedure Effect_Flip_Left_Bot (const Tex: TTexture; Progress: double); +procedure Effect_Flip_Right_Top2 (const Tex: TTexture; Progress: double); +procedure Effect_Twinkle_Down (const Tex: TTexture; Progress: double); + +const + Developers: array[0..10] of TCRTZ_Developer = ( + (Name: 'alexanders'; Twinkle: true; FadeIn: Effect_Rotate_Left_Top; Draw: Effect_OnBeatJitter; FadeOut: Effect_Rotate_Right_Bot), + (Name: 'blindy'; Twinkle: true; FadeIn: Effect_ZoomIn_Rotate; Draw: Effect_OnBeatJitter; FadeOut: Effect_ZoomOut_Shift), + (Name: 'brunzel'; Twinkle: true; FadeIn: Effect_Shift_Left; Draw: Effect_Draw; FadeOut: Effect_Shift_Right_Top), + (Name: 'canni'; Twinkle: true; FadeIn: Effect_Flip_Bot; Draw: Effect_Draw; FadeOut: Effect_Flip_Right_Top), + (Name: 'hennymcc'; Twinkle: true; FadeIn: Effect_Flip_Right; Draw: Effect_OnBeatJitter; FadeOut: Effect_Flip_Right_Bot), + (Name: 'jaybinks'; Twinkle: true; FadeIn: Effect_Rotate_Right_Top; Draw: Effect_OnBeatJitter; FadeOut: Effect_Shift_Weird), + (Name: 'krueger'; Twinkle: true; FadeIn: Effect_Shift_Right_Bot; Draw: Effect_OnBeatJitter; FadeOut: Effect_Rotate_Right_Top2), + (Name: 'mezzox'; Twinkle: true; FadeIn: Effect_Flip_Left_Bot; Draw: Effect_OnBeatJitter; FadeOut: Effect_Flip_Right_Top), + (Name: 'mischi'; Twinkle: true; FadeIn: Effect_Shift_Weird; Draw: Effect_OnBeatJitter; FadeOut: Effect_Flip_Bot), + (Name: 'mog'; Twinkle: false; FadeIn: Effect_Twinkle_Down; Draw: Effect_OnBeatJitter; FadeOut: Effect_ZoomIn_Rotate), + (Name: 'whiteshark'; Twinkle: true; FadeIn: Effect_Rotate_Right_Top2; Draw: Effect_OnBeatJitter; FadeOut: Effect_Shift_Left) + ); + + { name specific times } + TimePerName = (Main_Names_End - Main_Names_Start) div Length(Developers); + NameFadeTime = 12; // duration of fade in/out in 1/100 secs + NameWaitTime = 5; // delay between fade out and fade in of the next devel in 1/100 secs + NameTwinkleTime = 2; // duration of star effects in 1/100 secs + BeatJitterTime = 3; // duration of on beat jitter effect + { position at which the names show up + note: due to use of translate this is the center + of the names not the upper left corner as usual } + NameX = 223; + NameY = 329; + NameW = 326; + NameH = 258; implementation @@ -204,9 +290,30 @@ begin end; // fi end; +function TScreenCredits.ParseMouse(MouseButton: integer; BtnDown: boolean; X, Y: integer): boolean; +begin + Result := inherited ParseMouse(MouseButton, BtnDown, X, Y); + + { calculate mouse coordinates from -1 to 1 + relative to screen center } + MouseX := (X - (ScreenW / Screens) / 2) / ((ScreenW / Screens) / 2); + MouseY := (Y - ScreenH / 2) / (ScreenH / 2); + + MouseMoved := true; +end; + +procedure TScreenCredits.LoadNameTextures; + var I: integer; +begin + SetLength(credits_names, Length(Developers)); + + for I := 0 to High(Developers) do + begin + credits_names[I] := Texture.LoadTexture(CreditsPath.Append('names_' + Developers[I].Name + '.png'), TEXTURE_TYPE_TRANSPARENT, 0); + end; +end; + constructor TScreenCredits.Create; -var - CreditsPath: IPath; begin inherited Create; @@ -215,15 +322,7 @@ begin credits_bg_tex := Texture.LoadTexture(CreditsPath.Append(CRDTS_BG_FILE), TEXTURE_TYPE_PLAIN, 0); credits_bg_ovl := Texture.LoadTexture(CreditsPath.Append(CRDTS_OVL_FILE), TEXTURE_TYPE_TRANSPARENT, 0); - credits_blindguard := Texture.LoadTexture(CreditsPath.Append(CRDTS_blindguard_FILE), TEXTURE_TYPE_TRANSPARENT, 0); - credits_blindy := Texture.LoadTexture(CreditsPath.Append(CRDTS_blindy_FILE), TEXTURE_TYPE_TRANSPARENT, 0); - credits_canni := Texture.LoadTexture(CreditsPath.Append(CRDTS_canni_FILE), TEXTURE_TYPE_TRANSPARENT, 0); - credits_commandio := Texture.LoadTexture(CreditsPath.Append(CRDTS_commandio_FILE), TEXTURE_TYPE_TRANSPARENT, 0); - credits_lazyjoker := Texture.LoadTexture(CreditsPath.Append(CRDTS_lazyjoker_FILE), TEXTURE_TYPE_TRANSPARENT, 0); - credits_mog := Texture.LoadTexture(CreditsPath.Append(CRDTS_mog_FILE), TEXTURE_TYPE_TRANSPARENT, 0); - credits_mota := Texture.LoadTexture(CreditsPath.Append(CRDTS_mota_FILE), TEXTURE_TYPE_TRANSPARENT, 0); - credits_skillmaster := Texture.LoadTexture(CreditsPath.Append(CRDTS_skillmaster_FILE), TEXTURE_TYPE_TRANSPARENT, 0); - credits_whiteshark := Texture.LoadTexture(CreditsPath.Append(CRDTS_whiteshark_FILE), TEXTURE_TYPE_TRANSPARENT, 0); + LoadNameTextures; intro_layer01 := Texture.LoadTexture(CreditsPath.Append(INTRO_L01_FILE), TEXTURE_TYPE_TRANSPARENT, 0); intro_layer02 := Texture.LoadTexture(CreditsPath.Append(INTRO_L02_FILE), TEXTURE_TYPE_TRANSPARENT, 0); @@ -242,38 +341,341 @@ begin CRDTS_Stage:=InitialDelay; end; -function TScreenCredits.Draw: boolean; -begin - DrawCredits; - Draw := true; -end; - procedure TScreenCredits.OnShow; begin inherited; - // pause background music + { pause background music } SoundLib.PauseBgMusic; CRDTS_Stage := InitialDelay; + CTime := 0; Credits_X := 580; - deluxe_slidein := 0; - Credits_Alpha := 0; -// Music.SetLoop(true); loop loops not, shit + + { open credits tune, we play it after initial delay } AudioPlayback.Open(soundpath.Append('wome-credits-tune.mp3')); // thank you wetue -// Music.Play; - CTime := 0; -// setlength(CTime_hold,0); + + { reset twinkling stars } + GoldenRec.KillAll; + + { reset mouse coords } + MouseMoved := false; + MouseX := 0; + MouseY := 0; + + { hide cursor } + Display.SetCursor; end; procedure TScreenCredits.OnHide; begin AudioPlayback.Stop; + { show cursor } + Display.SetCursor; + SoundLib.StartBgMusic; end; -Procedure TScreenCredits.Draw_FunkyText; +function TScreenCredits.Draw: boolean; + var + T: cardinal; +begin + Result := true; + + // reset beat detection + BeatDetected := false; + + T := SDL_GetTicks() div 33; + if T <> Credits_Time then + begin + Credits_Time := T; + inc(CTime); + inc(CTime_hold); + Credits_X := Credits_X-2; + + if (CRDTS_Stage = InitialDelay) and (CTime >= Delay_Before_Start) then + begin + CRDTS_Stage := Intro; + CTime := 0; + AudioPlayback.Play; + end + else if (CRDTS_Stage = Intro) and (CTime >= Main_Start) then + begin + CRDTS_Stage := MainPart; + end + else if (CRDTS_Stage = MainPart) and (CTime >= Tune_End) then + begin + CRDTS_Stage := Outro; + end; + + // dis does teh muiwk y0r to be translated :-) + DetectBeat; + end; + + case CRDTS_Stage of + InitialDelay: DrawInitialDelay; + Intro: DrawIntro; + MainPart: DrawMain; + Outro: DrawOutro; + end; + + // make the stars shine + GoldenRec.Draw; +end; + +procedure TScreenCredits.DrawInitialDelay; +begin + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); +end; + +procedure TScreenCredits.DrawIntro; + var + Separation, Scale, + AngleX, AngleY, AngleZ: single; + FlareX, FlareY: single; + I: integer; +begin + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); + + { rotate logo anti clockwise and make it grow } + if (CTime >= Intro_Separation_End) then + begin + Separation := 1; + Scale := 1 + sqr(CTime - Intro_Separation_End) / (32 * (Main_Start - Intro_Separation_End)); + AngleX := 0; + AngleY := 0; + AngleZ := 20 * sqr(CTime - Intro_Separation_End) / sqr((Main_Start - Intro_Separation_End) / 2); + end + + { separate layers } + else if (CTime >= Intro_Stand_End) then + begin + Separation := 0.5 + 0.5 * (CTime - Intro_Stand_End) / (Intro_Separation_End - Intro_Stand_End); + Scale := 1; + AngleX := 0; + AngleY := 0; + AngleZ := 0; + end + + { stand still } + else if (CTime >= Intro_Zoom_End) then + begin + Separation := 0.5; + Scale := 1; + AngleX := 0; + AngleY := 0; + AngleZ := 0; + end + + { rotate left } + else + begin + Separation := 0.5 + 0.5 * (Intro_Zoom_End - CTime) / (Intro_Zoom_End); + Scale := 1; + AngleX := 10 * (Intro_Zoom_End - CTime) / (Intro_Zoom_End); + AngleY := 20 * (Intro_Zoom_End - CTime) / (Intro_Zoom_End); + AngleZ := 0; + end; + + { the user moved the mouse, overwrite X and Y angle with + according to mouse position } + if (MouseMoved) then + begin + AngleX := 30 * MouseY; + AngleY := 30 * MouseX; + end; + + DrawLayeredLogo(Separation, Scale, AngleX, AngleY, AngleZ); + + { do some sparkling effects } + if (CTime < Intro_Zoom_End) and (CTime > Intro_Flare_Start) then + begin + for I := 1 to 3 do + begin + FlareX := 410 + Floor((CTime - Intro_Flare_Start) / (Intro_Zoom_End - Intro_Flare_Start) * (536 - 410)) + RandomRange(-5, 5); + FlareY := Floor((Intro_Zoom_End - CTime) / 22) + RandomRange(285, 301); + GoldenRec.Spawn(FlareX, FlareY, 1, 16, 0, -1, Flare, 0); + end; + end; + + { fade to white at end } + if Ctime > Intro_FadeToWhite_Start then + begin + glColor4f(1, 1, 1, sqr(CTime - Intro_FadeToWhite_Start) * (CTime - Intro_FadeToWhite_Start) / sqr(Main_Start - Intro_FadeToWhite_Start)); + glEnable(GL_BLEND); + glBegin(GL_QUADS); + glVertex2f( 0, 0); + glVertex2f( 0, 600); + glVertex2f(800, 600); + glVertex2f(800, 0); + glEnd; + glDisable(GL_BLEND); + end; +end; + +procedure Start3D; +begin + glMatrixMode(GL_PROJECTION); + glPushMatrix; + glLoadIdentity; + glFrustum(-0.3 * 4 / 3, 0.3 * 4 / 3, -0.3, 0.3, 1, 1000); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity; +end; + +procedure End3D; +begin + glMatrixMode(GL_PROJECTION); + glPopMatrix; + glMatrixMode(GL_MODELVIEW); +end; + +procedure TScreenCredits.DrawLayeredLogo(Separation, Scale, AngleX, AngleY, AngleZ: single); + var + TotalAngle: single; +begin + Start3D; + glPushMatrix; + + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + glTranslatef(0, 0, -5 + 0.5 * Separation); + + TotalAngle := Abs(AngleX) + Abs(AngleY) + Abs(AngleZ); + if not isZero(TotalAngle) then + glRotatef(TotalAngle, AngleX / TotalAngle, AngleY / TotalAngle, AngleZ / TotalAngle); + + glScalef(Scale, Scale, 1); + + glScalef(4/3, -1, 1); + glColor4f(1, 1, 1, 1); + + glBindTexture(GL_TEXTURE_2D, intro_layer01.TexNum); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.4 * Separation); + glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.4 * Separation); + glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.4 * Separation); + glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.4 * Separation); + glEnd; + + glBindTexture(GL_TEXTURE_2D, intro_layer02.TexNum); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.3 * Separation); + glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.3 * Separation); + glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.3 * Separation); + glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.3 * Separation); + glEnd; + + glBindTexture(GL_TEXTURE_2D, intro_layer03.TexNum); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.2 * Separation); + glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.2 * Separation); + glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.2 * Separation); + glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.2 * Separation); + glEnd; + + glBindTexture(GL_TEXTURE_2D, intro_layer04.TexNum); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.1 * Separation); + glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.1 * Separation); + glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.1 * Separation); + glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.1 * Separation); + glEnd; + + glBindTexture(GL_TEXTURE_2D, intro_layer05.TexNum); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0 * Separation); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0 * Separation); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0 * Separation); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0 * Separation); + glEnd; + + glBindTexture(GL_TEXTURE_2D, intro_layer06.TexNum); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.1 * Separation); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.1 * Separation); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.1 * Separation); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.1 * Separation); + glEnd; + + glBindTexture(GL_TEXTURE_2D, intro_layer07.TexNum); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.2 * Separation); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.2 * Separation); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.2 * Separation); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.2 * Separation); + glEnd; + + glBindTexture(GL_TEXTURE_2D, intro_layer08.TexNum); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.3 * Separation); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.3 * Separation); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.3 * Separation); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.3 * Separation); + glEnd; + + glBindTexture(GL_TEXTURE_2D, intro_layer09.TexNum); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.22 * Separation); + glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.22 * Separation); + glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.22 * Separation); + glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.22 * Separation); + glEnd; + + glDisable(Gl_Texture_2D); + glDisable(GL_BLEND); + + glPopMatrix; + End3D; +end; + +procedure TScreenCredits.DrawMain; +begin + DrawMainBG; + DrawFunkyText; + DrawNames; + DrawMainFG; + DoLogoBling; + + // fade out at end of main part + if (Ctime > Main_FadeOut_Start) then + begin + glColor4f(0, 0, 0, (CTime - Main_FadeOut_Start) / (Tune_End - Main_FadeOut_Start)); + glEnable(GL_BLEND); + glBegin(GL_QUADS); + glVertex2f( 0, 0); + glVertex2f( 0, 600); + glVertex2f(800, 600); + glVertex2f(800, 0); + glEnd; + glDisable(GL_BLEND); + end; +end; + +procedure TScreenCredits.DrawMainBG; +begin + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + + glColor4f(1, 1, 1, 1); + glBindTexture(GL_TEXTURE_2D, credits_bg_tex.TexNum); + glBegin(Gl_Quads); + glTexCoord2f( 0, 0); glVertex2f( 0, 0); + glTexCoord2f( 0, 600/1024); glVertex2f( 0, RenderH); + glTexCoord2f(800/1024, 600/1024); glVertex2f(RenderW, RenderH); + glTexCoord2f(800/1024, 0); glVertex2f(RenderW, 0); + glEnd; + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); +end; + +procedure TScreenCredits.DrawFunkyText; var S: integer; X, Y, A: real; @@ -282,7 +684,7 @@ begin SetFontSize(30); // init ScrollingText - if (CTime = Timings[7]) then + if (CTime = Main_Start) then begin // set position of text Credits_X := 600; @@ -290,7 +692,7 @@ begin CurrentScrollEnd := 1; end; - if (CTime > Timings[7]) and + if (CTime > Main_Start) and (CurrentScrollStart < length(Funky_Text)) then begin X := 0; @@ -347,1126 +749,576 @@ begin } end; -procedure Start3D; +procedure TScreenCredits.DrawNames; + var + Dev: integer; + Ticks: integer; + DevTicks: integer; + TwinkleW, TwinkleH: integer; begin - glMatrixMode(GL_PROJECTION); - glPushMatrix; - glLoadIdentity; - glFrustum(-0.3 * 4 / 3, 0.3 * 4 / 3, -0.3, 0.3, 1, 1000); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity; -end; - -procedure End3D; -begin - glMatrixMode(GL_PROJECTION); - glPopMatrix; - glMatrixMode(GL_MODELVIEW); -end; - -procedure TScreenCredits.DrawCredits; -var - T: cardinal; - Data: TFFTData; - j, k, l: cardinal; - f, g: real; - STime: cardinal; - Delay: cardinal; - myScale: real; - myAngle: real; -const - myLogoCoords: array[0..27,0..1] of cardinal = ( - ( 39,32),( 84,32),(100,16),(125,24), - (154,31),(156,58),(168,32),(203,36), - (258,34),(251,50),(274,93),(294,84), - (232,54),(278,62),(319,34),(336,92), - (347,23),(374,32),(377,58),(361,83), - (385,91),(405,91),(429,35),(423,51), - (450,32),(485,34),(444,91),(486,93) - ); -begin - // dis does teh muiwk y0r to be translated :-) - AudioPlayback.GetFFTData(Data); - - Log.LogStatus('', ' JB-1'); - - T := SDL_GetTicks() div 33; - if T <> Credits_Time then + Ticks := (CTime - Main_Names_Start); + Dev := Ticks div TimePerName; + DevTicks := Ticks mod TimePerName; + + {// debug stuff + SetFontPos(20, 20); + glPrint('Ticks: ' + IntToStr(Ticks)); + SetFontPos(20, 45); + glPrint('Dev: ' + IntToStr(Dev)); + SetFontPos(20, 70); + glPrint('DevTicks: ' + IntToStr(DevTicks)); //} + + if (Ticks >= 0) and (Dev <= High(Developers)) then begin - Credits_Time := T; - inc(CTime); - inc(CTime_hold); - Credits_X := Credits_X-2; - - Log.LogStatus('', ' JB-2'); - if (CRDTS_Stage=InitialDelay) and (CTime = Timings[0]) then + { spawn twinkling stars } + if (Developers[Dev].Twinkle) and (DevTicks >= NameFadeTime) and (DevTicks <= NameFadeTime + NameTwinkleTime) then begin -// CTime := Timings[20]; -// CRDTS_Stage := Outro; - CRDTS_Stage := Intro; - CTime := 0; - AudioPlayback.Play; + TwinkleW := Round(NameW * 0.6); + TwinkleH := Round(NameH * 0.6); + + GoldenRec.Spawn(NameX + RandomRange(-TwinkleW, TwinkleW), NameY + RandomRange(-TwinkleH, TwinkleH), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(NameX + RandomRange(-TwinkleW, TwinkleW), NameY + RandomRange(-TwinkleH, TwinkleH), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(NameX + RandomRange(-TwinkleW, TwinkleW), NameY + RandomRange(-TwinkleH, TwinkleH), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(NameX + RandomRange(-TwinkleW, TwinkleW), NameY + RandomRange(-TwinkleH, TwinkleH), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(NameX + RandomRange(-TwinkleW, TwinkleW), NameY + RandomRange(-TwinkleH, TwinkleH), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(NameX + RandomRange(-TwinkleW, TwinkleW), NameY + RandomRange(-TwinkleH, TwinkleH), 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(NameX + RandomRange(-TwinkleW, TwinkleW), NameY + RandomRange(-TwinkleH, TwinkleH), 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(NameX + RandomRange(-TwinkleW, TwinkleW), NameY + RandomRange(-TwinkleH, TwinkleH), 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(NameX + RandomRange(-TwinkleW, TwinkleW), NameY + RandomRange(-TwinkleH, TwinkleH), 1, 16, 0, -1, PerfectLineTwinkle, 5); end; - if (CRDTS_Stage = Intro) and (CTime = Timings[7]) then - begin - CRDTS_Stage := MainPart; - end; - if (CRDTS_Stage = MainPart) and (CTime = Timings[20]) then - begin - CRDTS_Stage := Outro; - end; - end; - - Log.LogStatus('', ' JB-3'); - // draw background - if CRDTS_Stage = InitialDelay then - begin - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); - end - else - if CRDTS_Stage = Intro then - begin - Start3D; + { prepare drawing } glPushMatrix; - - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); - - glEnable(GL_TEXTURE_2D); + glTranslatef(NameX, NameY, 0); + glBindTexture(GL_TEXTURE_2D, credits_names[Dev].TexNum); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); - if CTime < Timings[1] then + // calculate progress and call effect + if (DevTicks <= NameFadeTime) then + Developers[Dev].FadeIn(credits_names[Dev], DevTicks / NameFadeTime) + else if (DevTicks >= TimePerName - NameFadeTime - NameWaitTime) then begin - myScale := 0.5 + 0.5 * (Timings[1] - CTime) / (Timings[1]); // slowly move layers together - myAngle := cos((CTime) * pi / ((Timings[1]) * 2)); // and make logo face towards camera + if (DevTicks < TimePerName - NameWaitTime) then + Developers[Dev].FadeOut(credits_names[Dev], ((TimePerName - NameWaitTime) - DevTicks) / NameFadeTime); end else - begin // this is the part when the logo stands still - myScale := 0.5; - myAngle := 0; - end; - if CTime > Timings[2] then - begin - myScale := 0.5 + 0.5 * (CTime - Timings[2]) / (Timings[3] - Timings[2]); // get some space between layers - myAngle := 0; - end; -// if CTime > Timings[3] then myScale := 1; // keep the space between layers - glTranslatef(0, 0, -5 + 0.5 * myScale); - if CTime > Timings[3] then - myScale := 1; // keep the space between layers - if CTime > Timings[3] then - begin // make logo rotate left and grow -// myScale := (CTime - Timings[4]) / (Timings[7] - Timings[4]); - glRotatef(20 * sqr(CTime - Timings[3]) / sqr((Timings[7] - Timings[3]) / 2), 0, 0, 1); - glScalef(1 + sqr(CTime - Timings[3]) / (32 * (Timings[7] - Timings[3])), 1 + sqr(CTime - Timings[3]) / (32 * (Timings[7] - Timings[3])), 1); - end; - if CTime < Timings[2] then - glRotatef(30 * myAngle, 0.5 * myScale + myScale, 1 + myScale, 0); -// glScalef(0.5, 0.5, 0.5); - glScalef(4/3, -1, 1); - glColor4f(1, 1, 1, 1); + Developers[Dev].Draw(credits_names[Dev], (DevTicks - NameFadeTime) / (TimePerName - NameFadeTime * 2 - NameWaitTime)); - glBindTexture(GL_TEXTURE_2D, intro_layer01.TexNum); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.4 * myScale); - glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.4 * myScale); - glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.4 * myScale); - glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.4 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer02.TexNum); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.3 * myScale); - glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.3 * myScale); - glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.3 * myScale); - glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.3 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer03.TexNum); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.2 * myScale); - glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.2 * myScale); - glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.2 * myScale); - glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.2 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer04.TexNum); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.1 * myScale); - glTexCoord2f(0, 1); glVertex3f(-1, 1, -0.1 * myScale); - glTexCoord2f(1, 1); glVertex3f( 1, 1, -0.1 * myScale); - glTexCoord2f(1, 0); glVertex3f( 1, -1, -0.1 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer05.TexNum); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex3f(-1, -1, 0 * myScale); - glTexCoord2f(0, 1); glVertex3f(-1, 1, 0 * myScale); - glTexCoord2f(1, 1); glVertex3f( 1, 1, 0 * myScale); - glTexCoord2f(1, 0); glVertex3f( 1, -1, 0 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer06.TexNum); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.1 * myScale); - glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.1 * myScale); - glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.1 * myScale); - glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.1 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer07.TexNum); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.2 * myScale); - glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.2 * myScale); - glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.2 * myScale); - glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.2 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer08.TexNum); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.3 * myScale); - glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.3 * myScale); - glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.3 * myScale); - glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.3 * myScale); - glEnd; - glBindTexture(GL_TEXTURE_2D, intro_layer09.TexNum); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex3f(-1, -1, 0.22 * myScale); - glTexCoord2f(0, 1); glVertex3f(-1, 1, 0.22 * myScale); - glTexCoord2f(1, 1); glVertex3f( 1, 1, 0.22 * myScale); - glTexCoord2f(1, 0); glVertex3f( 1, -1, 0.22 * myScale); - glEnd; - gldisable(gl_texture_2d); + glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); - glPopMatrix; - End3D; + end; +end; + +procedure TScreenCredits.DrawMainFG; +begin + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glColor4f(1, 1, 1, 1); + glBindTexture(GL_TEXTURE_2D, credits_bg_ovl.TexNum); + glBegin(gl_Quads); + glTexCoord2f( 0, 0); glVertex2f(800-393, 0); + glTexCoord2f( 0, 600/1024); glVertex2f(800-393, 600); + glTexCoord2f(393/512, 600/1024); glVertex2f(800, 600); + glTexCoord2f(393/512, 0); glVertex2f(800, 0); + glEnd; - // do some sparkling effects - if (CTime < Timings[1]) and (CTime > Timings[21]) then + + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); +end; + +procedure TScreenCredits.DoLogoBling; + const + myLogoCoords: array[0..27,0..1] of cardinal = ( + ( 39,32),( 84,32),(100,16),(125,24), + (154,31),(156,58),(168,32),(203,36), + (258,34),(251,50),(274,93),(294,84), + (232,54),(278,62),(319,34),(336,92), + (347,23),(374,32),(377,58),(361,83), + (385,91),(405,91),(429,35),(423,51), + (450,32),(485,34),(444,91),(486,93) + ); + var + Coords: integer; + StartFrame: integer; +begin + if (CTime > Main_OnBeatTwinkle_Start ) and + (CTime < Main_FadeOut_Start) then begin - for k:= 1 to 3 do + { spawn stars only in frames where a beat was detected } + if BeatDetected then begin - l := 410 + floor((CTime - Timings[21]) / (Timings[1] - Timings[21]) * (536 - 410)) + RandomRange(-5, 5); - j := floor((Timings[1] - CTime) / 22) + RandomRange(285, 301); - GoldenRec.Spawn(l, j, 1, 16, 0, -1, Flare, 0); + StartFrame := RandomRange(6, 16); + Coords := RandomRange(0, 27); + + GoldenRec.Spawn(myLogoCoords[Coords,0], myLogoCoords[Coords,1], 16-StartFrame, StartFrame, 0, -1, PerfectNote, 0); end; end; +end; - // fade to white at end - if Ctime > Timings[6] then - begin - glColor4f(1, 1, 1, sqr(CTime - Timings[6]) * (CTime - Timings[6]) / sqr(Timings[7] - Timings[6])); - glEnable(GL_BLEND); - glBegin(GL_QUADS); - glVertex2f( 0, 0); - glVertex2f( 0, 600); - glVertex2f(800, 600); - glVertex2f(800, 0); - glEnd; - glDisable(GL_BLEND); - end; +procedure TScreenCredits.DrawOutro; +begin + if CTime = Tune_End then + begin + CTime_hold := 0; + AudioPlayback.Stop; + AudioPlayback.Open(SoundPath.Append('credits-outro-tune.mp3')); + AudioPlayback.SetVolume(0.2); + AudioPlayback.SetLoop(true); + AudioPlayback.Play; + end; - end; - if (CRDTS_Stage=MainPart) then - // main credits screen background, scroller, logo and girl - begin + if CTime_hold > 231 then + begin + AudioPlayback.Play; + Ctime_hold := 0; + end; - glEnable(GL_TEXTURE_2D); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - glColor4f(1, 1, 1, 1); - glBindTexture(GL_TEXTURE_2D, credits_bg_tex.TexNum); - glbegin(gl_quads); - glTexCoord2f( 0, 0); glVertex2f( 0, 0); - glTexCoord2f( 0, 600/1024); glVertex2f( 0, 600); - glTexCoord2f(800/1024, 600/1024); glVertex2f(800, 600); - glTexCoord2f(800/1024, 0); glVertex2f(800, 0); - glEnd; - glDisable(GL_TEXTURE_2D); - glDisable(GL_BLEND); - - // draw scroller - Draw_FunkyText; - - //######################################################################### - // draw credits names - - Log.LogStatus('', ' JB-4'); - - // BlindGuard (rotate in from upper left, rotate out to lower right) - STime := Timings[9] - 10; - Delay := Timings[10] - Timings[9]; - if CTime > STime then - begin - k := 0; - ESC_Alpha := 20; + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; + // do something useful + // outro background + glEnable(GL_TEXTURE_2D); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); - if Data[k] > 0.25 then - ESC_Alpha := 5 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - if ((CTime - STime) < 20) then - ESC_Alpha := 20; - if CTime <= STime + 10 then - j := CTime - STime - else - j := 10; - if (CTime >= STime + Delay - 10) then - if (CTime <= STime + Delay) then - j := (STime + Delay) - CTime - else - j := 0; - glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); - - if (CTime >= STime + 10) and (CTime <= STime + 12) then - begin - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - end; + glColor4f(1, 1, 1, 1); + glBindTexture(GL_TEXTURE_2D, outro_bg.TexNum); + glBegin(gl_quads); + glTexCoord2f( 0, 0); glVertex2f( 0, 0); + glTexCoord2f( 0, 600/1024); glVertex2f( 0, 600); + glTexCoord2f(800/1024, 600/1024); glVertex2f(800, 600); + glTexCoord2f(800/1024, 0); glVertex2f(800, 0); + glEnd; + + // outro overlays + glColor4f(1, 1, 1, (2 + sin(CTime / 15)) / 3); + glBindTexture(GL_TEXTURE_2D, outro_esc.TexNum); + glBegin(Gl_Quads); + glTexCoord2f( 0, 0); glVertex2f( 0, 0); + glTexCoord2f( 0, 223/256); glVertex2f( 0, 223); + glTexCoord2f(487/512, 223/256); glVertex2f(487, 223); + glTexCoord2f(487/512, 0); glVertex2f(487, 0); + glEnd; + + if (RandomRange(0,20) <= 18) then + begin + glColor4f(1, 1, 1, 1); + glBindTexture(GL_TEXTURE_2D, outro_exd.TexNum); + glBegin(Gl_Quads); + glTexCoord2f( 0, 0); glVertex2f(800-310, 600-247); + glTexCoord2f( 0, 247/256); glVertex2f(800-310, 600 ); + glTexCoord2f(310/512, 247/256); glVertex2f(800, 600 ); + glTexCoord2f(310/512, 0); glVertex2f(800, 600-247); + glEnd; + end; - glPushMatrix; - gltranslatef(0, 329, 0); - if CTime <= STime + 10 then - glrotatef((CTime - STime) * 9 + 270, 0, 0, 1); - gltranslatef(223, 0, 0); - if CTime >= STime + Delay - 10 then - if CTime <= STime + Delay then - begin - gltranslatef(223, 0, 0); - glrotatef((integer(CTime) - (integer(STime + Delay) - 10)) * -9, 0, 0, 1); - gltranslatef(-223, 0, 0); - end; - glBindTexture(GL_TEXTURE_2D, credits_blindguard.TexNum); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex2f(-163, -129); - glTexCoord2f(0, 1); glVertex2f(-163, 129); - glTexCoord2f(1, 1); glVertex2f( 163, 129); - glTexCoord2f(1, 0); glVertex2f( 163, -129); - glEnd; - gldisable(gl_texture_2d); - gldisable(GL_BLEND); - glPopMatrix; - end; + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); - // Blindy (zoom from 0 to full size and rotation, zoom zo doubble size and shift to upper right) - STime := Timings[10] - 10; - Delay := Timings[11] - Timings[10] + 5; - if CTime > STime then - begin - k := 0; - ESC_Alpha := 20; + // outro scrollers? + // ... +end; - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; +{ name effects } +{ effects are called with blending texture and matrix prepared } +procedure Effect_Draw (const Tex: TTexture; Progress: double); +begin + glColor4f(1, 1, 1, 1); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - if Data[k] > 0.25 then - ESC_Alpha := 5 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - if ((CTime - STime) < 20) then - ESC_Alpha := 20; - if CTime <= STime + 10 then - j := CTime - STime - else - j := 10; - if (CTime >= STime + Delay - 10) then - if (CTime <= STime + Delay) then - j := (STime + Delay) - CTime - else - j := 0; - glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); - - if (CTime >= STime+20) and (CTime<=STime+22) then - begin - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - end; +procedure Effect_OnBeatJitter (const Tex: TTexture; Progress: double); + var + Diff: cardinal; + Alpha: double; +begin + Diff := ScreenCredits.CTime - ScreenCredits.LastBeatTime; + if (Diff < BeatJitterTime) then + Alpha := 0.5 + 0.5 * Diff / BeatJitterTime + else + Alpha := 1; + + glColor4f(1, 1, 1, Alpha); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - glPushMatrix; - gltranslatef(223, 329, 0); - if CTime <= STime + 20 then - begin - j := CTime - Stime; - glscalef(j * j / 400, j * j / 400, j * j / 400); - glrotatef(j * 18.0, 0, 0, 1); - end; - if CTime >= STime + Delay - 10 then - if CTime <= STime + Delay then - begin - j := CTime - (STime + Delay - 10); - f := j * 10.0; - gltranslatef(f * 3, -f, 0); - glscalef(1 + j / 10, 1 + j / 10, 1 + j / 10); - glrotatef(j * 9.0, 0, 0, 1); - end; - glBindTexture(GL_TEXTURE_2D, credits_blindy.TexNum); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex2f(-163, -129); - glTexCoord2f(0, 1); glVertex2f(-163, 129); - glTexCoord2f(1, 1); glVertex2f( 163, 129); - glTexCoord2f(1, 0); glVertex2f( 163, -129); - glEnd; - gldisable(gl_texture_2d); - gldisable(GL_BLEND); - glPopMatrix; - end; +procedure Effect_Rotate_Left_Top (const Tex: TTexture; Progress: double); +begin + glColor4f(1, 1, 1, Progress); + + gltranslatef(-NameX, 0, 0); + glrotatef(Progress * 90 + 270, 0, 0, 1); + gltranslatef(NameX, 0, 0); + + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - // Canni (shift in from left, shift out to upper right) - STime := Timings[11] - 10; - Delay := Timings[12] - Timings[11] + 5; - if CTime > STime then - begin - k := 0; - ESC_Alpha := 20; +procedure Effect_Rotate_Right_Bot (const Tex: TTexture; Progress: double); +begin + glColor4f(1, 1, 1, Progress); + + gltranslatef(NameX, 0, 0); + glrotatef((Progress - 1) * 90, 0, 0, 1); + gltranslatef(-NameX, 0, 0); + + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; +procedure Effect_ZoomIn_Rotate (const Tex: TTexture; Progress: double); +begin + glColor4f(1, 1, 1, Progress); - if Data[k] > 0.25 then - ESC_Alpha := 5 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - if ((CTime - STime) < 20) then - ESC_Alpha := 20; - if CTime <= STime + 10 then - j := CTime - STime - else - j := 10; - if (CTime >= STime + Delay - 10) then - if (CTime <= STime + Delay) then - j := (STime + Delay) - CTime - else - j := 0; - glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); - - if (CTime >= STime + 10) and (CTime <= STime + 12) then - begin - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - end; + glscalef(sqr(Progress), sqr(Progress), sqr(Progress)); + glrotatef(Progress * 360, 0, 0, 1); - glPushMatrix; - gltranslatef(223, 329, 0); - if CTime <= STime + 10 then - begin - gltranslatef(((CTime - STime) * 21.0) - 210, 0, 0); - end; - if CTime >= STime + Delay - 10 then - if CTime <= STime + Delay then - begin - j := (CTime - (STime + Delay - 10)) * 21; - gltranslatef(j, -j / 2, 0); - end; - glBindTexture(GL_TEXTURE_2D, credits_canni.TexNum); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex2f(-163, -129); - glTexCoord2f(0, 1); glVertex2f(-163, 129); - glTexCoord2f(1, 1); glVertex2f( 163, 129); - glTexCoord2f(1, 0); glVertex2f( 163, -129); - glEnd; - gldisable(gl_texture_2d); - gldisable(GL_BLEND); - glPopMatrix; - end; + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - // Commandio (flip in from down, flip out to upper right) - STime := Timings[12] - 10; - Delay := Timings[13] - Timings[12]; - if CTime > STime then - begin - k := 0; - ESC_Alpha := 20; +procedure Effect_ZoomOut_Shift (const Tex: TTexture; Progress: double); + var + X: double; +begin + glColor4f(1, 1, 1, Progress); + + X := (1 - Progress); + gltranslatef(X * 300, -X * 100, 0); + glscalef(1 + X, 1 + X, 1 + X); + glrotatef(X * 90, 0, 0, 1); + + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; +procedure Effect_Shift_Left (const Tex: TTexture; Progress: double); +begin + glColor4f(1, 1, 1, Progress); - if Data[k] > 0.25 then - ESC_Alpha := 5 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - if ((CTime - STime) < 20) then - ESC_Alpha := 20; - if CTime <= STime + 10 then - j := CTime - STime - else - j := 10; - if (CTime >= STime + Delay - 10) then - if (CTime <= STime + Delay) then - j := (STime + Delay) - CTime - else - j := 0; - glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); - - if (CTime >= STime + 10) and (CTime <= STime + 12) then - begin - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - end; + glTranslatef((Progress - 1) * 210, 0, 0); - glPushMatrix; - gltranslatef(223, 329, 0); - if CTime <= STime + 10 then - f := 258.0 - 25.8 * (CTime - STime) - else - f := 0; - g := 0; - if CTime >= STime + Delay - 10 then - if CTime <= STime + Delay then - begin - j := CTime - (STime + Delay - 10); - g := 32.6 * j; - end; - glBindTexture(GL_TEXTURE_2D, credits_commandio.TexNum); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex2f(-163 + g - f * 1.5, -129 + f * 1.5 - g/2); - glTexCoord2f(0, 1); glVertex2f(-163 + g * 1.5, 129 - (g * 1.5 * 258 / 326)); - glTexCoord2f(1, 1); glVertex2f( 163 + g, 129 + g / 4); - glTexCoord2f(1, 0); glVertex2f( 163 + f * 1.5 + g / 4, -129 + f * 1.5 - g / 4); - glEnd; - gldisable(gl_texture_2d); - gldisable(GL_BLEND); - glPopMatrix; - end; + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - // lazy joker (just scrolls from left to right, no twinkling stars, no on-beat flashing) - STime := Timings[13] - 35; - Delay := Timings[14] - Timings[13] + 5; - if CTime > STime then - begin - k := 0; +procedure Effect_Shift_Right_Top (const Tex: TTexture; Progress: double); +begin + glColor4f(1, 1, 1, Progress); - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; + glTranslatef((1 - Progress) * 210, (Progress - 1) * 105, 0); - if Data[k] > 0.25 then - ESC_Alpha := 5 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - if ((CTime - STime) > 10) and ((CTime - STime) < 20) then - ESC_Alpha := 20; - ESC_Alpha := 10; - f := CTime - STime; - if CTime <= STime + 40 then - j := CTime - STime - else - j := 40; - if (CTime >= STime + Delay - 40) then - if (CTime <= STime + Delay) then - j := (STime + Delay) - CTime - else - j := 0; - glColor4f(1, 1, 1, ESC_Alpha / 20 * j * j / 1600); - - glPushMatrix; - gltranslatef(180 + (f - 70), 329, 0); - glBindTexture(GL_TEXTURE_2D, credits_lazyjoker.TexNum); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex2f(-163, -129); - glTexCoord2f(0, 1); glVertex2f(-163, 129); - glTexCoord2f(1, 1); glVertex2f( 163, 129); - glTexCoord2f(1, 0); glVertex2f( 163, -129); - glEnd; - gldisable(gl_texture_2d); - gldisable(GL_BLEND); - glPopMatrix; - end; + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - // Mog (flip in from right, flip out to lower right) - STime := Timings[14] - 10; - Delay := Timings[15] - Timings[14] + 5; - if CTime > STime then - begin - k := 0; - ESC_Alpha := 20; +procedure Effect_Flip_Bot (const Tex: TTexture; Progress: double); + var + X: double; +begin + glColor4f(1, 1, 1, Progress); - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; + X := NameH * (1 - Progress); - if Data[k] > 0.25 then - ESC_Alpha := 5 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - if ((CTime - STime) < 20) then - ESC_Alpha := 20; - if CTime <= STime + 10 then - j := CTime - STime - else - j := 10; - if (CTime >= STime + Delay - 10) then - if (CTime <= STime + Delay) then - j := (STime + Delay) - CTime - else - j := 0; - glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); - - if (CTime >= STime + 10) and (CTime <= STime + 12) then - begin - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - end; + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2 - 1.5 * X, -NameH/2 + 1.5 * X); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2 + 1.5 * X, -NameH/2 + 1.5 * X); + glEnd; +end; - glPushMatrix; - gltranslatef(223, 329, 0); - if CTime <= STime + 10 then - f := 326.0 - 32.6 * (CTime - STime) - else - f := 0; - - g := 0; - if CTime >= STime + Delay - 10 then - if CTime <= STime + Delay then - begin - j := CTime - (STime + Delay - 10); - g := 32.6 * j; - end; - glBindTexture(GL_TEXTURE_2D, credits_mog.TexNum); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex2f(-163 + g * 1.5, -129 + g * 1.5); - glTexCoord2f(0, 1); glVertex2f(-163 + g * 1.2, 129 + g); - glTexCoord2f(1, 1); glVertex2f( 163 - f + g / 2, 129 + f * 1.5 + g / 4); - glTexCoord2f(1, 0); glVertex2f( 163 - f + g * 1.5, -129 - f * 1.5); - glEnd; - gldisable(gl_texture_2d); - gldisable(GL_BLEND); - glPopMatrix; - end; +procedure Effect_Flip_Right_Top (const Tex: TTexture; Progress: double); + var + X: double; +begin + glColor4f(1, 1, 1, Progress); - // Mota (rotate in from upper right, shift out to lower left while shrinking and rotateing) - STime := Timings[15] - 10; - Delay := Timings[16] - Timings[15] + 5; - if CTime > STime then - begin - k := 0; - ESC_Alpha := 20; + X := NameW * (1 - Progress); - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2 + X, -NameH/2 - X/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2 + X, NameH/2 - (X * 1.5 * NameH / NameW)); + glTexCoord2f(1, 1); glVertex2f( NameW/2 + X, NameH/2 + X / 4); + glTexCoord2f(1, 0); glVertex2f( NameW/2 + X, -NameH/2 - X / 4); + glEnd; +end; - if Data[k] > 0.25 then - ESC_Alpha := 5 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - if ((CTime - STime) < 20) then - ESC_Alpha := 20; - if CTime <= STime + 10 then - j := CTime - STime - else - j := 10; - if (CTime >= STime + Delay - 10) then - if (CTime <= STime + Delay) then - j := (STime + Delay) - CTime - else - j := 0; - glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); - - if (CTime >= STime + 10) and (CTime <= STime + 12) then - begin - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - end; +procedure Effect_Flip_Right (const Tex: TTexture; Progress: double); + var + X: double; +begin + glColor4f(1, 1, 1, Progress); - glPushMatrix; - gltranslatef(223, 329, 0); - if CTime <= STime + 10 then - begin - gltranslatef(223, 0, 0); - glrotatef((10 - (CTime - STime)) * 9, 0, 0, 1); - gltranslatef(-223, 0, 0); - end; - if CTime >= STime + Delay - 10 then - if CTime <= STime + Delay then - begin - j := CTime - (STime + Delay - 10); - f := j * 10.0; - gltranslatef(-f * 2, -f, 0); - glscalef(1 - j / 10, 1 - j / 10, 1 - j / 10); - glrotatef(-j * 9.0, 0, 0, 1); - end; - glBindTexture(GL_TEXTURE_2D, credits_mota.TexNum); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex2f(-163, -129); - glTexCoord2f(0, 1); glVertex2f(-163, 129); - glTexCoord2f(1, 1); glVertex2f( 163, 129); - glTexCoord2f(1, 0); glVertex2f( 163, -129); - glEnd; - gldisable(gl_texture_2d); - gldisable(GL_BLEND); - glPopMatrix; - end; + X := NameW * (1 - Progress); - // Skillmaster (shift in from lower right, rotate out to upper right) - STime := Timings[16] - 10; - Delay := Timings[17] - Timings[16] + 5; - if CTime > STime then - begin - k := 0; - ESC_Alpha := 20; + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2 - X, NameH/2 + X * 1.5); + glTexCoord2f(1, 0); glVertex2f( NameW/2 - X, -NameH/2 - X * 1.5); + glEnd; +end; - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; +procedure Effect_Flip_Right_Bot (const Tex: TTexture; Progress: double); + var + X: double; +begin + glColor4f(1, 1, 1, Progress); - if Data[k] > 0.25 then - ESC_Alpha := 5 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - if ((CTime - STime) < 20) then - ESC_Alpha := 20; - if CTime <= STime + 10 then - j := CTime - STime - else - j := 10; - if (CTime >= STime + Delay - 10) then - if (CTime <= STime + Delay) then - j := (STime + Delay) - CTime - else - j := 0; - glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); - - if (CTime >= STime + 10) and (CTime <= STime + 12) then - begin - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - end; + X := NameW * (1 - Progress); - glPushMatrix; - gltranslatef(223, 329, 0); - if CTime <= STime + 10 then - begin - j := STime + 10 - CTime; - f := j * 10.0; - gltranslatef(+f * 2, +f / 2, 0); - end; - if CTime >= STime + Delay - 10 then - if CTime <= STime + Delay then - begin - j := CTime - (STime + Delay - 10); - gltranslatef(0, -223, 0); - glrotatef(integer(j) * -9, 0, 0, 1); - gltranslatef(0, 223, 0); - glrotatef(j * 9, 0, 0, 1); - end; - glBindTexture(GL_TEXTURE_2D, credits_skillmaster.TexNum); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex2f(-163, -129); - glTexCoord2f(0, 1); glVertex2f(-163, 129); - glTexCoord2f(1, 1); glVertex2f( 163, 129); - glTexCoord2f(1, 0); glVertex2f( 163, -129); - glEnd; - gldisable(gl_texture_2d); - gldisable(GL_BLEND); - glPopMatrix; - end; + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2 + X * 1.5, -NameH/2 + X * 1.5); + glTexCoord2f(0, 1); glVertex2f(-NameW/2 + X * 1.2, NameH/2 + X); + glTexCoord2f(1, 1); glVertex2f( NameW/2 + X / 2, NameH/2 + X / 4); + glTexCoord2f(1, 0); glVertex2f( NameW/2 + X * 1.5, -NameH/2); + glEnd; +end; - // WhiteShark (flip in from lower left, flip out to upper right) - STime := Timings[17] - 10; - Delay := Timings[18] - Timings[17]; - if CTime > STime then - begin - k := 0; - ESC_Alpha := 20; +procedure Effect_Rotate_Right_Top (const Tex: TTexture; Progress: double); +begin + glColor4f(1, 1, 1, Progress); + + glTranslatef(NameX, 0, 0); + glrotatef((1 - Progress) * 90, 0, 0, 1); + glTranslatef(-NameX, 0, 0); + + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; +procedure Effect_Shift_Weird (const Tex: TTexture; Progress: double); + var + X: double; +begin + glColor4f(1, 1, 1, Progress); - if Data[k] > 0.25 then - ESC_Alpha := 5 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - if ((CTime - STime) < 20) then - ESC_Alpha := 20; - if CTime <= STime + 10 then - j := CTime - STime - else - j := 10; - if (CTime >= STime + Delay - 10) then - if (CTime <= STime + Delay) then - j := (STime + Delay) - CTime - else - j := 0; - glColor4f(1, 1, 1, ESC_Alpha / 20 * j / 10); - - if (CTime >= STime + 10) and (CTime <= STime + 12) then - begin - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 0); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 1); - GoldenRec.Spawn(RandomRange(65,390), RandomRange(200,460), 1, 16, 0, -1, PerfectLineTwinkle, 5); - end; + X := (Progress - 1); - glPushMatrix; - gltranslatef(223, 329, 0); - if CTime <= STime + 10 then - f := 326.0 - 32.6 * (CTime - STime) - else - f := 0; + glTranslatef(X * 200, X * 100, 0); + glScalef(Progress, Progress, Progress); + glRotatef(X * 90, 0, 0, 1); - if (CTime >= STime + Delay - 10) and (CTime <= STime + Delay) then - begin - j := CTime - (STime + Delay - 10); - g := 32.6 * j; - end - else - begin - g := 0; - end; + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - glBindTexture(GL_TEXTURE_2D, credits_whiteshark.TexNum); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glbegin(gl_quads); - glTexCoord2f(0, 0); glVertex2f(-163 - f + g, -129 + f / 4 - g / 2); - glTexCoord2f(0, 1); glVertex2f(-163 - f / 4 + g, 129 + g / 2 + f / 4); - glTexCoord2f(1, 1); glVertex2f( 163 - f * 1.2 + g / 4, 129 + f / 2 - g / 4); - glTexCoord2f(1, 0); glVertex2f( 163 - f * 1.5 + g / 4, -129 + f * 1.5 + g / 4); - glEnd; - gldisable(gl_texture_2d); - gldisable(GL_BLEND); - glPopMatrix; - end; +procedure Effect_Shift_Right_Bot (const Tex: TTexture; Progress: double); +begin + glColor4f(1, 1, 1, Progress); - Log.LogStatus('', ' JB-103'); + glTranslatef((1 - Progress) * 200, (1 - Progress) * 100, 0); - // #################################################################### - // do some twinkle stuff (kinda on beat) + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - if (CTime > Timings[8] ) and - (CTime < Timings[19]) then - begin - k := 0; - - try - for j := 0 to 40 do - begin - if (j < length(Data)) and - (k < length(Data)) then - begin - if Data[j] >= Data[k] then - k := j; - end; - end; - except - end; +procedure Effect_Rotate_Right_Top2 (const Tex: TTexture; Progress: double); +begin + glColor4f(1, 1, 1, Progress); + + glTranslatef(0, -NameX, 0); + glRotatef((Progress - 1) * 90, 0, 0, 1); + glTranslatef(0, NameX, 0); + glRotatef((1 - Progress) * 90, 0, 0, 1); + + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH/2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2, NameH/2); + glTexCoord2f(1, 1); glVertex2f( NameW/2, NameH/2); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH/2); + glEnd; +end; - if Data[k] > 0.2 then - begin - l := RandomRange(6, 16); - j := RandomRange(0, 27); - - GoldenRec.Spawn(myLogoCoords[j,0], myLogoCoords[j,1], 16-l, l, 0, -1, PerfectNote, 0); - end; - end; +procedure Effect_Flip_Left_Bot (const Tex: TTexture; Progress: double); + var + X: double; +begin + glColor4f(1, 1, 1, Progress); - //################################################# - // draw the rest of the main screen (girl and logo) - - glEnable(GL_TEXTURE_2D); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glColor4f(1, 1, 1, 1); - glBindTexture(GL_TEXTURE_2D, credits_bg_ovl.TexNum); - glbegin(gl_quads); - glTexCoord2f( 0, 0); glVertex2f(800-393, 0); - glTexCoord2f( 0, 600/1024); glVertex2f(800-393, 600); - glTexCoord2f(393/512, 600/1024); glVertex2f(800, 600); - glTexCoord2f(393/512, 0); glVertex2f(800, 0); - glEnd; + X := (1 - Progress) * NameW; -{ - glBindTexture(GL_TEXTURE_2D, credits_bg_logo.TexNum); - glbegin(gl_quads); - glTexCoord2f( 0, 0); glVertex2f( 0, 0); - glTexCoord2f( 0, 112/128); glVertex2f( 0, 112); - glTexCoord2f(497/512, 112/128); glVertex2f(497, 112); - glTexCoord2f(497/512, 0); glVertex2f(497, 0); - glEnd; -} - - gldisable(gl_texture_2d); - glDisable(GL_BLEND); + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2 - X, -NameH/2 + X / 4); + glTexCoord2f(0, 1); glVertex2f(-NameW/2 - X / 4, NameH/2 + X / 4); + glTexCoord2f(1, 1); glVertex2f( NameW/2 - X * 1.2, NameH/2 + X / 2); + glTexCoord2f(1, 0); glVertex2f( NameW/2 - X * 1.5, -NameH/2 + X * 1.5); + glEnd; +end; - // fade out at end of main part - if Ctime > Timings[19] then - begin - glColor4f(0, 0, 0, (CTime - Timings[19]) / (Timings[20] - Timings[19])); - glEnable(GL_BLEND); - glBegin(GL_QUADS); - glVertex2f( 0, 0); - glVertex2f( 0, 600); - glVertex2f(800, 600); - glVertex2f(800, 0); - glEnd; - glDisable(GL_BLEND); - end; - end - else - if (CRDTS_Stage = Outro) then - begin - if CTime = Timings[20] then - begin - CTime_hold := 0; - AudioPlayback.Stop; - AudioPlayback.Open(SoundPath.Append('credits-outro-tune.mp3')); - AudioPlayback.SetVolume(0.2); - AudioPlayback.SetLoop(true); - AudioPlayback.Play; - end; - if CTime_hold > 231 then - begin - AudioPlayback.Play; - Ctime_hold := 0; - end; - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); - - // do something useful - // outro background - glEnable(GL_TEXTURE_2D); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - glColor4f(1, 1, 1, 1); - glBindTexture(GL_TEXTURE_2D, outro_bg.TexNum); - glbegin(gl_quads); - glTexCoord2f( 0, 0); glVertex2f( 0, 0); - glTexCoord2f( 0, 600/1024); glVertex2f( 0, 600); - glTexCoord2f(800/1024, 600/1024); glVertex2f(800, 600); - glTexCoord2f(800/1024, 0); glVertex2f(800, 0); - glEnd; - - // outro overlays - glColor4f(1, 1, 1, (1 + sin(CTime / 15)) / 3 + 1/3); - glBindTexture(GL_TEXTURE_2D, outro_esc.TexNum); - glbegin(gl_quads); - glTexCoord2f( 0, 0); glVertex2f( 0, 0); - glTexCoord2f( 0, 223/256); glVertex2f( 0, 223); - glTexCoord2f(487/512, 223/256); glVertex2f(487, 223); - glTexCoord2f(487/512, 0); glVertex2f(487, 0); - glEnd; - - ESC_Alpha := 20; - if (RandomRange(0,20) > 18) and (ESC_Alpha = 20) then - ESC_Alpha := 0 - else - inc(ESC_Alpha); - if ESC_Alpha > 20 then - ESC_Alpha := 20; - glColor4f(1, 1, 1, ESC_Alpha / 20); - glBindTexture(GL_TEXTURE_2D, outro_exd.TexNum); - glbegin(gl_quads); - glTexCoord2f( 0, 0); glVertex2f(800-310, 600-247); - glTexCoord2f( 0, 247/256); glVertex2f(800-310, 600 ); - glTexCoord2f(310/512, 247/256); glVertex2f(800, 600 ); - glTexCoord2f(310/512, 0); glVertex2f(800, 600-247); - glEnd; - glDisable(GL_TEXTURE_2D); - glDisable(GL_BLEND); - - // outro scrollers? - // ... - end; +procedure Effect_Flip_Right_Top2 (const Tex: TTexture; Progress: double); + var + X: double; +begin + glColor4f(1, 1, 1, Progress); -{ - // draw credits runtime counter - SetFontStyle (2); - SetFontItalic(false); - SetFontSize(27); - SetFontPos (5, 5); - glColor4f(1, 1, 1, 1); -// RuntimeStr := 'CTime: ' + inttostr(floor(CTime / 30.320663991914489602156136106092)) + '.' + inttostr(floor(CTime / 3.0320663991914489602156136106092) - floor(CTime / 30.320663991914489602156136106092) * 10); - RuntimeStr := 'CTime: ' + inttostr(CTime); - glPrint (RuntimeStr[1]); -} + X := (1 - Progress) * NameW; - // make the stars shine - GoldenRec.Draw; + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2 + X, -NameH/2 - X / 2); + glTexCoord2f(0, 1); glVertex2f(-NameW/2 + X, NameH/2 + X / 2); + glTexCoord2f(1, 1); glVertex2f( NameW/2 + X / 4, NameH/2 - X / 4); + glTexCoord2f(1, 0); glVertex2f( NameW/2 + X / 4, -NameH/2 + X / 4); + glEnd; +end; + +procedure Effect_Twinkle_Down (const Tex: TTexture; Progress: double); +begin + // draw name + glColor4f(1, 1, 1, 1); + + glTranslatef(0, NameH/2, 0); + + glBegin(gl_Quads); + glTexCoord2f(0, 0); glVertex2f(-NameW/2, -NameH * Progress); + glTexCoord2f(0, Progress); glVertex2f(-NameW/2, 0); + glTexCoord2f(1, Progress); glVertex2f( NameW/2, 0); + glTexCoord2f(1, 0); glVertex2f( NameW/2, -NameH * Progress); + glEnd; + + //spawn some stars on the edge + GoldenRec.Spawn(NameX + RandomRange(-NameW div 2, NameW div 2), NameY - NameH/2 + (1 - Progress) * NameH, 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(NameX + RandomRange(-NameW div 2, NameW div 2), NameY - NameH/2 + (1 - Progress) * NameH, 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(NameX + RandomRange(-NameW div 2, NameW div 2), NameY - NameH/2 + (1 - Progress) * NameH, 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(NameX + RandomRange(-NameW div 2, NameW div 2), NameY - NameH/2 + (1 - Progress) * NameH, 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(NameX + RandomRange(-NameW div 2, NameW div 2), NameY - NameH/2 + (1 - Progress) * NameH, 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(NameX + RandomRange(-NameW div 2, NameW div 2), NameY - NameH/2 + (1 - Progress) * NameH, 1, 16, 0, -1, PerfectLineTwinkle, 5); + GoldenRec.Spawn(NameX + RandomRange(-NameW div 2, NameW div 2), NameY - NameH/2 + (1 - Progress) * NameH, 1, 16, 0, -1, PerfectLineTwinkle, 0); + GoldenRec.Spawn(NameX + RandomRange(-NameW div 2, NameW div 2), NameY - NameH/2 + (1 - Progress) * NameH, 1, 16, 0, -1, PerfectLineTwinkle, 1); + GoldenRec.Spawn(NameX + RandomRange(-NameW div 2, NameW div 2), NameY - NameH/2 + (1 - Progress) * NameH, 1, 16, 0, -1, PerfectLineTwinkle, 5); +end; + +{ beat detection algorithm + based on a tutorial from Frédéric Patin on gamedev.net + http://www.gamedev.net/reference/programming/features/beatdetection/default.asp } + +{ calculates average value of a history buffer } +function Average(History: TEnergyHistory): single; + var I: integer; +begin + Result := 0; + + for I := 0 to HistoryLength - 1 do + Result := Result + History[I]; + + Result := Result / HistoryLength; +end; + +{ calculates variance value of a history buffer } +function Variance(History: TEnergyHistory; Average: single): single; + var I: integer; +begin + Result := 0; + + for I := 0 to HistoryLength - 1 do + Result := Result + sqr(History[I] - Average); + + Result := Result / HistoryLength; +end; + +{ shifts all values of the history to the right and + adds the new value at the front } +procedure AddHistory(Value: single; var History: TEnergyHistory); + var I: integer; +begin + for I := HistoryLength - 1 downto 1 do + History[I] := History[I-1]; + + History[0] := Value; +end; + +{ calculates instant energy from FFT data for a specific + subchannel (0..SubChannelCount - 1) } +function CalculateInstantEnergy(SubChannel: integer; Data: TFFTData): single; + var I: integer; +begin + Result := 0; + for I := SubChannel * SamplesPerChannel to (SubChannel + 1) * SamplesPerChannel - 1 do + Result := Result + Data[I] * BeatEnergyModifier; + + Result := Result / SamplesPerChannel; +end; + +procedure TScreenCredits.DetectBeat; + var + Data: TFFTData; + I: integer; + Instant: single; + C, E, V: single; +begin + AudioPlayback.GetFFTData(Data); + + // do beatdetection for every subchannel + for I := 0 to SubChannelCount - 1 do + begin + Instant := CalculateInstantEnergy(I, Data); + E := Average(SubchannelHistory[I]); + V := Variance(SubchannelHistory[I], E); + + C := (-0.0025714 * V) + 1.5142857; + + AddHistory(Instant, SubChannelHistory[I]); + + if (Instant > 2) and (Instant > C * E) then + begin + // beat detected + BeatDetected := true; + LastBeatTime := CTime; + end; + end; end; end. -- cgit v1.2.3 From 4be1f771a6fbe7dfdfb77582e9a7a2e7f4a0b2a3 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 30 Jun 2010 14:34:21 +0000 Subject: remove some unused elements of ScreenCredits git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2567 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index 468b4e84..e396e3be 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -68,16 +68,11 @@ type Credits_X: real; Credits_Time: cardinal; - Credits_Alpha: cardinal; CTime_hold: cardinal; - ESC_Alpha: integer; - credits_entry: TTexture; - credits_entry_dx: TTexture; credits_bg_tex: TTexture; credits_bg_ovl: TTexture; //credits_bg_logo: TTexture; - credits_bg_scrollbox_left: TTexture; credits_names: array of TTexture; intro_layer01: TTexture; intro_layer02: TTexture; @@ -92,11 +87,6 @@ type outro_esc: TTexture; outro_exd: TTexture; - deluxe_slidein: cardinal; - - CurrentScrollText: string; - NextScrollUpdate: real; - EndofLastScrollingPart: cardinal; CurrentScrollStart, CurrentScrollEnd: integer; CRDTS_Stage: TCreditsStages; -- cgit v1.2.3 From 3a82c1e1f853942d351e3622e6bd64768c9a9553 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sun, 18 Jul 2010 11:11:57 +0000 Subject: some changes to mouse eEgg git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2582 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenCredits.pas | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/screens/UScreenCredits.pas') diff --git a/src/screens/UScreenCredits.pas b/src/screens/UScreenCredits.pas index e396e3be..90c0fa19 100644 --- a/src/screens/UScreenCredits.pas +++ b/src/screens/UScreenCredits.pas @@ -98,6 +98,9 @@ type MouseMoved: boolean; MouseX, MouseY: double; + { saves last x and y angle for easter egg } + LogoAngleX, LogoAngleY: single; + procedure LoadNameTextures; { draw different stages } @@ -474,10 +477,22 @@ begin according to mouse position } if (MouseMoved) then begin + // calculate destination angle AngleX := 30 * MouseY; AngleY := 30 * MouseX; + + { move angle towards destination } + if not SameValue(LogoAngleX, AngleX, 0.001) then + AngleX := LogoAngleX + 0.05 * (AngleX - LogoAngleX); + + if not SameValue(LogoAngleY, AngleY, 0.001) then + AngleY := LogoAngleY + 0.05 * (AngleY - LogoAngleY); end; + // save last angle + LogoAngleX := AngleX; + LogoAngleY := AngleY; + DrawLayeredLogo(Separation, Scale, AngleX, AngleY, AngleZ); { do some sparkling effects } -- cgit v1.2.3