Remove dd_video module

Functions from module are stubbed and unused.
This commit is contained in:
Azamat H. Hackimov 2024-09-23 00:28:24 +03:00
parent 39e128cb0f
commit eb0f6a2865
14 changed files with 1 additions and 276 deletions

View File

@ -232,7 +232,6 @@ endif()
add_subdirectory(linux)
add_subdirectory(ddio)
add_subdirectory(dd_video)
add_subdirectory(fix)
add_subdirectory(logger)
add_subdirectory(manage)

View File

@ -319,7 +319,6 @@ target_link_libraries(Descent3 PRIVATE
AudioEncode
bitmap
cfile
dd_video
ddebug
ddio
fix

View File

@ -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 {

View File

@ -658,7 +658,6 @@
#include <cstring>
#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
}

View File

@ -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);

View File

@ -1,13 +0,0 @@
set(CPPS
video_lnx.cpp
)
add_library(dd_video STATIC ${CPPS})
target_link_libraries(dd_video PRIVATE
$<$<PLATFORM_ID:Linux,Darwin>:
linux
>
$<$<PLATFORM_ID:Windows>:
misc
>
)

View File

@ -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 <http://www.gnu.org/licenses/>.
--- HISTORICAL COMMENTS FOLLOW ---
* Video library.
*
* $NoKeywords: $
*/
#include <cstring>
#include <cstdlib>
#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) {}

View File

@ -587,7 +587,6 @@ target_link_libraries(Descent3Editor
bitmap
cfile
dd_video
ddio
ddebug
libmve

View File

@ -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();

View File

@ -110,7 +110,7 @@
#include <cstdint>
#include "ddvid.h"
#include "grdefs.h"
#define GRTEXT_BUFLEN 16384
#define GRTEXT_FORMAT_CHAR 0x2

View File

@ -421,7 +421,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "ddvid.h"
#include "pstypes.h"
#include "mono.h"
#include "pserror.h"

View File

@ -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 <http://www.gnu.org/licenses/>.
--- 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

View File

@ -81,7 +81,6 @@
#include "3d.h"
#include "bitmap.h"
#include "grtext.h"
#include "ddvid.h"
#include "renderer.h"
//////////////////////////////////////////////////////////////////////////////

View File

@ -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"