diff options
author | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2005-03-20 09:56:17 +0000 |
---|---|---|
committer | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2005-03-20 09:56:17 +0000 |
commit | 5a6df07da93a559fa1c23b002319f9ebf4fd0933 (patch) | |
tree | f5fc3e70d3ddc717f1a8bd81a22aaf10b824c90c /rfbplayer | |
parent | 34be1fa75fcc20d00f7d49243ad4ccf957006895 (diff) | |
download | tigervnc-5a6df07da93a559fa1c23b002319f9ebf4fd0933.tar.gz tigervnc-5a6df07da93a559fa1c23b002319f9ebf4fd0933.zip |
Now in RfbPlayer::serverInit() pixel format chooses from supportedPF list.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@258 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'rfbplayer')
-rw-r--r-- | rfbplayer/rfbplayer.cxx | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/rfbplayer/rfbplayer.cxx b/rfbplayer/rfbplayer.cxx index 991fa313..614f5c12 100644 --- a/rfbplayer/rfbplayer.cxx +++ b/rfbplayer/rfbplayer.cxx @@ -382,7 +382,7 @@ RfbPlayer::processMainMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; case ID_OPTIONS: { - OptionsDialog optionsDialog(&options); + OptionsDialog optionsDialog(&options, &supportedPF); optionsDialog.showDialog(getMainHandle()); } break; @@ -891,34 +891,31 @@ void RfbPlayer::serverInit() { throw rdr::Exception("This version plays only true color session!"); // Set the session pixel format - static long pixelFormat = PF_AUTO; + static long pixelFormatIndex = -1; if (options.askPixelFormat) { - ChoosePixelFormatDialog choosePixelFormatDialog(pixelFormat); + ChoosePixelFormatDialog choosePixelFormatDialog(pixelFormatIndex, &supportedPF); if (choosePixelFormatDialog.showDialog(getMainHandle())) { - pixelFormat = choosePixelFormatDialog.getPF(); + pixelFormatIndex = choosePixelFormatDialog.getPF(); + if (pixelFormatIndex < 0) { + options.autoDetectPF = true; + options.setPF((PixelFormat *)&cp.pf()); + } else { + options.autoDetectPF = false; + options.setPF(&supportedPF[pixelFormatIndex].PF); + } } else { is->pausePlayback(); throw rdr::Exception("[TERMINATE]"); } } else { - pixelFormat = options.pixelFormatIndex; - } - switch (pixelFormat) { - case PF_AUTO: - break; - case PF_D8_RGB332: - cp.setPF(PixelFormat(8,8,0,1,7,7,3,0,3,6)); - break; - case PF_D16_RGB655: - cp.setPF(PixelFormat(16,16,0,1,63,31,31,0,6,11)); - break; - case PF_D24_RGB888: - cp.setPF(PixelFormat(32,24,0,1,255,255,255,16,8,0)); - break; - default: - throw rdr::Exception("This color depth is not supported!"); + if (options.autoDetectPF) { + options.setPF((PixelFormat *)&cp.pf()); + } else { + options.setPF(&supportedPF[options.pixelFormatIndex].PF); + } } - buffer->setPF(cp.pf()); + cp.setPF(options.pixelFormat); + buffer->setPF(options.pixelFormat); // If the window is not maximised then resize it if (!(GetWindowLong(getMainHandle(), GWL_STYLE) & WS_MAXIMIZE)) |