summaryrefslogtreecommitdiffstats
path: root/src/skel/win
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-08-16 13:46:20 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-08-16 13:46:20 +0200
commit7669b97ac64bd77dc0932210f81e4a0def9bfb1b (patch)
tree51c7580701ea00abc769e68d14a83a25b8ebd0cf /src/skel/win
parentsubmodule (diff)
parentMerge branch 'master' into miami (diff)
downloadre3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar
re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.gz
re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.bz2
re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.lz
re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.xz
re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.tar.zst
re3-7669b97ac64bd77dc0932210f81e4a0def9bfb1b.zip
Diffstat (limited to 'src/skel/win')
-rw-r--r--src/skel/win/win.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 75a3a7c9..0b2b48c9 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -245,6 +245,23 @@ psCameraShowRaster(RwCamera *camera)
/*
*****************************************************************************
*/
+RwImage *
+psGrabScreen(RwCamera *pCamera)
+{
+#ifndef LIBRW
+ RwRaster *pRaster = RwCameraGetRaster(pCamera);
+ if (RwImage *pImage = RwImageCreate(pRaster->width, pRaster->height, 32)) {
+ RwImageAllocatePixels(pImage);
+ RwImageSetFromRaster(pImage, pRaster);
+ return pImage;
+ }
+#endif
+ return nil;
+}
+
+/*
+ *****************************************************************************
+ */
RwUInt32
psTimer(void)
{
@@ -1863,7 +1880,11 @@ void PlayMovieInWindow(int cmdShow, const char* szFile)
MultiByteToWideChar(CP_ACP, 0, szFile, -1, wFileName, sizeof(wFileName) - 1);
// Initialize COM
+#ifdef FIX_BUGS // will also return S_FALSE if it has already been inited in the same thread
+ CoInitialize(nil);
+#else
JIF(CoInitialize(nil));
+#endif
// Get the interface for DirectShow's GraphBuilder
JIF(CoCreateInstance(CLSID_FilterGraph, nil, CLSCTX_INPROC,
@@ -2233,9 +2254,10 @@ WinMain(HINSTANCE instance,
case GS_INIT_INTRO_MPEG:
{
+#ifndef NO_MOVIES
CloseClip();
-
CoUninitialize();
+#endif
if ( FrontEndMenuManager.OS_Language == LANG_FRENCH || FrontEndMenuManager.OS_Language == LANG_GERMAN )
PlayMovieInWindow(cmdShow, "movies\\GTAtitlesGER.mpg");
@@ -2269,8 +2291,10 @@ WinMain(HINSTANCE instance,
case GS_INIT_ONCE:
{
+#ifndef NO_MOVIES
CloseClip();
CoUninitialize();
+#endif
#ifdef FIX_BUGS
// draw one frame because otherwise we'll end up looking at black screen for a while if vsync is on