aboutsummaryrefslogtreecommitdiffstats
path: root/Game
diff options
context:
space:
mode:
authorb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-24 13:02:06 +0000
committerb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-24 13:02:06 +0000
commit569213582ca4147e6df5309f65d8a442da394a25 (patch)
tree0476b6043c06de1d8a338e8b6fa8d2d36e6bbb91 /Game
parente79530fd2165c92a9291076b05dfb0e0236fc222 (diff)
downloadusdx-569213582ca4147e6df5309f65d8a442da394a25.tar.gz
usdx-569213582ca4147e6df5309f65d8a442da394a25.tar.xz
usdx-569213582ca4147e6df5309f65d8a442da394a25.zip
changed size of texture for screen fading effect to fixed size of 512x512, need comments
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@132 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game')
-rw-r--r--Game/Code/Menu/UDisplay.pas16
1 files changed, 9 insertions, 7 deletions
diff --git a/Game/Code/Menu/UDisplay.pas b/Game/Code/Menu/UDisplay.pas
index 6144f3bd..ddbc0d1f 100644
--- a/Game/Code/Menu/UDisplay.pas
+++ b/Game/Code/Menu/UDisplay.pas
@@ -55,7 +55,7 @@ begin
canFade:=True;
// generate texture for fading between screens
- GetMem(pTexData, 1024*1024*3);
+ GetMem(pTexData, 512*512*3);
if pTexData <> NIL then
for i:= 1 to 2 do
begin
@@ -63,7 +63,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, 1024, 1024, 0, GL_RGB, GL_UNSIGNED_BYTE, pTexData);
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, 512, 512, 0, GL_RGB, 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;
@@ -117,7 +117,7 @@ begin
// if (Screens = 2) and (S = 2) then ScreenX := 1;
ScreenX := 0;
- if S = 2 then TimeSkip := 0 else;
+ if S = 2 then TimeSkip := 0 else;
glViewPort((S-1) * ScreenW div Screens, 0, ScreenW div Screens, ScreenH);
// ActualScreen.SetAnimationProgress(1);
@@ -139,9 +139,11 @@ begin
//Create Fading texture if we're just starting
if myfade = 0 then
begin
+ glViewPort((S-1) * 512, 0, 512, 512);
ActualScreen.Draw;
glBindTexture(GL_TEXTURE_2D, pTex[S]);
- glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, (S-1)*ScreenW div Screens, 0, 1024, 1024, 0);
+ glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, (S-1)*512, 0, 512, 512, 0);
+ glViewPort((S-1) * ScreenW div Screens, 0, ScreenW div Screens, ScreenH);
if glGetError <> GL_NO_ERROR then
begin
canFade := False;
@@ -180,9 +182,9 @@ begin
glEnable(GL_BLEND);
glBegin(GL_QUADS);
glTexCoord2f(0+myfade2,0+myfade2);glVertex2f(0, 600);
- glTexCoord2f(0+myfade2,ScreenH/1024-myfade2);glVertex2f(0, 0);
- glTexCoord2f((ScreenW div Screens)/1024-myfade2,ScreenH/1024-myfade2);glVertex2f(800, 0);
- glTexCoord2f((ScreenW div Screens)/1024-myfade2,0+myfade2);glVertex2f(800, 600);
+ glTexCoord2f(0+myfade2,1-myfade2);glVertex2f(0, 0);
+ glTexCoord2f(1-myfade2,1-myfade2);glVertex2f(800, 0);
+ glTexCoord2f(1-myfade2,0+myfade2);glVertex2f(800, 600);
glEnd;
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);