stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src stratagus/stratagus.c video/curso...


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src stratagus/stratagus.c video/curso...
Date: 15 Jan 2004 10:48:46 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/15 10:48:45

Modified files:
        src/stratagus  : stratagus.c 
        src/video      : cursor.c font.c graphic.c sdl.c video.c 

Log message:
        USE_OPENGL fixes

Patches:
Index: stratagus/src/stratagus/stratagus.c
diff -u stratagus/src/stratagus/stratagus.c:1.245 
stratagus/src/stratagus/stratagus.c:1.246
--- stratagus/src/stratagus/stratagus.c:1.245   Thu Jan 15 10:17:28 2004
+++ stratagus/src/stratagus/stratagus.c Thu Jan 15 10:48:43 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: stratagus.c,v 1.245 2004/01/14 23:17:28 nobody_ Exp $
+//      $Id: stratagus.c,v 1.246 2004/01/14 23:48:43 jsalmon3 Exp $
 
 //@{
 
@@ -879,6 +879,7 @@
 #endif
                                }
                                Invalidate();
+                               RealizeVideoMemory();
                                WaitForInput(TitleScreens[i]->Timeout);
                        }
                }
Index: stratagus/src/video/cursor.c
diff -u stratagus/src/video/cursor.c:1.91 stratagus/src/video/cursor.c:1.92
--- stratagus/src/video/cursor.c:1.91   Thu Jan 15 04:50:08 2004
+++ stratagus/src/video/cursor.c        Thu Jan 15 10:48:44 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: cursor.c,v 1.91 2004/01/14 17:50:08 jsalmon3 Exp $
+//      $Id: cursor.c,v 1.92 2004/01/14 23:48:44 jsalmon3 Exp $
 
 //@{
 
@@ -146,10 +146,16 @@
        **       (x >= 0, y >= 0, w > 0, h > 0, (x + w - 1) <= VideoWidth, (y + 
h - 1) <= VideoHeight)
        */
 #ifdef USE_SDL_SURFACE
+#ifndef USE_OPENGL
 local void SaveCursorBackground(int x, int y, int w, int h);
        /// Function pointer: Load background behind cursor
 local void LoadCursorBackground(int x, int y, int w, int h);
 #else
+#define LoadCursorBackground(x, y, w, h)  // nothing
+#define SaveCursorBackground(x, y, w, h)  // nothing
+#endif
+
+#else
 local void (*SaveCursorBackground)(int x, int y, int w, int h);
        /// Function pointer: Load background behind cursor
 local void (*LoadCursorBackground)(int x, int y, int w, int h);
@@ -185,11 +191,13 @@
 **             non-empty
 **      (x >= 0, y >= 0, w > 0, h > 0, (x + w - 1) <= VideoWidth, (y + h - 1) 
<= VideoHeight)
 */
+#ifndef USE_OPENGL
 #ifdef USE_SDL_SURFACE
 global void SaveCursorRectangle(void* buffer, int x, int y, int w, int h);
 #else
 global void (*SaveCursorRectangle)(void* buffer, int x, int y, int w, int h);
 #endif
+#endif
 
 /**
 **             Function pointer: Load rectangle behind cursor
@@ -202,11 +210,13 @@
 **
 **             @note rectangle previously saved with 
SaveCursorRectangle(x,y,w,h)
 */
+#ifndef USE_OPENGL
 #ifdef USE_SDL_SURFACE
 global void LoadCursorRectangle(void* buffer, int x, int y, int w, int h);
 #else
 global void (*LoadCursorRectangle)(void* buffer, int x, int y, int w, int h);
 #endif
+#endif
 
 /*----------------------------------------------------------------------------
 --             Functions
@@ -284,6 +294,7 @@
 ----------------------------------------------------------------------------*/
 
 #ifdef USE_SDL_SURFACE
+#ifndef USE_OPENGL
 global void LoadCursorRectangle(void* buffer, int x, int y, int w, int h)
 {
        int i;
@@ -344,6 +355,7 @@
 
        VideoUnlockScreen();
 }
+#endif
 #else
 /**
 **             Puts stored 'image' from SAVECURSORRECTANGLE back on the screen.
@@ -536,6 +548,7 @@
 --             DRAW SPRITE CURSOR
 ----------------------------------------------------------------------------*/
 #ifdef USE_SDL_SURFACE
+#ifndef USE_OPENGL
 local void LoadCursorBackground(int x, int y, int w, int h)
 {
        SDL_Rect drect;
@@ -563,6 +576,7 @@
 
        SDL_BlitSurface(TheScreen, &srect, OldCursorImage, NULL);
 }
+#endif
 #else
 /**
 **             Restore cursor background for 8bpp frame buffer.
@@ -1164,29 +1178,6 @@
        }
 }
 
-#ifdef USE_OPENGL
-local void LoadCursorRectangleOpenGL(void* buffer __attribute__((unused)),
-       int x __attribute__((unused)), int y __attribute__((unused)),
-       int w __attribute__((unused)), int h __attribute__((unused)))
-{
-}
-local void SaveCursorRectangleOpenGL(void* buffer __attribute__((unused)),
-       int x __attribute__((unused)), int y __attribute__((unused)),
-       int w __attribute__((unused)), int h __attribute__((unused)))
-{
-}
-local void LoadCursorBackgroundOpenGL(int x __attribute__((unused)),
-       int y __attribute__((unused)),
-       int w __attribute__((unused)), int h __attribute__((unused)))
-{
-}
-local void SaveCursorBackgroundOpenGL(int x __attribute__((unused)),
-       int y __attribute__((unused)),
-       int w __attribute__((unused)), int h __attribute__((unused)))
-{
-}
-#endif
-
 /**
 **             Setup the cursor part.
 **
@@ -1195,13 +1186,7 @@
 */
 global void InitVideoCursors(void)
 {
-#ifdef USE_OPENGL
-       SaveCursorBackground = SaveCursorBackgroundOpenGL;
-       LoadCursorBackground = LoadCursorBackgroundOpenGL;
-       MemSize = 1;
-       SaveCursorRectangle = SaveCursorRectangleOpenGL;
-       LoadCursorRectangle = LoadCursorRectangleOpenGL;
-#else
+#ifndef USE_OPENGL
        if (OldCursorRectangle) {               // memory of possible previous 
video-setting?
                free(OldCursorRectangle);
                OldCursorRectangle = 0;
@@ -1261,7 +1246,7 @@
        int i;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.91 2004/01/14 
17:50:08 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.92 2004/01/14 
23:48:44 jsalmon3 Exp $\n\n");
 
        for (i = 0; Cursors[i].OType; ++i) {
                CLprintf(file, "(define-cursor '%s '%s\n",
Index: stratagus/src/video/font.c
diff -u stratagus/src/video/font.c:1.75 stratagus/src/video/font.c:1.76
--- stratagus/src/video/font.c:1.75     Thu Jan 15 04:50:08 2004
+++ stratagus/src/video/font.c  Thu Jan 15 10:48:44 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: font.c,v 1.75 2004/01/14 17:50:08 jsalmon3 Exp $
+//      $Id: font.c,v 1.76 2004/01/14 23:48:44 jsalmon3 Exp $
 
 //@{
 
@@ -161,6 +161,7 @@
 **  @param x       X screen position
 **  @param y       Y screen position
 */
+#ifndef USE_OPENGL
 local void VideoDrawChar(const Graphic* sprite,
        int gx, int gy, int w, int h, int x, int y)
 {
@@ -179,9 +180,29 @@
 
        SDL_BlitSurface(sprite->Surface, &srect, TheScreen, &drect);
 }
-
 #else
+local void VideoDrawChar(const Graphic* sprite,
+       int gx, int gy, int w, int h, int x, int y)
+{
+       SDL_Color* c;
+       int i;
+
+       glDisable(GL_TEXTURE_2D);
+
+       for (i = 0; i < NumFontColors; ++i) {
+               c = FontColor->Color + i;
+               glColor3ub(c->r, c->g, c->b);
+               glRasterPos2i(x, VideoHeight - y - h);
+               glBitmap(FontBitmapWidths[CurrentFont] * 8, h,
+                       0.0f, 0.0f, 0.0f, 0.0f,
+                       FontBitmaps[CurrentFont][i] +
+                               (gy + Fonts[CurrentFont].Height - h) * 
FontBitmapWidths[CurrentFont]);
+       }
 
+       glEnable(GL_TEXTURE_2D);
+}
+#endif
+#else
 /**
 **  Draw character with current color into 8bit video memory.
 **
@@ -403,40 +424,6 @@
 }
 #endif
 
-#ifdef USE_OPENGL
-/**
-**  Draw character with current color.
-**
-**  @param sprite  Pointer to object
-**  @param gx      X offset into object
-**  @param gy      Y offset into object
-**  @param w       width to display
-**  @param h       height to display
-**  @param x       X screen position
-**  @param y       Y screen position
-*/
-local void VideoDrawCharOpenGL(const Graphic* sprite,
-       int gx, int gy, int w, int h, int x, int y)
-{
-       Palette c;
-       int i;
-
-       glDisable(GL_TEXTURE_2D);
-
-       for (i = 0; i < NumFontColors; ++i) {
-               //c = FontPixels[i];
-               memcpy(&c, FontPixels + i, sizeof(Palette));
-               glColor3ub(c.r, c.g, c.b);
-               glRasterPos2i(x, VideoHeight - y - h);
-               glBitmap(FontBitmapWidths[CurrentFont] * 8, h,
-                       0.0f, 0.0f, 0.0f, 0.0f,
-                       FontBitmaps[CurrentFont][i] + (gy + 
Fonts[CurrentFont].Height - h) * FontBitmapWidths[CurrentFont]);
-       }
-
-       glEnable(GL_TEXTURE_2D);
-}
-#endif
-
 #ifdef USE_SDL_SURFACE
 /**
 **  FIXME: docu
@@ -692,7 +679,7 @@
                        w = fp->CharWidth[*text - 32];
                        DrawChar(fp->Graphic, 0, height * (*text - 32), w, 
height, x + widths, y);
                } else {
-                       w=fp->CharWidth[0];
+                       w = fp->CharWidth[0];
                        DrawChar(fp->Graphic, 0, height * 0, w, height, x + 
widths, y);
                }
                widths += w + 1;
@@ -884,6 +871,7 @@
 
        fp->CharWidth[0] = fp->Width / 2;  // a reasonable value for SPACE
 
+       SDL_LockSurface(fp->Graphic->Surface);
        for (y = 1; y < 207; ++y) {
                sp = (const unsigned char *)fp->Graphic->Surface->pixels +
                        y * fp->Height * fp->Graphic->Width - 1;
@@ -906,6 +894,7 @@
                }
 
        }
+       SDL_UnlockSurface(fp->Graphic->Surface);
 }
 #else
 /**
@@ -967,20 +956,21 @@
 
        FontBitmapWidths[font] = (g->Width + 7) / 8;
 
+       SDL_LockSurface(g->Surface);
        for (n = 0; n < NumFontColors; ++n) {
                if (FontBitmaps[font][n]) {
                        free(FontBitmaps[font][n]);
                }
                FontBitmaps[font][n] = (GLubyte*)malloc(FontBitmapWidths[font] 
* g->Height);
 
-               sp = (const unsigned char*)g->Frames;
+               sp = (const unsigned char*)g->Surface->pixels;
                x = 0;
                numfonts = g->Height / Fonts[font].Height;
                for (k = 0; k < numfonts; ++k) {
                        for (i = 0; i<Fonts[font].Height; ++i) {
                                c = FontBitmaps[font][n] + k * 
Fonts[font].Height * FontBitmapWidths[font] +
                                        (Fonts[font].Height - 1 - i) * 
FontBitmapWidths[font];
-                               for (j=0; j < g->Width; ++j) {
+                               for (j = 0; j < g->Width; ++j) {
                                        if (*sp == n) {
                                                x |= 0x1;
                                        }
@@ -999,6 +989,7 @@
                        }
                }
        }
+       SDL_UnlockSurface(g->Surface);
 }
 #endif
 
@@ -1016,9 +1007,6 @@
        //
        //  First select the font drawing procedure.
        //
-#ifdef USE_OPENGL
-       VideoDrawChar = VideoDrawCharOpenGL;
-#else
 #ifndef USE_SDL_SURFACE
        switch (VideoBpp) {
                case 8:
@@ -1042,7 +1030,6 @@
                        DebugLevel0Fn("unsupported %d bpp\n" _C_ VideoBpp);
                        abort();
        }
-#endif
 #endif
 
        for (i = 0; i < sizeof(Fonts) / sizeof(*Fonts); ++i) {
Index: stratagus/src/video/graphic.c
diff -u stratagus/src/video/graphic.c:1.61 stratagus/src/video/graphic.c:1.62
--- stratagus/src/video/graphic.c:1.61  Thu Jan 15 05:34:04 2004
+++ stratagus/src/video/graphic.c       Thu Jan 15 10:48:44 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: graphic.c,v 1.61 2004/01/14 18:34:04 jsalmon3 Exp $
+//      $Id: graphic.c,v 1.62 2004/01/14 23:48:44 jsalmon3 Exp $
 
 //@{
 
@@ -42,6 +42,7 @@
 #include "video.h"
 #include "iolib.h"
 #include "intern_video.h"
+#include "map.h"
 
 /*----------------------------------------------------------------------------
 --             Declarations
@@ -63,6 +64,18 @@
 ----------------------------------------------------------------------------*/
 
 #ifdef USE_SDL_SURFACE
+/**
+**             Video draw part of graphic.
+**
+**             @param graphic          Pointer to object
+**             @param gx               X offset into object
+**             @param gy               Y offset into object
+**             @param w                width to display
+**             @param h                height to display
+**             @param x                X screen position
+**             @param y                Y screen position
+*/
+#ifndef USE_OPENGL
 global void VideoDrawSub(const Graphic* graphic, int gx, int gy,
        int w, int h, int x, int y)
 {
@@ -79,13 +92,70 @@
 
        SDL_BlitSurface(graphic->Surface, &srect, TheScreen, &drect);
 }
+#else
+global void VideoDrawSub(const Graphic* graphic, int gx, int gy,
+       int w, int h, int x, int y)
+{
+       int sx;
+       int ex;
+       int sy;
+       int ey;
+       GLfloat stx;
+       GLfloat etx;
+       GLfloat sty;
+       GLfloat ety;
+
+       sx = x;
+       ex = sx + w;
+       ey = VideoHeight - y;
+       sy = ey - h;
+
+       stx = (GLfloat)gx / graphic->Width * graphic->TextureWidth;
+       etx = (GLfloat)(gx + w) / graphic->Width * graphic->TextureWidth;
+       sty = (GLfloat)gy / graphic->Height * graphic->TextureHeight;
+       ety = (GLfloat)(gy + h) / graphic->Height * graphic->TextureHeight;
+
+       glBindTexture(GL_TEXTURE_2D, graphic->TextureNames[0]);
+       glBegin(GL_QUADS);
+       glTexCoord2f(stx, 1.0f - ety);
+       glVertex2i(sx, sy);
+       glTexCoord2f(stx, 1.0f - sty);
+       glVertex2i(sx, ey);
+       glTexCoord2f(etx, 1.0f - sty);
+       glVertex2i(ex, ey);
+       glTexCoord2f(etx, 1.0f - ety);
+       glVertex2i(ex, sy);
+       glEnd();
+}
+#endif
 
+/**
+**             Video draw part of graphic clipped.
+**
+**             @param graphic          Pointer to object
+**             @param gx               X offset into object
+**             @param gy               Y offset into object
+**             @param w                width to display
+**             @param h                height to display
+**             @param x                X screen position
+**             @param y                Y screen position
+*/
+#ifndef USE_OPENGL
 global void VideoDrawSubClip(const Graphic* graphic, int gx, int gy,
        int w, int h, int x, int y)
 {
        CLIP_RECTANGLE(x, y, w, h);
        VideoDrawSub(graphic, gx, gy, w, h, x, y);
 }
+#else
+global void VideoDrawSubClip(const Graphic* graphic, int gx, int gy,
+       int w, int h, int x, int y)
+{
+       CLIP_RECTANGLE(x, y, w, h);
+       VideoDrawSub(graphic, gx, gy, w, h, x, y);
+}
+#endif
+
 
 global void VideoDrawSubFaded(const Graphic* graphic, int gx, int gy,
        int w, int h, int x, int y, unsigned char fade)
@@ -291,54 +361,6 @@
 }
 #endif
 
-/**
-**             Video draw part of graphic.
-**
-**             @param graphic          Pointer to object
-**             @param gx               X offset into object
-**             @param gy               Y offset into object
-**             @param w                width to display
-**             @param h                height to display
-**             @param x                X screen position
-**             @param y                Y screen position
-*/
-#ifdef USE_OPENGL
-local void VideoDrawSubOpenGL(const Graphic* graphic, int gx, int gy,
-       int w, int h, int x, int y)
-{
-       int sx;
-       int ex;
-       int sy;
-       int ey;
-       GLfloat stx;
-       GLfloat etx;
-       GLfloat sty;
-       GLfloat ety;
-
-       sx = x;
-       ex = sx + w;
-       ey = VideoHeight - y;
-       sy = ey - h;
-
-       stx = (GLfloat)gx / graphic->Width * graphic->TextureWidth;
-       etx = (GLfloat)(gx + w) / graphic->Width * graphic->TextureWidth;
-       sty = (GLfloat)gy / graphic->Height * graphic->TextureHeight;
-       ety = (GLfloat)(gy + h) / graphic->Height * graphic->TextureHeight;
-
-       glBindTexture(GL_TEXTURE_2D, graphic->TextureNames[0]);
-       glBegin(GL_QUADS);
-       glTexCoord2f(stx, 1.0f - ety);
-       glVertex2i(sx, sy);
-       glTexCoord2f(stx, 1.0f - sty);
-       glVertex2i(sx, ey);
-       glTexCoord2f(etx, 1.0f - sty);
-       glVertex2i(ex, ey);
-       glTexCoord2f(etx, 1.0f - ety);
-       glVertex2i(ex, sy);
-       glEnd();
-}
-#endif
-
 #ifndef USE_SDL_SURFACE
 /**
 **             Video draw part of 8bit graphic clipped into 8 bit framebuffer.
@@ -414,26 +436,6 @@
 #endif
 
 /**
-**             Video draw part of graphic clipped.
-**
-**             @param graphic          Pointer to object
-**             @param gx               X offset into object
-**             @param gy               Y offset into object
-**             @param w                width to display
-**             @param h                height to display
-**             @param x                X screen position
-**             @param y                Y screen position
-*/
-#ifdef USE_OPENGL
-local void VideoDrawSubOpenGLClip(const Graphic* graphic, int gx, int gy,
-       int w, int h, int x, int y)
-{
-       CLIP_RECTANGLE(x, y, w, h);
-       VideoDrawSubOpenGL(graphic, gx, gy, w, h, x, y);
-}
-#endif
-
-/**
 **             Free graphic object.
 */
 #ifdef USE_SDL_SURFACE
@@ -669,18 +671,19 @@
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 
GL_NEAREST);
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 
GL_NEAREST);
+               SDL_LockSurface(graphic->Surface);
                for (i = 0; i < height; ++i) {
-                       sp = (const unsigned char*)graphic->Frames + (x % fl) * 
width +
+                       sp = (const unsigned char*)graphic->Surface->pixels + 
(x % fl) * width +
                                ((x / fl) * height + i) * graphic->Width;
                        for (j = 0; j < width; ++j) {
                                int c;
-                               Palette p;
+                               SDL_Color p;
 
                                c = (h - i - 1) * w * 4 + j * 4;
                                if (*sp == 255) {
                                        tex[c + 3] = 0;
                                } else {
-                                       p = graphic->Palette[*sp];
+                                       p = 
graphic->Surface->format->palette->colors[*sp];
                                        tex[c + 0] = p.r;
                                        tex[c + 1] = p.g;
                                        tex[c + 2] = p.b;
@@ -689,6 +692,7 @@
                                ++sp;
                        }
                }
+               SDL_UnlockSurface(graphic->Surface);
                glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA,
                        GL_UNSIGNED_BYTE, tex);
 #ifdef DEBUG
@@ -727,7 +731,6 @@
                (*g)->NumTextureNames = n;
                (*g)->TextureNames = calloc(n,sizeof(GLuint));
 
-               (*g)->Type = graphic->Type;
                (*g)->Width = graphic->Width;
                (*g)->Height = graphic->Height;
                (*g)->GraphicWidth = graphic->GraphicWidth;
@@ -753,18 +756,19 @@
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+       SDL_LockSurface(graphic->Surface);
        for (i = 0; i < graphic->Height; ++i) {
-               sp = (const unsigned char*)graphic->Frames + (frame % fl) * 
graphic->Width +
+               sp = (const unsigned char*)graphic->Surface->pixels + (frame % 
fl) * graphic->Width +
                        ((frame / fl) * graphic->Height + i) * 
graphic->GraphicWidth;
                for (j = 0; j < graphic->Width; ++j) {
                        int c;
                        int z;
-                       Palette p;
+                       SDL_Color p;
 
                        c = (h - i - 1) * w * 4 + j * 4;
                        for (z = 0; z < maplen; ++z) {
                                if (*sp == map[z * 2]) {
-                                       p = GlobalPalette[map[z * 2 + 1]];
+                                       p = 
TheMap.TileGraphic->Surface->format->palette->colors[map[z * 2 + 1]];
                                        tex[c + 0] = p.r;
                                        tex[c + 1] = p.g;
                                        tex[c + 2] = p.b;
@@ -778,6 +782,7 @@
                        ++sp;
                }
        }
+       SDL_UnlockSurface(graphic->Surface);
        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA,
                GL_UNSIGNED_BYTE, tex);
 #ifdef DEBUG
Index: stratagus/src/video/sdl.c
diff -u stratagus/src/video/sdl.c:1.112 stratagus/src/video/sdl.c:1.113
--- stratagus/src/video/sdl.c:1.112     Thu Jan 15 01:06:43 2004
+++ stratagus/src/video/sdl.c   Thu Jan 15 10:48:45 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: sdl.c,v 1.112 2004/01/14 14:06:43 nobody_ Exp $
+//     $Id: sdl.c,v 1.113 2004/01/14 23:48:45 jsalmon3 Exp $
 
 //@{
 
@@ -150,6 +150,7 @@
        glEnable(GL_BLEND);
        glEnable(GL_TEXTURE_2D);
        glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+       glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 }
 #endif
 
Index: stratagus/src/video/video.c
diff -u stratagus/src/video/video.c:1.86 stratagus/src/video/video.c:1.87
--- stratagus/src/video/video.c:1.86    Thu Jan 15 04:45:36 2004
+++ stratagus/src/video/video.c Thu Jan 15 10:48:45 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: video.c,v 1.86 2004/01/14 17:45:36 jsalmon3 Exp $
+//     $Id: video.c,v 1.87 2004/01/14 23:48:45 jsalmon3 Exp $
 
 //@{
 
@@ -557,9 +557,14 @@
 #endif
 
 #ifdef USE_SDL_SURFACE
+#ifndef USE_OPENGL
        // Unset the alpha color key, not needed
        SDL_SetColorKey(picture->Surface, 0, 0);
        SDL_BlitSurface(picture->Surface, NULL, TheScreen, NULL);
+#else
+       VideoDrawSubClip(picture, 0, 0, picture->Width, picture->Height,
+               (VideoWidth - picture->Width) / 2, (VideoHeight - 
picture->Height) / 2);
+#endif
 #else
        VideoLockScreen();
        VideoDrawSubClip(picture, 0, 0, picture->Width, picture->Height,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]