From 541b91c3f40f283411faebe83d7cc50e2507c66e Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Thu, 22 Mar 2007 19:37:09 +0000 Subject: Fixed Crash at Startup (OpenGL Pointers not Inited) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@15 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/Don't_Get_Worse/Hold_The_Line.dpr | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Modis/Don't_Get_Worse') diff --git a/Modis/Don't_Get_Worse/Hold_The_Line.dpr b/Modis/Don't_Get_Worse/Hold_The_Line.dpr index 87fea3db..a6eb9a3a 100644 --- a/Modis/Don't_Get_Worse/Hold_The_Line.dpr +++ b/Modis/Don't_Get_Worse/Hold_The_Line.dpr @@ -52,26 +52,28 @@ function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sen var I: Integer; Texname, TexType: PChar; -begin { +begin TexName := CreateStr(PChar('HDL_Pointer')); TexType := CreateStr(PChar('Plain')); - //PointerTex := LoadTex(TexName, TexType); + PointerTex := LoadTex(TexName, TexType); FreeStr(TexName); FreeStr(TexType); - //CountSentences := Sentences.High; + CountSentences := Sentences.High; Limit := 0; Frame := 0; fPrint := Print; - {for I := 0 to PlayerInfo.NumPlayers-1 do + for I := 0 to PlayerInfo.NumPlayers-1 do begin PlayerInfo.Playerinfo[I].Enabled := True; PlayerInfo.Playerinfo[I].Percentage := 100; PlayerTimes[I] := 0; - end; } + end; + + LoadOpenGL; Result := True; end; @@ -110,12 +112,12 @@ begin begin PlayerInfo.Playerinfo[I].Enabled := False; Inc(C); - PlayerTimes[I] := Frame; //Save Tiem of Dismission + PlayerTimes[I] := Frame; //Save Time of Dismission //ToDo: PlaySound end; //Draw Pointer; - //glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum); + glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum); glBegin(GL_QUADS); glTexCoord2f(1/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY - 4); @@ -131,7 +133,7 @@ begin //Draw Dismissed Text := CreateStr(PChar('PARTY_DISMISSED')); //Str := 'Test123'; - //fPrint (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text); + fPrint (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text); FreeStr(Text); end; end; @@ -150,6 +152,7 @@ for I := 0 to PlayerInfo.NumPlayers-1 do PlayerInfo.Playerinfo[I].Percentage := (PlayerTimes[I] * 100) div Frame; if (PlayerInfo.Playerinfo[I].Enabled) then begin + PlayerInfo.Playerinfo[I].Percentage := 100; Case I of 0: Result := Result OR 1; 1: Result := Result OR 2; -- cgit v1.2.3