diff --git a/CMakeLists.txt b/CMakeLists.txt index 88ad30e2..2c4eb731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -232,7 +232,6 @@ endif() add_subdirectory(linux) add_subdirectory(ddio) -add_subdirectory(dd_video) add_subdirectory(fix) add_subdirectory(logger) add_subdirectory(manage) diff --git a/Descent3/CMakeLists.txt b/Descent3/CMakeLists.txt index e4919033..7ae9570d 100644 --- a/Descent3/CMakeLists.txt +++ b/Descent3/CMakeLists.txt @@ -319,7 +319,6 @@ target_link_libraries(Descent3 PRIVATE AudioEncode bitmap cfile - dd_video ddebug ddio fix diff --git a/Descent3/d3movie.cpp b/Descent3/d3movie.cpp index 891af1a2..1d627343 100644 --- a/Descent3/d3movie.cpp +++ b/Descent3/d3movie.cpp @@ -23,14 +23,12 @@ #include "bitmap.h" #include "d3movie.h" #include "ddio.h" -#include "ddvid.h" #include "game.h" #include "gamefont.h" #include "grtext.h" #include "log.h" #include "mem.h" #include "mvelib.h" -#include "pserror.h" #include "renderer.h" namespace { diff --git a/Descent3/game.cpp b/Descent3/game.cpp index 0050d688..14ad58c8 100644 --- a/Descent3/game.cpp +++ b/Descent3/game.cpp @@ -658,7 +658,6 @@ #include #include "game.h" -#include "ddvid.h" #include "ddio.h" #include "pserror.h" #include "descent.h" @@ -1024,15 +1023,6 @@ void SetScreenMode(int sm, bool force_res_change) { rend_width = rs.screen_width; rend_height = rs.screen_height; - // sets up the screen resolution for the system - if (!UseHardware) { - ddvid_SetVideoMode(rend_width, rend_height, BPP_16, true); - } else { - if (PreferredRenderer == RENDERER_OPENGL) { - ddvid_SetVideoMode(rend_width, rend_height, BPP_16, false); - } - } - // chose font. SelectHUDFont(rend_width); @@ -1099,8 +1089,6 @@ void SetScreenMode(int sm, bool force_res_change) { // the editor window, the screen would belong to the editor window. tLnxAppInfo appinfo; Descent->get_info(&appinfo); - // LGT - Disabled: not using ddvid - // ddvid_SetVideoHandle(hGameWnd); #endif } diff --git a/Descent3/init.cpp b/Descent3/init.cpp index 0b5c9c59..1081986d 100644 --- a/Descent3/init.cpp +++ b/Descent3/init.cpp @@ -1590,11 +1590,6 @@ void InitGraphics(bool editor) { #else strcpy(App_ddvid_subsystem, "GDIX"); - if (!Dedicated_server) { - if (!ddvid_Init(Descent, App_ddvid_subsystem)) - Error("Graphics initialization failed.\n"); - } - INIT_MESSAGE("Loading fonts."); LoadAllFonts(); #endif @@ -2105,7 +2100,6 @@ void ShutdownD3() { Init_old_screen_mode = GetScreenMode(); Init_old_ui_callback = GetUICallback(); SetScreenMode(SM_NULL); - ddvid_Close(); // shutdown IO ddio_Close(); @@ -2136,7 +2130,6 @@ void RestartD3() { } // startup screen. - ddvid_Init(Descent, App_ddvid_subsystem); ddio_KeyFlush(); SetScreenMode(Init_old_screen_mode); SetUICallback(Init_old_ui_callback); diff --git a/dd_video/CMakeLists.txt b/dd_video/CMakeLists.txt deleted file mode 100644 index fec366e8..00000000 --- a/dd_video/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(CPPS - video_lnx.cpp -) - -add_library(dd_video STATIC ${CPPS}) -target_link_libraries(dd_video PRIVATE - $<$: - linux - > - $<$: - misc - > -) diff --git a/dd_video/video_lnx.cpp b/dd_video/video_lnx.cpp deleted file mode 100644 index 3f568f7b..00000000 --- a/dd_video/video_lnx.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* -* Descent 3 -* Copyright (C) 2024 Parallax Software -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . - ---- HISTORICAL COMMENTS FOLLOW --- - - * Video library. - * - * $NoKeywords: $ - */ - -#include -#include - -#include "ddvid.h" -#include "application.h" -#include "lnxapp.h" - -struct tinfo { - int width, height, bytesperpixel, linewidth; -}; - -struct tDDVideoInfo { - oeLnxApplication *app; - // vga_modeinfo *info; - tinfo *info; - bool paged; -}; - -////////////////////////////////////////////////////////////////////////////// -// Variables - -tDDVideoInfo DDVideo_info; -static bool DDVideo_init = false; - -////////////////////////////////////////////////////////////////////////////// -// Prototypes - -////////////////////////////////////////////////////////////////////////////// -// Functions - -// called first to allow fullscreen video access -bool ddvid_Init(oeApplication *app, char *driver) { - int subsys_id; - - // preinitialize system. - if (!DDVideo_init) { - DDVideo_info.app = NULL; - DDVideo_info.info = NULL; - atexit(ddvid_Close); - } else { - ddvid_Close(); - } - - DDVideo_init = true; - - DDVideo_info.app = (oeLnxApplication *)app; - - // vga_init(); - return true; -} - -// closes ddvid system manually. -void ddvid_Close() { - if (!DDVideo_init) - return; - - /* - if(vga_getcurrentmode()!=TEXT) - vga_setmode(TEXT); - */ - DDVideo_init = false; -} - -// sets the appropriate video mode. -bool ddvid_SetVideoMode(int w, int h, int color_depth, bool paged) { - /* - ASSERT(DDVideo_init); - - int mode = -1; - - if( (w==640) && (h==480) ){ - switch(color_depth){ - case BPP_8: - mode = G640x480x256; - break; - case BPP_16: - mode = G640x480x32K; - break; - case BPP_24: - mode = G640x480x64K; - break; - case BPP_32: - mode = G640x480x16M; - break; - } - }else - if( (w==512) && (h==384) ){ - mode = -1; - }else - if( (w==800) && (h==600) ){ - switch(color_depth){ - case BPP_8: - mode = G800x600x256; - break; - case BPP_16: - mode = G800x600x32K; - break; - case BPP_24: - mode = G800x600x64K; - break; - case BPP_32: - mode = G800x600x16M; - break; - } - } - - if(mode==-1) - return false; - - if(!vga_hasmode(mode)) - return false; - - DDVideo_info.info = vga_getmodeinfo(mode); - - DDVideo_info.paged = (bool)(DDVideo_info.info->flags&HAVE_RWPAGE); - - if( (paged) && (!(DDVideo_info.paged)) ){ - DDVideo_info.info = NULL; - Error("Pages not supported by mode %d\n",mode); - return false; - } - - vga_setmode(mode); - */ - return true; -} - -// sets screen handle -void ddvid_SetVideoHandle(unsigned handle) {} diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index ebf01cdb..12f1b0c2 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -587,7 +587,6 @@ target_link_libraries(Descent3Editor bitmap cfile - dd_video ddio ddebug libmve diff --git a/editor/gameeditor.cpp b/editor/gameeditor.cpp index 2c3d652e..20cc0334 100644 --- a/editor/gameeditor.cpp +++ b/editor/gameeditor.cpp @@ -508,7 +508,6 @@ #include "ObjScript.h" #include "controls.h" #include "3d.h" -#include "ddvid.h" #include "gamefont.h" #include "newui.h" #include "pilot.h" @@ -636,9 +635,6 @@ void GameToEditor(bool set_viewer_from_player) { // Reset previous working directory ddio_SetWorkingDir(Editor_dir); - // close down video system only! - ddvid_Close(); - ASSERT((OBJECT_OUTSIDE(Viewer_object) != 0) == (Editor_view_mode == VM_TERRAIN)); SlewStop(Viewer_object); @@ -819,10 +815,6 @@ void EditorToGame() { Saved_editor_app->defer(); Descent->defer(); - // Initialize graphics and sound this must be done after initialization of new window and - // after deferring to OS. - if (!ddvid_Init(Descent, subsystem)) - Error("Graphics initialization failed.\n"); } else if (D3EditState.fullscreen_debug_state) { CMenu *menu = theApp.main_frame->GetMenu(); @@ -840,11 +832,6 @@ void EditorToGame() { Saved_editor_app->defer(); Descent->defer(); - // Initialize graphics and sound this must be done after initialization of new window and - // after deferring to OS. - if (!ddvid_Init(Saved_editor_app, subsystem)) - Error("Graphics initialization failed.\n"); - // force application to think it's active. SetActiveWindow((HWND)hGameWnd); // Descent->activate(); @@ -859,10 +846,6 @@ void EditorToGame() { SetWindowLong(theApp.main_frame->m_hWnd, GWL_STYLE, EditorWndStyle & ~(WS_CAPTION | WS_THICKFRAME | WS_BORDER)); SetClassLong(theApp.main_frame->m_hWnd, GCL_HBRBACKGROUND, (DWORD)GetStockObject(HOLLOW_BRUSH)); - // Initialize graphics and sound this must be done after initialization of new window and - // after deferring to OS. - if (!ddvid_Init(Descent, subsystem)) - Error("Graphics initialization failed.\n"); } // Initialize IO System for child window @@ -872,9 +855,6 @@ void EditorToGame() { // Init force feedback ForceInit(); - // Create game screen and clear it. - ddvid_SetVideoHandle(hGameWnd); - // Initialize everything else. InitEditGameSystems(); diff --git a/grtext/grtext.h b/grtext/grtext.h index ffc3d8a5..ddb5114b 100644 --- a/grtext/grtext.h +++ b/grtext/grtext.h @@ -110,7 +110,7 @@ #include -#include "ddvid.h" +#include "grdefs.h" #define GRTEXT_BUFLEN 16384 #define GRTEXT_FORMAT_CHAR 0x2 diff --git a/legacy/renderer/renderer.cpp b/legacy/renderer/renderer.cpp index 8c5ddf2f..ae50631e 100644 --- a/legacy/renderer/renderer.cpp +++ b/legacy/renderer/renderer.cpp @@ -421,7 +421,6 @@ #include #include #include -#include "ddvid.h" #include "pstypes.h" #include "mono.h" #include "pserror.h" diff --git a/lib/ddvid.h b/lib/ddvid.h deleted file mode 100644 index f4a98649..00000000 --- a/lib/ddvid.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -* Descent 3 -* Copyright (C) 2024 Parallax Software -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . - ---- HISTORICAL COMMENTS FOLLOW --- - - * $Logfile: /DescentIII/Main/lib/ddvid.h $ - * $Revision: 4 $ - * $Date: 12/29/97 5:50p $ - * $Author: Samir $ - * - * Video library. - * - * $Log: /DescentIII/Main/lib/ddvid.h $ - * - * 4 12/29/97 5:50p Samir - * Added ability to close ddvid system. - * - * 3 12/22/97 7:13p Samir - * Moved constants to grdefs.h - * - * 2 12/22/97 6:58p Samir - * Restored type ddgr_color - * - * 1 12/22/97 12:45p Samir - * Initial revision - * - * $NoKeywords: $ - */ - -#ifndef DDVID_H -#define DDVID_H - -#include "pstypes.h" -#include "grdefs.h" - -class oeApplication; - -// called first to allow fullscreen video access -bool ddvid_Init(oeApplication *app, char *driver); -void ddvid_Close(); - -// sets the appropriate video mode. -bool ddvid_SetVideoMode(int w, int h, int color_depth, bool paged); - -// sets screen handle -void ddvid_SetVideoHandle(unsigned handle); - -#endif diff --git a/ui/UIDraw.cpp b/ui/UIDraw.cpp index 164d3cc4..4e1e82bd 100644 --- a/ui/UIDraw.cpp +++ b/ui/UIDraw.cpp @@ -81,7 +81,6 @@ #include "3d.h" #include "bitmap.h" #include "grtext.h" -#include "ddvid.h" #include "renderer.h" ////////////////////////////////////////////////////////////////////////////// diff --git a/ui/UISystem.cpp b/ui/UISystem.cpp index 7d7814f4..2bb2eda7 100644 --- a/ui/UISystem.cpp +++ b/ui/UISystem.cpp @@ -169,7 +169,6 @@ #include "UIlib.h" #include "application.h" #include "bitmap.h" -#include "ddvid.h" #include "log.h" #include "renderer.h" #include "Macros.h"