mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Remove DDAccess.h header, and associated DD_ACCESS_RING definition
This definition was used to control the accessibility of some class members, changing protected qualifiers to public. This introduced unnecessary coupling between components and headers. All conditional access specifiers have been set to public, which should not be a problem given the low number of classes that actually used affected members. Another albeit more complex solution could have been to use friend classes.
This commit is contained in:
parent
07262f6fef
commit
dc138e4912
@ -41,7 +41,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#define DD_ACCESS_RING
|
||||
#include "vibeinterface.h"
|
||||
|
||||
#ifndef WIN32
|
||||
|
@ -33,7 +33,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "DDAccess.h" // Allow this module full DD access
|
||||
#include "ddgrWin32.h"
|
||||
#include "ddgrWin32DX.h"
|
||||
#include "Application.h"
|
||||
|
@ -73,7 +73,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "DDAccess.h" // Allow this module full DD access
|
||||
#include "ddgrWin32.h"
|
||||
#include "ddgrWin32GDI.h"
|
||||
#include "Application.h"
|
||||
|
@ -16,9 +16,6 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// NEED THIS SINCE DDSNDLIB is a DD library.
|
||||
#include "DDAccess.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -203,9 +203,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
// NEED THIS SINCE DDSNDLIB is a DD library.
|
||||
#include "DDAccess.h"
|
||||
|
||||
#include "ds3dlib_internal.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -47,7 +47,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "DDAccess.h" // DD Access enabled
|
||||
|
||||
#include "ddvidlib.h"
|
||||
#include "pserror.h"
|
||||
|
@ -40,7 +40,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "DDAccess.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <math.h>
|
||||
|
@ -94,7 +94,6 @@
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
|
||||
#include "DDAccess.h"
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
|
@ -108,8 +108,6 @@
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
|
||||
#include "DDAccess.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "pserror.h"
|
||||
|
@ -175,7 +175,6 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// Keyboard Interface
|
||||
// ----------------------------------------------------------------------------
|
||||
#include "DDAccess.h"
|
||||
|
||||
#include "pserror.h"
|
||||
#include "mono.h"
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "DDAccess.h"
|
||||
#include "pserror.h"
|
||||
#include "mono.h"
|
||||
#include "ddio.h"
|
||||
|
@ -1,59 +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/DDAccess.h $
|
||||
* $Revision: 3 $
|
||||
* $Date: 8/13/97 3:02p $
|
||||
* $Author: Samir $
|
||||
*
|
||||
* Device Dependant Access Manager. (Allow access of libraries to OS information)
|
||||
*
|
||||
* $Log: /DescentIII/Main/lib/DDAccess.h $
|
||||
*
|
||||
* 3 8/13/97 3:02p Samir
|
||||
* A 'cleaner' way to do DirectInput mouse stuff.
|
||||
*
|
||||
* 2 8/01/97 7:31p Samir
|
||||
* Slightly better interface.
|
||||
*
|
||||
* 1 5/23/97 4:07p Samir
|
||||
* Device Dependant Data Access Manager.
|
||||
*
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#ifndef DDACCESS_H
|
||||
#define DDACCESS_H
|
||||
|
||||
// allows access to DD system information, such as OS specific info.
|
||||
|
||||
#define DD_ACCESS_RING
|
||||
|
||||
// Win32 region of DD_ACCESS
|
||||
// Include the standard windows header since API calls are available in DD_ACCESS_RING
|
||||
// Define any additional messages too.
|
||||
|
||||
#if defined(WIN32)
|
||||
|
||||
// Messages
|
||||
#define WM_SYNCMOUSEACQUIRE (WM_USER + 0)
|
||||
|
||||
#endif // WIN32
|
||||
|
||||
#endif
|
@ -172,7 +172,6 @@ typedef struct ddgr_surface {
|
||||
int locks; // lock count.
|
||||
} ddgr_surface;
|
||||
|
||||
#if defined(DD_ACCESS_RING) // only available to DD_ACCESS libraries.
|
||||
#if defined(WIN32)
|
||||
/*
|
||||
ddraw_surf = true if this is a true DirectDraw surface, false if a GDI surface
|
||||
@ -183,7 +182,6 @@ void ddgr_surf_GetPrivateData(ddgr_surface *sf, bool *ddraw_surf, uint *object_p
|
||||
// you must typecase this return value to LPDIRECTDRAW
|
||||
unsigned ddgr_GetDDrawObject();
|
||||
#endif // WIN32
|
||||
#endif // DD_ACCESS_RING
|
||||
|
||||
/* Surface Functions
|
||||
*/
|
||||
|
@ -50,11 +50,7 @@ typedef enum tTaskPriority { TASKPRIORITY_HIGHEST, TASKPRIORITY_NORMAL, TASKPRIO
|
||||
// handle multitasking differently.
|
||||
|
||||
class osEvent {
|
||||
#if defined(DD_ACCESS_RING)
|
||||
public:
|
||||
#else
|
||||
private:
|
||||
#endif // DD_ACCESS_RING_0
|
||||
#if defined(WIN32)
|
||||
unsigned event_os_handle; // this is the Win32 Event Handle
|
||||
#endif // WIN32
|
||||
@ -71,11 +67,7 @@ public:
|
||||
};
|
||||
|
||||
class osTask {
|
||||
#if defined(DD_ACCESS_RING)
|
||||
public:
|
||||
#else
|
||||
private:
|
||||
#endif // DD_ACCESS_RING_0
|
||||
#if defined(WIN32)
|
||||
unsigned task_os_handle; // This is the Win32 EventHandle
|
||||
unsigned task_os_id; // Win32 Thread ID
|
||||
|
@ -680,11 +680,9 @@ void rend_CopyBitmapToFramebuffer(int bm_handle, int x, int y);
|
||||
// Gets a renderer ready for a framebuffer copy, or stops a framebuffer copy
|
||||
void rend_SetFrameBufferCopyState(bool state);
|
||||
|
||||
#if defined(DD_ACCESS_RING)
|
||||
#if defined(WIN32)
|
||||
// returns the direct draw object
|
||||
void *rend_RetrieveDirectDrawObj(void **frontsurf, void **backsurf);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -212,12 +212,7 @@ public:
|
||||
// detect if application can handle what we want of it.
|
||||
static bool GetSystemSpecs(const char *fname);
|
||||
|
||||
// These variables are only accessable to modules that have DD_ACCESS.
|
||||
#if defined(DD_ACCESS_RING)
|
||||
public:
|
||||
#else
|
||||
protected:
|
||||
#endif
|
||||
HWnd m_hWnd; // handles created by the system
|
||||
HInstance m_hInstance;
|
||||
unsigned m_Flags;
|
||||
@ -227,11 +222,7 @@ private:
|
||||
void os_init(); // initializes OS components.
|
||||
};
|
||||
|
||||
// the following data is communicated by the application library to other DDAccessed libraries.
|
||||
#if defined(DD_ACCESS_RING)
|
||||
|
||||
// system mouse info.
|
||||
extern short w32_msewhl_delta; // value of mouse wheel delta for frame
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -56,7 +56,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "DDAccess.h"
|
||||
#include "application.h"
|
||||
#include "AppConsole.h"
|
||||
#include "TaskSystem.h"
|
||||
|
@ -45,7 +45,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "DDAccess.h"
|
||||
#include "application.h"
|
||||
#include "AppConsole.h"
|
||||
#include "TaskSystem.h"
|
||||
|
@ -39,7 +39,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
#include "DDAccess.h"
|
||||
#include "application.h"
|
||||
#include "AppConsole.h"
|
||||
#include "TaskSystem.h"
|
||||
|
@ -26,7 +26,6 @@
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
||||
#include "DDAccess.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
|
@ -25,7 +25,6 @@
|
||||
#else
|
||||
#endif
|
||||
|
||||
#include "DDAccess.h"
|
||||
#include "pstypes.h"
|
||||
#include "pserror.h"
|
||||
#include "mono.h"
|
||||
|
@ -67,7 +67,6 @@
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
|
||||
#include "DDAccess.h"
|
||||
#include "Application.h"
|
||||
#include "AppConsole.h"
|
||||
#include "TaskSystem.h"
|
||||
|
@ -44,9 +44,6 @@
|
||||
* $NoKeywords: $
|
||||
*/
|
||||
|
||||
// Allow Full DD system access.
|
||||
#include "DDAccess.h"
|
||||
|
||||
// Library includes
|
||||
#include "TaskSystem.h"
|
||||
#include "pserror.h"
|
||||
|
Loading…
Reference in New Issue
Block a user