Browse Source

Avoid double copying on video playback

pull/124/head
Anders Jenbo 7 years ago
parent
commit
79711f4dcd
  1. 1
      SourceX/miniwin/ddraw.h
  2. 6
      SourceX/storm/storm.cpp

1
SourceX/miniwin/ddraw.h

@ -9,6 +9,7 @@ extern SDL_Texture *texture;
extern SDL_Surface *surface; extern SDL_Surface *surface;
extern SDL_Palette *palette; extern SDL_Palette *palette;
extern SDL_Surface *pal_surface; extern SDL_Surface *pal_surface;
extern bool bufferUpdated;
struct StubDraw : public IDirectDraw { struct StubDraw : public IDirectDraw {
public: public:

6
SourceX/storm/storm.cpp

@ -588,13 +588,13 @@ BOOL SVidPlayContinue(void)
return SVidLoadNextFrame(); // Skip video if the system is to slow return SVidLoadNextFrame(); // Skip video if the system is to slow
} }
SDL_Rect pal_surface_offset = { 64, 160, 0, 0 }; if (SDL_BlitSurface(SVidSurface, NULL, surface, NULL) <= -1) {
if (SDL_BlitSurface(SVidSurface, NULL, pal_surface, &pal_surface_offset) <= -1) {
SDL_Log(SDL_GetError()); SDL_Log(SDL_GetError());
return false; return false;
} }
SetFadeLevel(256); // present frame bufferUpdated = true;
lpDDSPrimary->Unlock(NULL);
double now = SDL_GetTicks() * 1000; double now = SDL_GetTicks() * 1000;
if (now < SVidFrameEnd) { if (now < SVidFrameEnd) {

Loading…
Cancel
Save