aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authorb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-08 15:33:52 +0000
committerb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-09-08 15:33:52 +0000
commit16e0d37948cc1137d0c79f48f9b5e12e5bf77686 (patch)
tree693d9f960826f895b424f378619a7f33be392188 /Game/Code
parent69def54f79cace3a1a90ae71f03910986ff74da7 (diff)
downloadusdx-16e0d37948cc1137d0c79f48f9b5e12e5bf77686.tar.gz
usdx-16e0d37948cc1137d0c79f48f9b5e12e5bf77686.tar.xz
usdx-16e0d37948cc1137d0c79f48f9b5e12e5bf77686.zip
did some cleanup and minor modifications
UDisplay.pas: tried to make the screenfade-effect transparent (doesn't work for now) UMenu.pas: removed some unnecessary code from DrawBG UGraphic.pas: fixed display of loading screen (after it broke with the modifications in UMenu.pas) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@379 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UGraphic.pas3
-rw-r--r--Game/Code/Menu/UDisplay.pas8
-rw-r--r--Game/Code/Menu/UMenu.pas16
3 files changed, 12 insertions, 15 deletions
diff --git a/Game/Code/Classes/UGraphic.pas b/Game/Code/Classes/UGraphic.pas
index 068ed715..a79a16a2 100644
--- a/Game/Code/Classes/UGraphic.pas
+++ b/Game/Code/Classes/UGraphic.pas
@@ -358,7 +358,7 @@ begin
SDL_GL_SwapBuffers;
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
- glOrtho(0, 800, 600, 0, -1, 100);
+ glOrtho(0, RenderW, RenderH, 0, -1, 100);
glMatrixMode(GL_MODELVIEW);
end;
@@ -444,6 +444,7 @@ begin
ScreenLoading := TScreenLoading.Create;
ScreenLoading.onShow;
Display.ActualScreen := @ScreenLoading;
+ swapbuffers;
ScreenLoading.Draw;
Display.Draw;
SwapBuffers;
diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas
index 0bded712..fcba4382 100644
--- a/Game/Code/Menu/UDisplay.pas
+++ b/Game/Code/Menu/UDisplay.pas
@@ -75,7 +75,7 @@ begin
canFade:=True;
// generate texture for fading between screens
- GetMem(pTexData, 512*512*3);
+ GetMem(pTexData, 512*512*4);
if pTexData <> NIL then
for i:= 1 to 2 do
begin
@@ -83,7 +83,7 @@ begin
if glGetError <> GL_NO_ERROR then canFade := False;
glBindTexture(GL_TEXTURE_2D, pTex[i]);
if glGetError <> GL_NO_ERROR then canFade := False;
- glTexImage2D(GL_TEXTURE_2D, 0, 3, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, pTexData);
+ glTexImage2D(GL_TEXTURE_2D, 0, 4, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, pTexData);
if glGetError <> GL_NO_ERROR then canFade := False;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
if glGetError <> GL_NO_ERROR then canFade := False;
@@ -185,7 +185,7 @@ begin
glViewPort(0, 0, 512, 512);
ActualScreen.Draw;
glBindTexture(GL_TEXTURE_2D, pTex[S]);
- glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 512, 512, 0);
+ glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 512, 512, 0);
glError:=glGetError;
if glError <> GL_NO_ERROR then
begin
@@ -229,7 +229,7 @@ begin
// blackscreen-hack
if not BlackScreen then
NextScreen.Draw // draw next screen
- else begin
+ else if ScreenAct=1 then begin
glClearColor(0, 0, 0 , 0);
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
end;
diff --git a/Game/Code/Menu/UMenu.pas b/Game/Code/Menu/UMenu.pas
index 0fb1614f..b0622d4b 100644
--- a/Game/Code/Menu/UMenu.pas
+++ b/Game/Code/Menu/UMenu.pas
@@ -712,14 +712,6 @@ var
PetX: integer;
PetY: integer;
begin
-// glClearColor(1, 1, 1, 1);
-// glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity;
- glOrtho(0, RenderW, RenderH, 0, -1, 100);
- glMatrixMode(GL_MODELVIEW);
-
BackImg.ColR := 1;
BackImg.ColG := 1;
BackImg.ColB := 1;
@@ -728,13 +720,17 @@ begin
BackImg.TexX2 := 1;
BackImg.TexY2 := 1;
if (BackImg.TexNum <> -1) then begin
- // draw texture with overlapping
+ // does anyone know what these loops were for?
+{ // draw texture with overlapping
for PetY := 1 to BackH do
for PetX := 1 to BackW do begin
BackImg.X := (PetX-1)/BackW * 800; //640
BackImg.Y := (PetY-1)/BackH * 600; //480
DrawTexture(BackImg);
- end; // for PetX
+ end; // for PetX}
+ BackImg.X:=BackW;
+ BackImg.Y:=BackW;
+ DrawTexture(BackImg);
end; // if
end;