Previous 199869 Revisions Next

r34980 Thursday 12th February, 2015 at 00:09:08 UTC by Couriersud
Temporarily break SDL1.2 Xinerama Multi-Monitor Support as announced on
mailing list. (nw)
[src/osd/sdl]draw13.c drawbgfx.c drawogl.c drawsdl.c sdl.mak video.c video.h window.c

trunk/src/osd/sdl/draw13.c
r243491r243492
721721   {
722722      int ch, cw;
723723
724      if ((window().fullscreen()) && (!video_config.switchres))
725      {
726         ch = window().monitor()->center_height();
727         cw = window().monitor()->center_width();
728      }
729      else
730      {
731         ch = height;
732         cw = width;
733      }
724      ch = height;
725      cw = width;
734726
735727      if (video_config.centerv)
736728      {
trunk/src/osd/sdl/drawbgfx.c
r243491r243492
7373class sdl_info_bgfx : public osd_renderer
7474{
7575public:
76    sdl_info_bgfx(sdl_window_info *w)
76    sdl_info_bgfx(osd_window *w)
7777    : osd_renderer(w, FLAG_NONE), m_blittimer(0), m_renderer(NULL),
7878      m_blitwidth(0), m_blitheight(0),
7979      m_last_hofs(0), m_last_vofs(0),
r243491r243492
128128//  drawbgfx_init
129129//============================================================
130130
131static osd_renderer *drawbgfx_create(sdl_window_info *window)
131static osd_renderer *drawbgfx_create(osd_window *window)
132132{
133133   return global_alloc(sdl_info_bgfx(window));
134134}
trunk/src/osd/sdl/drawogl.c
r243491r243492
13311331   {
13321332      int ch, cw;
13331333
1334      if ((window().fullscreen()) && (!video_config.switchres))
1335      {
1336         ch = window().monitor()->center_height();
1337         cw = window().monitor()->center_width();
1338      }
1339      else
1340      {
1341         ch = m_height;
1342         cw = m_width;
1343      }
1334      ch = m_height;
1335      cw = m_width;
13441336
13451337      if (video_config.centerv)
13461338      {
trunk/src/osd/sdl/drawsdl.c
r243491r243492
671671   blitwidth = m_blitwidth;
672672   blitheight = m_blitheight;
673673
674   // figure out what coordinate system to use for centering - in window mode it's always the
675   // SDL surface size.  in fullscreen the surface covers all monitors, so center according to
676   // the first one only
677   if ((window().fullscreen()) && (!video_config.switchres))
678   {
679      ch = window().monitor()->center_height();
680      cw = window().monitor()->center_width();
681   }
682   else
683   {
684      ch = height;
685      cw = width;
686   }
674   ch = height;
675   cw = width;
687676
688677   // do not crash if the window's smaller than the blit area
689678   if (blitheight > ch)
trunk/src/osd/sdl/sdl.mak
r243491r243492
7171# uncomment to disable MIDI
7272# NO_USE_MIDI = 1
7373
74# uncomment to disable implementations based on assembler code
74# uncomment to disable implementations based on assembler chttp://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gzode
7575# NOASM = 1
7676
7777# change for custom OS X installations
r243491r243492
8181# SDL_LIBVER = sdl
8282
8383# uncomment to use BGFX
84# USE_BGFX = 1
8584
85USE_BGFX = 1
86
8687###########################################################################
8788##################   END USER-CONFIGURABLE OPTIONS   ######################
8889###########################################################################
trunk/src/osd/sdl/video.c
r243491r243492
151151   SDL_GetCurrentDisplayMode(m_handle, &dmode);
152152   #endif
153153   SDL_GetDisplayBounds(m_handle, &m_dimensions);
154   m_center_width = m_dimensions.w;
155   m_center_height = m_dimensions.h;
156154
157155   // FIXME: Use SDL_GetDisplayBounds(monitor->handle, &tt) to update monitor_x
158156   // SDL_Rect tt;
r243491r243492
195193         m_dimensions.w = DisplayWidth(info.info.x11.display, screen);
196194         m_dimensions.h = DisplayHeight(info.info.x11.display, screen);
197195
196         /* FIXME: If Xinerame is used we should compile a list of monitors
197          * like we do for other targets and ignore SDL.
198          */
198199         if ((XineramaIsActive(info.info.x11.display)) && video_config.restrictonemonitor)
199200         {
200201            XineramaScreenInfo *xineinfo;
201202            int numscreens;
202203
203               xineinfo = XineramaQueryScreens(info.info.x11.display, &numscreens);
204            xineinfo = XineramaQueryScreens(info.info.x11.display, &numscreens);
204205
205            m_center_width = xineinfo[0].width;
206            m_center_height = xineinfo[0].height;
206            m_dimensions.w = xineinfo[0].width;
207            m_dimensions.h = xineinfo[0].height;
207208
208209            XFree(xineinfo);
210            printf("XineneraActive\n");
209211         }
210         else
211         {
212            m_center_width = m_dimensions.w;
213            m_center_height = m_dimensions.h;
214         }
215212      }
216213      else
217214      #endif // defined(SDLMAME_X11)
r243491r243492
250247         }
251248         m_dimensions.w = cw;
252249         m_dimensions.h = ch;
253         m_center_width = cw;
254         m_center_height = ch;
255250      }
256251   }
257252   #elif defined(SDLMAME_OS2)      // OS2 version
r243491r243492
428423
429424         SDL_GetDesktopDisplayMode(i, &dmode);
430425         SDL_GetDisplayBounds(i, &monitor->m_dimensions);
431         monitor->m_center_width = monitor->m_dimensions.w;
432         monitor->m_center_height = monitor->m_dimensions.h;
433426
434427         // guess the aspect ratio assuming square pixels
435428         monitor->m_aspect = (float)(dmode.w) / (float)(dmode.h);
trunk/src/osd/sdl/video.h
r243491r243492
6565public:
6666
6767   sdl_monitor_info()
68   : m_next(NULL), m_handle(0), m_aspect(0.0f),
69     m_center_width(0), m_center_height(0)
68   : m_next(NULL), m_handle(0), m_aspect(0.0f)
7069     {}
7170   sdl_monitor_info(const UINT64 handle, const char *monitor_device, float aspect)
72   : m_next(NULL), m_handle(handle), m_aspect(aspect),
73     m_center_width(0), m_center_height(0)
71   : m_next(NULL), m_handle(handle), m_aspect(aspect)
7472   {
7573      strncpy(m_monitor_device, monitor_device, 64);
7674      refresh();
r243491r243492
8381
8482   float aspect();
8583
86   int   center_width() { refresh(); return m_center_width; }
87   int center_height() { refresh(); return m_center_height; }
88
8984   void set_aspect(const float aspect) { m_aspect = aspect; }
9085
9186   // STATIC
r243491r243492
111106   SDL_Rect         m_dimensions;
112107   char                m_monitor_device[64];
113108   float               m_aspect;                 // computed/configured aspect ratio of the physical device
114   int                 m_center_width;           // width of first physical screen for centering
115   int                 m_center_height;          // height of first physical screen for centering
116
117
118109};
119110
120111
trunk/src/osd/sdl/window.c
r243491r243492
385385void sdl_window_info::blit_surface_size(int &blitwidth, int &blitheight)
386386{
387387   int window_width, window_height;
388   if ((!fullscreen()) || (video_config.switchres))
389   {
390      get_size(window_width, window_height);
391   }
392   else
393   {
394      window_width = monitor()->center_width();
395      window_height = monitor()->center_height();
396   }
388   get_size(window_width, window_height);
397389
398
399390   INT32 newwidth, newheight;
400391   int xscale = 1, yscale = 1;
401392   float desired_aspect = 1.0f;
r243491r243492
14331424   propheight = MAX(propheight, minheight);
14341425
14351426   // clamp against the maximum (fit on one screen for full screen mode)
1427   maxwidth = m_monitor->position_size().w - extrawidth;
1428   maxheight = m_monitor->position_size().h - extraheight;
14361429   if (this->m_fullscreen)
14371430   {
1438      maxwidth = m_monitor->center_width() - extrawidth;
1439      maxheight = m_monitor->center_height() - extraheight;
1431      // nothing
14401432   }
14411433   else
14421434   {
1443      maxwidth = m_monitor->center_width() - extrawidth;
1444      maxheight = m_monitor->center_height() - extraheight;
1445
14461435      // further clamp to the maximum width/height in the window
14471436      if (this->m_maxwidth != 0)
14481437         maxwidth = MIN(maxwidth, this->m_maxwidth + extrawidth);
r243491r243492
15221511   INT32 maxwidth, maxheight;
15231512
15241513   // compute the maximum client area
1525   maxwidth = m_monitor->center_width();
1526   maxheight = m_monitor->center_height();
1514   maxwidth = m_monitor->position_size().w;
1515   maxheight = m_monitor->position_size().h;
15271516
15281517   // clamp to the window's max
15291518   if (this->m_maxwidth != 0)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team