equal
deleted
inserted
replaced
988 //////////////////////////////////////////////////////////////////////////////// |
988 //////////////////////////////////////////////////////////////////////////////// |
989 var ProgrTex: PTexture = nil; |
989 var ProgrTex: PTexture = nil; |
990 Step: integer = 0; |
990 Step: integer = 0; |
991 squaresize : LongInt; |
991 squaresize : LongInt; |
992 numsquares : integer; |
992 numsquares : integer; |
|
993 |
993 procedure AddProgress; |
994 procedure AddProgress; |
994 var r: TSDL_Rect; |
995 var r: TSDL_Rect; |
995 texsurf: PSDL_Surface; |
996 texsurf: PSDL_Surface; |
996 begin |
997 begin |
997 if Step = 0 then |
998 if Step = 0 then |
1001 ProgrTex:= Surface2Tex(texsurf); |
1002 ProgrTex:= Surface2Tex(texsurf); |
1002 SDL_FreeSurface(texsurf); |
1003 SDL_FreeSurface(texsurf); |
1003 squaresize:= ProgrTex^.w shr 1; |
1004 squaresize:= ProgrTex^.w shr 1; |
1004 numsquares:= ProgrTex^.h div squaresize; |
1005 numsquares:= ProgrTex^.h div squaresize; |
1005 end; |
1006 end; |
|
1007 |
|
1008 TryDo(ProgrTex <> nil, 'ProgrTex = nil!', true); |
1006 |
1009 |
1007 glClear(GL_COLOR_BUFFER_BIT); |
1010 glClear(GL_COLOR_BUFFER_BIT); |
1008 glEnable(GL_TEXTURE_2D); |
1011 glEnable(GL_TEXTURE_2D); |
1009 if Step < numsquares then r.x:= 0 |
1012 if Step < numsquares then r.x:= 0 |
1010 else r.x:= squaresize; |
1013 else r.x:= squaresize; |
1019 |
1022 |
1020 |
1023 |
1021 procedure FinishProgress; |
1024 procedure FinishProgress; |
1022 begin |
1025 begin |
1023 WriteLnToConsole('Freeing progress surface... '); |
1026 WriteLnToConsole('Freeing progress surface... '); |
1024 FreeTexture(ProgrTex) |
1027 FreeTexture(ProgrTex); |
|
1028 ProgrTex:= nil |
1025 end; |
1029 end; |
1026 |
1030 |
1027 procedure flipSurface(Surface: PSDL_Surface; Vertical: Boolean); |
1031 procedure flipSurface(Surface: PSDL_Surface; Vertical: Boolean); |
1028 var y, x, i, j: LongInt; |
1032 var y, x, i, j: LongInt; |
1029 tmpPixel: Longword; |
1033 tmpPixel: Longword; |