Author: grzywacz
Date: Mon May 19 01:48:36 2008
New Revision: 26715

URL: http://svn.gna.org/viewcvs/wesnoth?rev=26715&view=rev
Log:
Use HW surfaces for gp2x.

Modified:
    branches/gp2x/src/minimap.cpp
    branches/gp2x/src/mouse_events.cpp
    branches/gp2x/src/video.cpp

Modified: branches/gp2x/src/minimap.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/gp2x/src/minimap.cpp?rev=26715&r1=26714&r2=26715&view=diff
==============================================================================
--- branches/gp2x/src/minimap.cpp (original)
+++ branches/gp2x/src/minimap.cpp Mon May 19 01:48:36 2008
@@ -35,7 +35,7 @@
                return surface(NULL);
        }
 
-       surface minimap(SDL_CreateRGBSurface(SDL_SWSURFACE,
+       surface minimap(SDL_CreateRGBSurface(SDL_HWSURFACE,
                                       map_width,map_height,
                                       pixel_format->BitsPerPixel,
                                       pixel_format->Rmask,

Modified: branches/gp2x/src/mouse_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/gp2x/src/mouse_events.cpp?rev=26715&r1=26714&r2=26715&view=diff
==============================================================================
--- branches/gp2x/src/mouse_events.cpp (original)
+++ branches/gp2x/src/mouse_events.cpp Mon May 19 01:48:36 2008
@@ -506,7 +506,7 @@
                height = 5 + (fs + 2) * hp_prob_vector.size();
 
                // Create the surface.
-               surf = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height,
+               surf = SDL_CreateRGBSurface(SDL_HWSURFACE, width, height,
                                                                        
image::pixel_format->BitsPerPixel,
                                                                
image::pixel_format->Rmask,
                                                                
image::pixel_format->Gmask,

Modified: branches/gp2x/src/video.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/gp2x/src/video.cpp?rev=26715&r1=26714&r2=26715&view=diff
==============================================================================
--- branches/gp2x/src/video.cpp (original)
+++ branches/gp2x/src/video.cpp Mon May 19 01:48:36 2008
@@ -21,6 +21,8 @@
 #include "image.hpp"
 #include "log.hpp"
 #include "video.hpp"
+
+#include <SDL_gp2x.h>
 
 #define LOG_DP LOG_STREAM(info, display)
 #define ERR_DP LOG_STREAM(err, display)
@@ -74,9 +76,8 @@
 {
        //SDL under Windows doesn't seem to like hardware surfaces for
        //some reason.
-#if !(defined(_WIN32) || defined(__APPLE__) || defined(__AMIGAOS4__) || 
defined(GP2X))
-               flags |= SDL_HWSURFACE;
-#endif
+       flags |= SDL_HWSURFACE;
+
        if((flags&SDL_FULLSCREEN) == 0)
                flags |= SDL_RESIZABLE;
 
@@ -248,7 +249,7 @@
 void CVideo::make_fake()
 {
        fake_screen = true;
-       frameBuffer = 
SDL_CreateRGBSurface(SDL_SWSURFACE,1,1,24,0xFF0000,0xFF00,0xFF,0);
+       frameBuffer = 
SDL_CreateRGBSurface(SDL_HWSURFACE,1,1,24,0xFF0000,0xFF00,0xFF,0);
        image::set_pixel_format(frameBuffer->format);
 }
 
@@ -267,6 +268,8 @@
 
        if( res == 0 )
                return 0;
+
+       SDL_GP2X_AllowGfxMemory(NULL, 0);
 
        fullScreen = (flags & FULL_SCREEN) != 0;
        frameBuffer = SDL_SetVideoMode( x, y, bits_per_pixel, flags );
@@ -340,11 +343,12 @@
                }
 
                const size_t redraw_whole_screen_threshold = 80;
-               if(sum > ((getx()*gety())*redraw_whole_screen_threshold)/100) {
+/*             if(sum > ((getx()*gety())*redraw_whole_screen_threshold)/100) {
                        ::SDL_Flip(frameBuffer);
                } else {
                        
SDL_UpdateRects(frameBuffer,update_rects.size(),&update_rects[0]);
-               }
+               }*/
+               ::SDL_Flip(frameBuffer);
        }
 
        clear_updates();


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to