From b68dd72cf6832705687aeacffa7785835c829982 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 11 Dec 2025 12:10:14 +0100 Subject: [PATCH] =?UTF-8?q?EgtExecutor=20:=20-=20migliorie=20nella=20funzi?= =?UTF-8?q?one=20ExeGetImageEx=20per=20gestione=20errori=20e=20per=20modal?= =?UTF-8?q?it=C3=A0=20driver=20OpenGL=201.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EXE_Scene.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/EXE_Scene.cpp b/EXE_Scene.cpp index 259b23a..be755fc 100644 --- a/EXE_Scene.cpp +++ b/EXE_Scene.cpp @@ -1008,7 +1008,7 @@ CALLBACK SceneBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG : { // imposto dimensione box e picture - const int WIN_MAX_DIM = 1024 ; + const int WIN_MAX_DIM = ( s_nDriver == 1 ? 512 : 1024) ; int nWinW = ( s_nWidth >= s_nHeight ? WIN_MAX_DIM : ( WIN_MAX_DIM * s_nWidth) / s_nHeight) ; int nWinH = ( s_nHeight >= s_nWidth ? WIN_MAX_DIM : ( WIN_MAX_DIM * s_nHeight) / s_nWidth) ; HWND hPic = GetDlgItem( hwndDlg, IDC_PICTURE1) ; @@ -1023,10 +1023,15 @@ CALLBACK SceneBoxProc( HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) s_nContext = nContext ; pGseCtx->m_pScene->SetCamera( s_nCameraDir) ; pGseCtx->m_pScene->ZoomAll() ; - pGseCtx->m_pScene->GetImage( s_nShowMode, s_colBackTop, s_colBackBottom, s_nWidth, s_nHeight, s_sImageFile) ; + if ( ! pGseCtx->m_pScene->GetImage( s_nShowMode, s_colBackTop, s_colBackBottom, s_nWidth, s_nHeight, s_sImageFile)) + s_nContext = -s_nContext ; MyResetGroupObjGraphics( pGseCtx->m_pGeomDB, GDB_ID_ROOT) ; EndDialog( hwndDlg, wParam) ; } + else { + s_nContext = 0 ; + EndDialog( hwndDlg, wParam) ; + } } else s_nContext = 0 ; @@ -1063,9 +1068,9 @@ ExeGetImageEx( int nDriver, bool b2Buff, int nColorBits, int nDepthBits, // lancio dialogo HWND hTopWnd = ExeGetMainWindowHandle() ; DialogBox( GetModuleIstance(), MAKEINTRESOURCE( IDD_LUASCENE), hTopWnd, (DLGPROC)SceneBoxProc) ; - bool bOk = ( s_nContext != 0) ; + bool bOk = ( s_nContext > 0) ; // elimino la scena dal contesto - GseContext* pGseCtx = GetGseContext( s_nContext) ; + GseContext* pGseCtx = GetGseContext( abs( s_nContext)) ; if ( pGseCtx != nullptr) { delete pGseCtx->m_pScene ; pGseCtx->m_pScene = nullptr ;