From bbe394111df4fde73d8c253f27219da09be8276a Mon Sep 17 00:00:00 2001 From: GravisZro Date: Sun, 2 Jun 2024 12:26:55 -0400 Subject: [PATCH] Header clean up --- 2dlib/ddgr.h | 2 -- 2dlib/lib2d.h | 2 +- 2dlib/memsurf.cpp | 9 +++++---- 2dlib/pen.cpp | 1 + Descent3/Controls.cpp | 5 ----- Descent3/CtlCfgElem.cpp | 1 - Descent3/TelComGoals.cpp | 2 -- Descent3/config.cpp | 17 ++--------------- Descent3/config.h | 2 ++ Descent3/ctlconfig.cpp | 11 +++++++---- Descent3/dedicated_server.cpp | 6 ------ Descent3/descent.h | 4 ++++ Descent3/init.cpp | 2 ++ Descent3/intellivibe.cpp | 1 + Descent3/lighting.cpp | 4 ---- Descent3/lnxmain.cpp | 7 ++++--- Descent3/multi_dll_mgr.h | 3 +++ Descent3/program.cpp | 5 +++++ Descent3/room.h | 2 +- Descent3/splinter.cpp | 7 ++----- Descent3/terrain.cpp | 8 ++------ Descent3/weapon.cpp | 15 ++++++--------- Descent3/winmain.cpp | 4 ++-- bitmap/bitmap.cpp | 17 +++++++++-------- bitmap/bitmap.h | 5 ----- bitmap/bumpmap.h | 2 +- bitmap/lightmap.h | 2 +- cfile/cfile.h | 3 +-- cfile/inffile.h | 12 ++++++------ czip/CZip.cpp | 8 ++++---- d3music/musicapi.cpp | 14 ++++---------- dd_grwin32/ddgrWin32DX.cpp | 2 +- dd_grwin32/ddgrWin32GDI.cpp | 2 +- dd_video/ddvid.h | 3 +-- dd_video/ddvidlib.h | 7 +++++-- dd_video/vidWin32FS.cpp | 1 + dd_video/vidWin32Win.cpp | 3 ++- dd_video/video_lnx.cpp | 1 - dd_video/video_win32.cpp | 2 +- ddio/appdatabase.h | 8 +------- ddio/application.h | 8 ++------ ddio/controller.h | 9 --------- ddio/ddio_common.h | 3 ++- ddio/ddio_lnx.h | 2 +- ddio/lnxio.cpp | 2 +- ddio/lnxkey.cpp | 2 +- ddio/winforcefeedback.cpp | 2 +- ddio/winio.cpp | 6 +++--- ddio/winkey.cpp | 3 +-- ddio/winmouse.cpp | 7 +++---- grtext/grfont.cpp | 12 +++++++----- grtext/grtext.cpp | 10 +++++----- grtext/grtext.h | 3 +-- grtext/grtextlib.h | 3 +-- lib/psclass.h | 3 +++ libacm/aencode.h | 1 - libacm/libacm.h | 2 ++ linux/linux_fix.h | 1 + linux/lnxapp.cpp | 4 +++- linux/lnxapp.h | 2 +- linux/lnxcon.cpp | 5 +---- linux/lnxcon_null.cpp | 3 --- linux/lnxcon_raw.cpp | 11 ++++------- linux/lnxcontroller.cpp | 8 +++++--- linux/lnxdata.cpp | 1 - linux/lnxdatabase.h | 4 ++-- linux/registry.cpp | 9 +++++---- linux/registry.h | 2 -- manage/manage.h | 3 +-- model/newstyle.cpp | 12 +++++------- model/polymodel.cpp | 11 ++++------- model/polymodel.h | 4 ---- model/polymodel_external.h | 2 +- module/module.cpp | 13 +++++-------- movie/movie.cpp | 1 + movie/movie.h | 5 ++++- music/music.h | 2 -- music/musiclib.h | 6 +++++- music/omflex.cpp | 7 +++++-- music/sequencer.cpp | 6 ------ music/streamer.cpp | 1 + netcon/inetfile/CFtp.h | 5 +++++ netcon/inetfile/inetgetfile.h | 2 -- networking/networking.h | 1 - renderer/HardwareOpenGL.cpp | 7 +++++-- renderer/dyna_gl.h | 3 ++- sndlib/CMakeLists.txt | 20 ++++++++++++-------- sndlib/ds3dlib.cpp | 18 ++++++++++-------- stream_audio/streamaudio.cpp | 8 +++++--- stream_audio/streamaudio.h | 1 - ui/UIEdit.cpp | 3 ++- ui/UISystem.cpp | 3 +-- win32/CMakeLists.txt | 4 ++-- win32/winapp.cpp | 13 ++++++++----- win32/{win32app.h => winapp.h} | 2 ++ win32/wincon.cpp | 11 +++++------ win32/wincontroller.cpp | 4 ++-- win32/windata.cpp | 2 +- win32/{win32database.h => windatabase.h} | 2 ++ 99 files changed, 241 insertions(+), 281 deletions(-) rename win32/{win32app.h => winapp.h} (99%) rename win32/{win32database.h => windatabase.h} (99%) diff --git a/2dlib/ddgr.h b/2dlib/ddgr.h index 820876769..7bce392ab 100644 --- a/2dlib/ddgr.h +++ b/2dlib/ddgr.h @@ -78,8 +78,6 @@ #ifndef _DDGR_H #define _DDGR_H -#include "pstypes.h" -#include "Macros.h" #include "grdefs.h" // ---------------------------------------------------------------------------- diff --git a/2dlib/lib2d.h b/2dlib/lib2d.h index 9615fb6bb..ce335dcf3 100644 --- a/2dlib/lib2d.h +++ b/2dlib/lib2d.h @@ -24,7 +24,7 @@ #define LIB2D_H #include "gr.h" -#include "renderer.h" +#include "ddgr.h" // structures diff --git a/2dlib/memsurf.cpp b/2dlib/memsurf.cpp index 6d96729a4..6e7a758a5 100644 --- a/2dlib/memsurf.cpp +++ b/2dlib/memsurf.cpp @@ -68,12 +68,13 @@ * $NoKeywords: $ */ -#include "lib2d.h" +#include "gr.h" -#include "bitmap.h" +#include +#include -#include -#include +#include "lib2d.h" +#include "bitmap.h" #include "mem.h" // ---------------------------------------------------------------------------- diff --git a/2dlib/pen.cpp b/2dlib/pen.cpp index df0b61e73..16fcce413 100644 --- a/2dlib/pen.cpp +++ b/2dlib/pen.cpp @@ -93,6 +93,7 @@ #include "lib2d.h" #include "pserror.h" +#include "renderer.h" #define CLIP_LEFT (vp_InitLeft + vp_Left) #define CLIP_TOP (vp_InitTop + vp_Top) diff --git a/Descent3/Controls.cpp b/Descent3/Controls.cpp index 0423c84b5..5b6a00be2 100644 --- a/Descent3/Controls.cpp +++ b/Descent3/Controls.cpp @@ -406,21 +406,16 @@ #include "controls.h" -#include "object.h" #include "pserror.h" #include "game.h" #include "ddio.h" #include "joystick.h" -#include "descent.h" #include "mono.h" #include "weapon.h" -#include "controller.h" -#include "Macros.h" #include "gamesequence.h" #include "pilot.h" #include "hud.h" #include "stringtable.h" -#include "TelCom.h" #include "multi.h" #include "args.h" diff --git a/Descent3/CtlCfgElem.cpp b/Descent3/CtlCfgElem.cpp index 1a69f607e..dcb693030 100644 --- a/Descent3/CtlCfgElem.cpp +++ b/Descent3/CtlCfgElem.cpp @@ -125,7 +125,6 @@ #include "localization.h" #include -#include "joystick.h" // all controller binding texts static char Ctltext_KeyBindings[][16] = {"", diff --git a/Descent3/TelComGoals.cpp b/Descent3/TelComGoals.cpp index af0ebc463..2cc0b90ad 100644 --- a/Descent3/TelComGoals.cpp +++ b/Descent3/TelComGoals.cpp @@ -95,14 +95,12 @@ #include "game.h" #include "mem.h" #include "stringtable.h" -#include "gametexture.h" #include "textaux.h" #include "TelComEfxStructs.h" #include "TelComEffects.h" #include "levelgoal.h" #include "textaux.h" #include "Mission.h" -#include "Macros.h" #include "hlsoundlib.h" #include diff --git a/Descent3/config.cpp b/Descent3/config.cpp index 29848dc3b..f893076ed 100644 --- a/Descent3/config.cpp +++ b/Descent3/config.cpp @@ -279,36 +279,21 @@ * $NoKeywords: $ */ -#include "ConfigItem.h" -#include "player.h" #include "config.h" -#include "ddio.h" #include "newui.h" #include "3d.h" -#include "polymodel.h" #include "application.h" #include "descent.h" #include "mono.h" -#include "Mission.h" -#include "ddio.h" -#include "gamefont.h" -#include "multi_ui.h" -#include "cinematics.h" #include "hlsoundlib.h" #include "terrain.h" -#include "cfile.h" -#include "mem.h" -#include "lighting.h" #include "physics.h" #include "pilot.h" #include "hud.h" -#include "voice.h" #include "bitmap.h" #include "game.h" -#include "render.h" #include "stringtable.h" #include "SmallViews.h" -#include "D3ForceFeedback.h" #include "descent.h" #include "appdatabase.h" #include "hlsoundlib.h" @@ -316,6 +301,8 @@ #include "sounds.h" #include "ctlconfig.h" #include "musicapi.h" +#include "Macros.h" +#include "forcefeedback.h" #include #include diff --git a/Descent3/config.h b/Descent3/config.h index e0fd088d9..d5698178a 100644 --- a/Descent3/config.h +++ b/Descent3/config.h @@ -117,6 +117,8 @@ #ifndef __CONFIG_H__ #define __CONFIG_H__ +#include + // Main menu configuration functions // ------------------------------------------------------ // ConfigForceFeedback diff --git a/Descent3/ctlconfig.cpp b/Descent3/ctlconfig.cpp index 854c2d05d..4579528ff 100644 --- a/Descent3/ctlconfig.cpp +++ b/Descent3/ctlconfig.cpp @@ -277,20 +277,23 @@ * * $NoKeywords: $ */ + #include "ctlconfig.h" + +#include + #include "CtlCfgElem.h" #include "ctlconfigtxt.h" #include "game.h" #include "weapon.h" #include "pilot.h" -#include "bitmap.h" -#include "multi.h" #include "gameloop.h" #include "gamefont.h" #include "D3ForceFeedback.h" #include "hlsoundlib.h" -#include "ddio.h" -#include +#include "Macros.h" +#include "ddio_common.h" + ////////////////////////////////////////////////////////////////////////////// #define IDV_KCONFIG 10 #define IDV_CCONFIG 11 diff --git a/Descent3/dedicated_server.cpp b/Descent3/dedicated_server.cpp index 1f7623201..7afb17488 100644 --- a/Descent3/dedicated_server.cpp +++ b/Descent3/dedicated_server.cpp @@ -112,24 +112,18 @@ typedef int socklen_t; #endif -#include "pstypes.h" #include "pserror.h" #include "pstring.h" -#include "cfile.h" #include "inffile.h" #include "dedicated_server.h" #include "multi.h" #include "args.h" #include "appconsole.h" #include "ddio.h" -#include "newui.h" -#include "ui.h" #include "multi_dll_mgr.h" #include "multi_ui.h" #include "Mission.h" #include "multi_server.h" -#include "Macros.h" -#include "game.h" #include "mem.h" #include "stringtable.h" #include "multi_save_settings.h" diff --git a/Descent3/descent.h b/Descent3/descent.h index 8c233154c..64c1c1d7d 100644 --- a/Descent3/descent.h +++ b/Descent3/descent.h @@ -131,6 +131,10 @@ #include #include "application.h" +#ifdef __LINUX__ +#include "linux_fix.h" +#endif + // The name of this product #ifdef DEMO #define PRODUCT_NAME "Descent 3 Demo" diff --git a/Descent3/init.cpp b/Descent3/init.cpp index b28647ecd..00524721f 100644 --- a/Descent3/init.cpp +++ b/Descent3/init.cpp @@ -987,6 +987,8 @@ #include "debuggraph.h" #include "vibeinterface.h" +#include "ddvid.h" + // Uncomment this to allow all languages #define ALLOW_ALL_LANG 1 diff --git a/Descent3/intellivibe.cpp b/Descent3/intellivibe.cpp index 1c82acaa6..c128b5fc6 100644 --- a/Descent3/intellivibe.cpp +++ b/Descent3/intellivibe.cpp @@ -58,6 +58,7 @@ void VIBE_DoForce(vector *) {} void VIBE_DoLevelEnd(void) {} #else +#include "winapp.h" #include "intellivibe.h" #include "module.h" #include "mono.h" diff --git a/Descent3/lighting.cpp b/Descent3/lighting.cpp index f99fbe91a..601bbec4b 100644 --- a/Descent3/lighting.cpp +++ b/Descent3/lighting.cpp @@ -24,12 +24,9 @@ * $NoKeywords: $ */ -#include "3d.h" -#include "texture.h" #include "gametexture.h" #include "lighting.h" #include "lightmap.h" -#include "descent.h" #include "game.h" #include "room.h" #include @@ -42,7 +39,6 @@ #include "config.h" #include "dedicated_server.h" #include "objinfo.h" -#include "Macros.h" #include diff --git a/Descent3/lnxmain.cpp b/Descent3/lnxmain.cpp index ca87022eb..803f43968 100644 --- a/Descent3/lnxmain.cpp +++ b/Descent3/lnxmain.cpp @@ -30,10 +30,10 @@ #include -#include "program.h" +#include "lnxapp.h" +#include "lnxdatabase.h" + #include "descent.h" -#include "application.h" -#include "appdatabase.h" #include "args.h" #include "init.h" @@ -42,6 +42,7 @@ #include "loki_utils.h" #include "log.h" +#include "d3_version.h" extern bool ddio_mouseGrabbed; int no_debug_dialog = 0; diff --git a/Descent3/multi_dll_mgr.h b/Descent3/multi_dll_mgr.h index 25c6eec80..d030b845d 100644 --- a/Descent3/multi_dll_mgr.h +++ b/Descent3/multi_dll_mgr.h @@ -85,6 +85,9 @@ #ifndef _multi_dll_header #define _multi_dll_header +#include "ui.h" +#include "newui.h" + #define MT_EVT_LOGIN 1 #define MT_EVT_FIRST_FRAME 2 #define MT_EVT_FRAME 3 diff --git a/Descent3/program.cpp b/Descent3/program.cpp index 4292369e5..93cee3205 100644 --- a/Descent3/program.cpp +++ b/Descent3/program.cpp @@ -64,6 +64,11 @@ #include "descent.h" #include "appdatabase.h" +#if defined(WIN32) +#include "windatabase.h" +#elif defined(__LINUX__) +#include "lnxdatabase.h" +#endif program_version Program_version; diff --git a/Descent3/room.h b/Descent3/room.h index 4154c79ef..79fadf45c 100644 --- a/Descent3/room.h +++ b/Descent3/room.h @@ -363,9 +363,9 @@ #ifndef _ROOM_H #define _ROOM_H -#include "pstypes.h" #include "vecmat_external.h" #include "gametexture.h" +#include "bitmap.h" #ifdef NEWEDITOR #include "..\neweditor\ned_GameTexture.h" diff --git a/Descent3/splinter.cpp b/Descent3/splinter.cpp index 2422154b8..647cd9d21 100644 --- a/Descent3/splinter.cpp +++ b/Descent3/splinter.cpp @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#include +#include #include "fireball.h" #include "object.h" @@ -23,13 +25,8 @@ #include "polymodel.h" #include "renderer.h" #include "gametexture.h" - -#include "Macros.h" -#include - #include "psrand.h" -#include // Given an object, renders the representation of this splinter void DrawSplinterObject(object *obj) { diff --git a/Descent3/terrain.cpp b/Descent3/terrain.cpp index 494ac30ca..585e49187 100644 --- a/Descent3/terrain.cpp +++ b/Descent3/terrain.cpp @@ -16,25 +16,21 @@ * along with this program. If not, see . */ +#include + #ifdef NEWEDITOR #include "neweditor\globals.h" -#else -#include #endif #include "vecmat.h" -#include "object.h" #include "mono.h" #include "terrain.h" #include "pserror.h" -#include "texture.h" -#include "bitmap.h" #include "gametexture.h" #include "lighting.h" #include "lightmap.h" #include "weather.h" #include #include "mem.h" -#include "Macros.h" #include "dedicated_server.h" #include "psrand.h" #ifdef EDITOR diff --git a/Descent3/weapon.cpp b/Descent3/weapon.cpp index cb845942d..d1ab1fda8 100644 --- a/Descent3/weapon.cpp +++ b/Descent3/weapon.cpp @@ -332,15 +332,16 @@ * $NoKeywords: $ */ +#include +#include +#include +#include +#include + #include "weapon.h" -#include "pstypes.h" #include "pserror.h" #include "object.h" #include "3d.h" -#include -#include -#include -#include #include "bitmap.h" #include "vclip.h" #include "game.h" @@ -348,18 +349,14 @@ #include "player.h" #include "hud.h" #include "hlsoundlib.h" -#include "soundload.h" #include "objinfo.h" #include "gametexture.h" #include "ship.h" -#include "gauges.h" #include "sounds.h" #include "stringtable.h" -#include "Macros.h" #include "cfile.h" #include "AIMain.h" -#include // #include "samirlog.h" #define LOGFILE(_s) diff --git a/Descent3/winmain.cpp b/Descent3/winmain.cpp index af2b43982..c6dbbb9a7 100644 --- a/Descent3/winmain.cpp +++ b/Descent3/winmain.cpp @@ -23,8 +23,8 @@ #include "mono.h" #include "descent.h" #include "texture.h" -#include "application.h" -#include "appdatabase.h" +#include "winapp.h" +#include "windatabase.h" #include "pserror.h" #include "args.h" #include "init.h" diff --git a/bitmap/bitmap.cpp b/bitmap/bitmap.cpp index ca4c92927..8437879aa 100644 --- a/bitmap/bitmap.cpp +++ b/bitmap/bitmap.cpp @@ -297,13 +297,15 @@ * * $NoKeywords: $ */ -#include -#include -#include + + +#include +#include +#include +#include + #include "cfile.h" -#include "texture.h" #include "bitmap.h" -#include "pstypes.h" #include "pserror.h" #include "mono.h" #include "iff.h" @@ -311,11 +313,10 @@ #include "lightmap.h" #include "bumpmap.h" #include "mem.h" -#include "psrand.h" -#include "Macros.h" +#include "psrand.h" +#include "grdefs.h" -#include #define BM_FILETYPE_TGA 1 #define BM_FILETYPE_PCX 2 diff --git a/bitmap/bitmap.h b/bitmap/bitmap.h index 1f5108c4d..a647e351b 100644 --- a/bitmap/bitmap.h +++ b/bitmap/bitmap.h @@ -19,13 +19,8 @@ #ifndef PSBITMAP_H #define PSBITMAP_H -#include "pstypes.h" #include "cfile.h" -#ifdef __LINUX__ -#include "linux_fix.h" //needed for stricmp's throughout bitmap lib -#endif - #define MAX_BITMAPS 5000 #define NUM_MIP_LEVELS 5 diff --git a/bitmap/bumpmap.h b/bitmap/bumpmap.h index d6f12e918..950081721 100644 --- a/bitmap/bumpmap.h +++ b/bitmap/bumpmap.h @@ -19,7 +19,7 @@ #ifndef BUMPMAP_H #define BUMPMAP_H -#include "pstypes.h" +#include #define MAX_BUMPMAPS 500 #define BAD_BUMP_INDEX 65535 diff --git a/bitmap/lightmap.h b/bitmap/lightmap.h index b0bcc1413..af979adb0 100644 --- a/bitmap/lightmap.h +++ b/bitmap/lightmap.h @@ -19,7 +19,7 @@ #ifndef LIGHTMAP_H #define LIGHTMAP_H -#include "pstypes.h" +#include #define MAX_LIGHTMAPS (65534) #define BAD_LM_INDEX 65535 diff --git a/cfile/cfile.h b/cfile/cfile.h index 2c41a1b1d..f0a54abfe 100644 --- a/cfile/cfile.h +++ b/cfile/cfile.h @@ -97,8 +97,7 @@ #include #include #include - -#include "pstypes.h" +#include struct library; diff --git a/cfile/inffile.h b/cfile/inffile.h index 22ae31dad..aa45692a5 100644 --- a/cfile/inffile.h +++ b/cfile/inffile.h @@ -23,12 +23,12 @@ #ifndef INFFILE_H #define INFFILE_H -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#include "pstypes.h" #include "psclass.h" +#include + +#ifdef __LINUX__ +#include "linux_fix.h" +#endif struct CFILE; @@ -71,7 +71,7 @@ class InfFile { struct sym_info // full runtime symbol { - char name[PSPATHNAME_LEN]; + char name[_MAX_PATH]; char *text; }; diff --git a/czip/CZip.cpp b/czip/CZip.cpp index 9166d74e8..25a04130e 100644 --- a/czip/CZip.cpp +++ b/czip/CZip.cpp @@ -34,12 +34,12 @@ * $NoKeywords: $ */ -#include -#include -#include +#include +#include +#include #include + #include "pserror.h" -#include "Macros.h" #include "CZip.h" CZip::CZip() { diff --git a/d3music/musicapi.cpp b/d3music/musicapi.cpp index 6c54e1409..c135b1214 100644 --- a/d3music/musicapi.cpp +++ b/d3music/musicapi.cpp @@ -16,18 +16,12 @@ * along with this program. If not, see . */ -#include "musicapi.h" -#include "music.h" -#include "Macros.h" #include -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif +#include "musicapi.h" +#include "music.h" +#include "mono.h" +#include "pserror.h" // generic constants #define MUSIC_IDLE_TIME 240.0f // how many seconds before background music silences. diff --git a/dd_grwin32/ddgrWin32DX.cpp b/dd_grwin32/ddgrWin32DX.cpp index cfed4de52..323965d33 100644 --- a/dd_grwin32/ddgrWin32DX.cpp +++ b/dd_grwin32/ddgrWin32DX.cpp @@ -35,7 +35,7 @@ #include "ddgrWin32.h" #include "ddgrWin32DX.h" -#include "application.h" +#include "winapp.h" #include "mono.h" #include "pserror.h" diff --git a/dd_grwin32/ddgrWin32GDI.cpp b/dd_grwin32/ddgrWin32GDI.cpp index b2c53c2c1..a2aa0969a 100644 --- a/dd_grwin32/ddgrWin32GDI.cpp +++ b/dd_grwin32/ddgrWin32GDI.cpp @@ -75,7 +75,7 @@ #include "ddgrWin32.h" #include "ddgrWin32GDI.h" -#include "application.h" +#include "winapp.h" #include "mono.h" #include "pserror.h" #include "gr.h" diff --git a/dd_video/ddvid.h b/dd_video/ddvid.h index f4a986493..4797cde7b 100644 --- a/dd_video/ddvid.h +++ b/dd_video/ddvid.h @@ -44,8 +44,7 @@ #ifndef DDVID_H #define DDVID_H -#include "pstypes.h" -#include "grdefs.h" +#include "application.h" class oeApplication; diff --git a/dd_video/ddvidlib.h b/dd_video/ddvidlib.h index d7e03ed8f..083d32084 100644 --- a/dd_video/ddvidlib.h +++ b/dd_video/ddvidlib.h @@ -44,11 +44,14 @@ #ifndef DDVIDLIB_H #define DDVIDLIB_H -#include "ddvid.h" +#include +#include #include #include -#include + +#include "ddvid.h" +#include "winapp.h" #define VM_MAX_MODES 96 diff --git a/dd_video/vidWin32FS.cpp b/dd_video/vidWin32FS.cpp index 1407a1b53..8fa28d81a 100644 --- a/dd_video/vidWin32FS.cpp +++ b/dd_video/vidWin32FS.cpp @@ -52,6 +52,7 @@ #include "ddvidlib.h" #include "pserror.h" +#include "grdefs.h" // DirectDraw Display mode enumeration callback HRESULT WINAPI DDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext); diff --git a/dd_video/vidWin32Win.cpp b/dd_video/vidWin32Win.cpp index 5ac25bd45..49dfcbae0 100644 --- a/dd_video/vidWin32Win.cpp +++ b/dd_video/vidWin32Win.cpp @@ -47,7 +47,8 @@ #include "ddvidlib.h" #include "pserror.h" -#include "application.h" +#include "winapp.h" +#include "grdefs.h" ////////////////////////////////////////////////////////////////////////////// // Variables diff --git a/dd_video/video_lnx.cpp b/dd_video/video_lnx.cpp index 3f568f7b7..b948dcb37 100644 --- a/dd_video/video_lnx.cpp +++ b/dd_video/video_lnx.cpp @@ -26,7 +26,6 @@ #include #include "ddvid.h" -#include "application.h" #include "lnxapp.h" struct tinfo { diff --git a/dd_video/video_win32.cpp b/dd_video/video_win32.cpp index b40966ce1..c8fdcde1b 100644 --- a/dd_video/video_win32.cpp +++ b/dd_video/video_win32.cpp @@ -50,7 +50,7 @@ #include "ddvidlib.h" #include "pserror.h" -#include "application.h" +#include "winapp.h" #include diff --git a/ddio/appdatabase.h b/ddio/appdatabase.h index 8acfcbd2b..c24d499a1 100644 --- a/ddio/appdatabase.h +++ b/ddio/appdatabase.h @@ -51,7 +51,7 @@ #ifndef APPDATABASE #define APPDATABASE -#include "pstypes.h" +#include /* oeAppDatabase to get info about the application from a managed database (or a custom info file) @@ -100,10 +100,4 @@ class oeAppDatabase { Win32 Samir Win32Database.h 06/97 */ -#if defined(WIN32) -#include "win32database.h" -#elif defined(__LINUX__) -#include "lnxdatabase.h" -#endif - #endif diff --git a/ddio/application.h b/ddio/application.h index ccf7cc12e..47bc03d8f 100644 --- a/ddio/application.h +++ b/ddio/application.h @@ -66,7 +66,7 @@ */ #ifndef APP_H #define APP_H -#include "pstypes.h" + /* Basic Application data types */ /* Application Object This object entails initialization and cleanup of all operating system @@ -109,9 +109,5 @@ class oeApplication { Add a platform to this list once implemented: Win32 Samir Win32App.h 06/97 */ -#if defined(WIN32) -#include "win32app.h" -#elif defined(__LINUX__) -#include "lnxapp.h" -#endif + #endif diff --git a/ddio/controller.h b/ddio/controller.h index 2843e0384..f1e37e6c1 100644 --- a/ddio/controller.h +++ b/ddio/controller.h @@ -118,9 +118,6 @@ #include -#include "pstypes.h" -#include "Macros.h" - enum ct_format { ctNoFormat, ctAnalog, // analog information (-1.0 to 1.0) @@ -264,10 +261,4 @@ class gameController { gameController *CreateController(int num_funcs, ct_function *funcs, char *remote_ip); void DestroyController(gameController *ctl); -#if defined(WIN32) -#include "wincontroller.h" -#elif defined(__LINUX__) -#include "lnxcontroller.h" -#endif - #endif diff --git a/ddio/ddio_common.h b/ddio/ddio_common.h index 22af91d48..837d6202e 100644 --- a/ddio/ddio_common.h +++ b/ddio/ddio_common.h @@ -117,8 +117,9 @@ #ifndef DDIO_COMMON_H #define DDIO_COMMON_H +#include + #include "application.h" -#include "pstypes.h" #define DDIO_MOUSE_LITE 2 // some ddio systems support the 'lite' extension of mice. diff --git a/ddio/ddio_lnx.h b/ddio/ddio_lnx.h index 8e96b1d80..888747f42 100644 --- a/ddio/ddio_lnx.h +++ b/ddio/ddio_lnx.h @@ -24,7 +24,7 @@ #ifndef DDIO_LNX_H #define DDIO_LNX_H -#include "application.h" +#include "lnxapp.h" extern oeLnxApplication *Lnx_app_obj; diff --git a/ddio/lnxio.cpp b/ddio/lnxio.cpp index 900764853..40cf64807 100644 --- a/ddio/lnxio.cpp +++ b/ddio/lnxio.cpp @@ -62,7 +62,7 @@ #include #endif -#include "application.h" +#include "lnxapp.h" #include "ddio.h" #include "pserror.h" diff --git a/ddio/lnxkey.cpp b/ddio/lnxkey.cpp index c6abbe368..c71fb77d5 100644 --- a/ddio/lnxkey.cpp +++ b/ddio/lnxkey.cpp @@ -49,7 +49,7 @@ // ---------------------------------------------------------------------------- // Keyboard Interface // ---------------------------------------------------------------------------- -#include "application.h" +#include "lnxapp.h" #include "ddio.h" #include "mono.h" diff --git a/ddio/winforcefeedback.cpp b/ddio/winforcefeedback.cpp index 24f176890..e8fcf96c3 100644 --- a/ddio/winforcefeedback.cpp +++ b/ddio/winforcefeedback.cpp @@ -101,7 +101,7 @@ #include "mono.h" #include "ddio.h" #include "ddio_win.h" -#include "application.h" +#include "winapp.h" #include "forcefeedback.h" #include "mem.h" #include "dinput.h" diff --git a/ddio/winio.cpp b/ddio/winio.cpp index 14d025849..3968b61dc 100644 --- a/ddio/winio.cpp +++ b/ddio/winio.cpp @@ -107,12 +107,12 @@ #include #include +#include -#include #include #include "pserror.h" -#include "application.h" +#include "winapp.h" #include "ddio_win.h" #include "ddio.h" #include "dinput.h" @@ -202,4 +202,4 @@ bool ddio_GetBinaryPath(char *exec_path, size_t len) { } exec_path[len - 1] = '\0'; return true; -} \ No newline at end of file +} diff --git a/ddio/winkey.cpp b/ddio/winkey.cpp index edb063f5d..d87597c8b 100644 --- a/ddio/winkey.cpp +++ b/ddio/winkey.cpp @@ -180,8 +180,7 @@ #include "mono.h" #include "ddio.h" #include "ddio_win.h" -#include "application.h" -#include "TaskSystem.h" +#include "winapp.h" #include #include diff --git a/ddio/winmouse.cpp b/ddio/winmouse.cpp index f59ce69e4..030284410 100644 --- a/ddio/winmouse.cpp +++ b/ddio/winmouse.cpp @@ -20,16 +20,15 @@ // Mouse Interface // ---------------------------------------------------------------------------- -#include -#include +#include +#include #include "pserror.h" #include "mono.h" #include "ddio.h" #include "ddio_win.h" -#include "application.h" +#include "winapp.h" #include "psclass.h" -#include "Macros.h" struct t_mse_button_info { bool is_down[N_MSEBTNS]; diff --git a/grtext/grfont.cpp b/grtext/grfont.cpp index a4ed9d5c4..bcc975229 100644 --- a/grtext/grfont.cpp +++ b/grtext/grfont.cpp @@ -107,18 +107,20 @@ * $NoKeywords: $ */ +#include +#include +#include +#include + +#include "grtext.h" #include "grtextlib.h" #include "cfile.h" #include "bitmap.h" #include "pserror.h" #include "renderer.h" #include "mem.h" -#include "ddio.h" +#include "ddio_common.h" -#include -#include -#include -#include const int MAX_FONTS = 16, MAX_FONT_BITMAPS = 32; diff --git a/grtext/grtext.cpp b/grtext/grtext.cpp index bcc8de0d4..7e9478506 100644 --- a/grtext/grtext.cpp +++ b/grtext/grtext.cpp @@ -146,18 +146,18 @@ * $NoKeywords: $ */ +#include "grtext.h" + #include #include +#include +#include +#include #include "grtextlib.h" #include "renderer.h" #include "pserror.h" -#include "mem.h" - -#include -#include -#include #define CLIP_LEFT Grtext_left #define CLIP_TOP Grtext_top diff --git a/grtext/grtext.h b/grtext/grtext.h index 030300163..f04d9e43c 100644 --- a/grtext/grtext.h +++ b/grtext/grtext.h @@ -108,8 +108,7 @@ #ifndef GRTEXT_H #define GRTEXT_H -#include "pstypes.h" -#include "ddvid.h" +#include "grdefs.h" #define GRTEXT_BUFLEN 16384 #define GRTEXT_FORMAT_CHAR 0x2 diff --git a/grtext/grtextlib.h b/grtext/grtextlib.h index c3d3a7c52..387d72e02 100644 --- a/grtext/grtextlib.h +++ b/grtext/grtextlib.h @@ -38,8 +38,7 @@ #ifndef GRTEXTLIB_H #define GRTEXTLIB_H -#include "grtext.h" -#include "pstypes.h" +#include struct tCharBlt { uint16_t ch; diff --git a/lib/psclass.h b/lib/psclass.h index 10aa00732..5eda92935 100644 --- a/lib/psclass.h +++ b/lib/psclass.h @@ -54,6 +54,9 @@ #ifndef PSCLASS_H #define PSCLASS_H +#include +#include + // a universal list node to use with the list type template struct tListNode { T t; diff --git a/libacm/aencode.h b/libacm/aencode.h index 51f965dde..8d14df43c 100644 --- a/libacm/aencode.h +++ b/libacm/aencode.h @@ -21,7 +21,6 @@ #include #include -#include "pstypes.h" typedef int32_t ReadSampleFunction(void *data); diff --git a/libacm/libacm.h b/libacm/libacm.h index 84fa19711..791ee102e 100644 --- a/libacm/libacm.h +++ b/libacm/libacm.h @@ -19,6 +19,8 @@ #ifndef __LIBACM_H #define __LIBACM_H +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/linux/linux_fix.h b/linux/linux_fix.h index cb1f84a2e..48dcaee76 100644 --- a/linux/linux_fix.h +++ b/linux/linux_fix.h @@ -24,6 +24,7 @@ #define LOKI_VERSION "" #define HGLOBAL void * +#define SOCKET int void GlobalFree(void *); void *GlobalAlloc(int flags, int size); diff --git a/linux/lnxapp.cpp b/linux/lnxapp.cpp index 7c3f25eaa..26cd0bad1 100644 --- a/linux/lnxapp.cpp +++ b/linux/lnxapp.cpp @@ -68,15 +68,17 @@ * $NoKeywords: $ */ +#include #include #include #include #include #include -#include "application.h" #include "lnxapp.h" +#include "linux_fix.h" + #ifdef buttons // termios.h defines buttons, but SDL's headers use that symbol. #undef buttons #endif diff --git a/linux/lnxapp.h b/linux/lnxapp.h index 4fe2eb7e5..f942a9b61 100644 --- a/linux/lnxapp.h +++ b/linux/lnxapp.h @@ -19,7 +19,7 @@ #ifndef LNXAPP_H #define LNXAPP_H -#include "linux_fix.h" +#include "application.h" // if no-display/input specifier is given, it will use defaults #define APPFLAG_USESERVICE 0x00000100 // console (run no output/input) diff --git a/linux/lnxcon.cpp b/linux/lnxcon.cpp index d6d5c4c25..dff4093f5 100644 --- a/linux/lnxcon.cpp +++ b/linux/lnxcon.cpp @@ -62,11 +62,8 @@ #include #include -#include "application.h" +#include "lnxapp.h" #include "appconsole.h" -#include "TaskSystem.h" -#include "mono.h" -#include "pstring.h" #include #include "linux/dyna_curses.h" diff --git a/linux/lnxcon_null.cpp b/linux/lnxcon_null.cpp index 140c0096b..e2cd54d47 100644 --- a/linux/lnxcon_null.cpp +++ b/linux/lnxcon_null.cpp @@ -49,9 +49,6 @@ #include #include -#include "application.h" -#include "appconsole.h" -#include "TaskSystem.h" #include "mono.h" diff --git a/linux/lnxcon_raw.cpp b/linux/lnxcon_raw.cpp index 5ecd3478e..e55cddee7 100644 --- a/linux/lnxcon_raw.cpp +++ b/linux/lnxcon_raw.cpp @@ -39,21 +39,18 @@ * $NoKeywords: $ */ +#include + +#include #include #include #include #include #include -#include +#include -#include "application.h" #include "appconsole.h" -#include "TaskSystem.h" -#include "mono.h" -// #include "local_malloc.h" -#include "pstring.h" -#include static char *Con_raw_read_buf = NULL; // The next buffer of text from user input static char *Con_raw_inp_buf = NULL, Con_raw_inp_pos = 0; // Currently updating input buffer of text (and it's position) diff --git a/linux/lnxcontroller.cpp b/linux/lnxcontroller.cpp index d5aae0a13..13a7057c7 100644 --- a/linux/lnxcontroller.cpp +++ b/linux/lnxcontroller.cpp @@ -41,13 +41,15 @@ * $NoKeywords: $ */ +#include "lnxcontroller.h" + #include -#include "controller.h" + #include "ddio.h" #include "pserror.h" #include "joystick.h" #include "inffile.h" -#include "lnxcontroller.h" +#include "Macros.h" // Sorry! This is needed for the semi-hacky mouselook support #include "descent.h" @@ -409,7 +411,7 @@ ct_config_data lnxgameController::get_controller_value(ct_type type_req) { } for (i = 2; i < m_NumControls; i++) { float pos; - int ctl = CONTROLLER_CTL_INFO(i, -1); + int ctl = CONTROLLER_CTL_INFO(i, 0xFF); if (m_ControlList[i].flags & (CTF_POV << pov_n)) { pos = get_pov_value(i, ctDigital, pov_n, JOYPOV_RIGHT); diff --git a/linux/lnxdata.cpp b/linux/lnxdata.cpp index 9b3bc9aef..7d5f4ec6c 100644 --- a/linux/lnxdata.cpp +++ b/linux/lnxdata.cpp @@ -47,7 +47,6 @@ #include #include -#include "appdatabase.h" #include "lnxdatabase.h" #include "pserror.h" #include "mono.h" diff --git a/linux/lnxdatabase.h b/linux/lnxdatabase.h index 32f839ca2..2b8fe98ab 100644 --- a/linux/lnxdatabase.h +++ b/linux/lnxdatabase.h @@ -28,9 +28,9 @@ #include #include -class CRegistry; +#include "appdatabase.h" -#include "Macros.h" +class CRegistry; /* oeLnxAppDatabase to get info about the application from a managed database (or a custom info file) diff --git a/linux/registry.cpp b/linux/registry.cpp index 7068abe6d..1aeedcf62 100644 --- a/linux/registry.cpp +++ b/linux/registry.cpp @@ -47,10 +47,11 @@ * $NoKeywords: $ */ -#include -#include -#include -#include +#include +#include +#include +#include + // #include "local_malloc.h" #include "registry.h" #include "mono.h" diff --git a/linux/registry.h b/linux/registry.h index fd4ef9ada..c051be018 100644 --- a/linux/registry.h +++ b/linux/registry.h @@ -49,8 +49,6 @@ #define REGT_STRING 0 #define REGT_DWORD 1 -#include - struct tRecord { char name[MAX_RECORD_NAME]; char type; diff --git a/manage/manage.h b/manage/manage.h index dda17a87d..8fa76c7f4 100644 --- a/manage/manage.h +++ b/manage/manage.h @@ -22,7 +22,6 @@ #include #include "cfile.h" -#include "bitmap.h" #include "manage_external.h" #if defined(__LINUX__) @@ -39,7 +38,7 @@ // Tracklocks are for keeping track of what pages the local user is working on or has locked #define PAGELOCK_NAME_LEN 30 -#define TABLE_NAME_LEN PSPATHNAME_LEN +#define TABLE_NAME_LEN _MAX_PATH #define INFO_STRING_LEN 100 #define MAX_PAGELOCKS 1000 #define MAX_TRACKLOCKS 5000 diff --git a/model/newstyle.cpp b/model/newstyle.cpp index 89eded770..e059aec1e 100644 --- a/model/newstyle.cpp +++ b/model/newstyle.cpp @@ -77,15 +77,18 @@ * */ + +#include +#include + #include "pserror.h" -#include "pstypes.h" +#include "psrand.h" #include "3d.h" #include "vecmat.h" #include "grdefs.h" #include "polymodel.h" #include "gametexture.h" -#include "byteswap.h" #include "renderer.h" #include "lighting.h" #include "game.h" @@ -96,11 +99,6 @@ #include "lighting.h" #include "findintersection.h" -#include -#include - -#include "psrand.h" - static float face_depth[MAX_POLYGON_VECS]; static uint8_t triangulated_faces[MAX_FACES_PER_ROOM]; diff --git a/model/polymodel.cpp b/model/polymodel.cpp index 799eadab1..96f55094a 100644 --- a/model/polymodel.cpp +++ b/model/polymodel.cpp @@ -598,26 +598,23 @@ * $NoKeywords: $ */ +#include +#include +#include + #include "objinfo.h" #include "polymodel.h" #include "pserror.h" #include "3d.h" #include "mono.h" -#include "bitmap.h" #include "renderer.h" #include "manage.h" #include "gametexture.h" -#include "lighting.h" #include "ddio.h" #include "game.h" -#include -#include -#include "robotfire.h" #include "mem.h" #include "gamesequence.h" -#include - int Num_poly_models = 0; poly_model Poly_models[MAX_POLY_MODELS]; diff --git a/model/polymodel.h b/model/polymodel.h index 0203437cd..104917eba 100644 --- a/model/polymodel.h +++ b/model/polymodel.h @@ -294,11 +294,7 @@ #ifndef POLYMODEL_H #define POLYMODEL_H -#include "manage.h" -#include "pstypes.h" -#include "vecmat.h" #include "3d.h" -#include "robotfirestruct.h" #include "polymodel_external.h" #include "object_external_struct.h" diff --git a/model/polymodel_external.h b/model/polymodel_external.h index 0b8caea91..d66168aef 100644 --- a/model/polymodel_external.h +++ b/model/polymodel_external.h @@ -56,8 +56,8 @@ #ifndef __POLYMODEL_EXTERNAL_H_ #define __POLYMODEL_EXTERNAL_H_ +#include "robotfirestruct.h" #include "vecmat_external.h" -#include "pstypes.h" #include "grdefs.h" #include "manage_external.h" diff --git a/module/module.cpp b/module/module.cpp index 2deb46bdb..3b8f1835e 100644 --- a/module/module.cpp +++ b/module/module.cpp @@ -92,9 +92,12 @@ * $NoKeywords: $ */ #include "module.h" -#include "pstypes.h" + +#include +#include +#include + #include "pserror.h" -#include "ddio.h" #ifdef __LINUX__ #include @@ -102,12 +105,6 @@ static bool mod_FindRealFileNameCaseInsenstive(const char *directory, const char *filename, char *new_filename); #endif -#include "module.h" -#include "pstypes.h" -#include "pserror.h" -#include -#include -#include #if defined(__LINUX__) #include "linux_fix.h" #endif diff --git a/movie/movie.cpp b/movie/movie.cpp index 2524a9772..fc3c8cf92 100644 --- a/movie/movie.cpp +++ b/movie/movie.cpp @@ -32,6 +32,7 @@ #include #include #include "dsound.h" +#include "winapp.h" #endif #include diff --git a/movie/movie.h b/movie/movie.h index 53d666125..7ea79ff9b 100644 --- a/movie/movie.h +++ b/movie/movie.h @@ -19,9 +19,12 @@ #ifndef MOVIE_H__ #define MOVIE_H__ +#include + +#include "application.h" +#include "grdefs.h" #include "renderer.h" -#include #define MVELIB_NOERROR 0 #define MVELIB_FILE_ERROR -1 diff --git a/music/music.h b/music/music.h index cfc30fe0b..3086e92ae 100644 --- a/music/music.h +++ b/music/music.h @@ -99,8 +99,6 @@ #ifndef MUSIC_H #define MUSIC_H -#include "pstypes.h" -#include "pserror.h" #include "psclass.h" #include "streamaudio.h" diff --git a/music/musiclib.h b/music/musiclib.h index 705cf1dc7..9d5018bcc 100644 --- a/music/musiclib.h +++ b/music/musiclib.h @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +#ifndef MUSICLIB_H +#define MUSICLIB_H #define OMFCMD_NUM 22 @@ -44,4 +46,6 @@ // undocumented codes. #define OMFCMD_MPLAY 200 // internal code. -#define OMFCMD_ENDIFI 201 // end of ifi conditional. \ No newline at end of file +#define OMFCMD_ENDIFI 201 // end of ifi conditional. + +#endif diff --git a/music/omflex.cpp b/music/omflex.cpp index fe06a18ab..df54223c8 100644 --- a/music/omflex.cpp +++ b/music/omflex.cpp @@ -71,13 +71,16 @@ * $NoKeywords: $ */ +#include +#include + #include "music.h" #include "musiclib.h" #include "inffile.h" #include "mem.h" +#include "mono.h" +#include "pserror.h" -#include -#include // OMF INF FILE READ #define OMFFILEERR_ADDSECTION INFFILE_CUSTOM // error adding section to list. diff --git a/music/sequencer.cpp b/music/sequencer.cpp index 6f27b1526..3ac131a30 100644 --- a/music/sequencer.cpp +++ b/music/sequencer.cpp @@ -144,13 +144,7 @@ #include "music.h" #include "musiclib.h" -#include "ssl_lib.h" -#include "soundload.h" -#include "textaux.h" #include "pserror.h" -#include "ddio.h" -#include "Macros.h" -#include "inffile.h" #include "streamaudio.h" #include "mem.h" #include diff --git a/music/streamer.cpp b/music/streamer.cpp index 43acb96c1..8b9cd1442 100644 --- a/music/streamer.cpp +++ b/music/streamer.cpp @@ -62,6 +62,7 @@ #include "music.h" #include "streamaudio.h" +#include "pserror.h" oms_stream::oms_stream() {} diff --git a/netcon/inetfile/CFtp.h b/netcon/inetfile/CFtp.h index f29d6f9d6..9d95acaf1 100644 --- a/netcon/inetfile/CFtp.h +++ b/netcon/inetfile/CFtp.h @@ -58,6 +58,11 @@ #define _CFTP_HEADER_ #include +#include + +#ifdef __LINUX__ +#include "linux_fix.h" +#endif #define FTP_STATE_INTERNAL_ERROR 0 #define FTP_STATE_SOCKET_ERROR 1 diff --git a/netcon/inetfile/inetgetfile.h b/netcon/inetfile/inetgetfile.h index b466589fd..6e4a7b59f 100644 --- a/netcon/inetfile/inetgetfile.h +++ b/netcon/inetfile/inetgetfile.h @@ -97,8 +97,6 @@ #include #include -#include "linux_fix.h" - // Linux includes/defines #if !MACOSX #include diff --git a/networking/networking.h b/networking/networking.h index 1b33bf1c3..424b317f7 100644 --- a/networking/networking.h +++ b/networking/networking.h @@ -214,7 +214,6 @@ static inline void INADDR_GET_SUN_SUNB(struct in_addr *st, uint8_t *s_b1, uint8_ #include "linux_fix.h" -#define SOCKET int #define BOOL bool #define SOCKADDR_IN sockaddr_in #define SOCKADDR sockaddr diff --git a/renderer/HardwareOpenGL.cpp b/renderer/HardwareOpenGL.cpp index 633a7e2ad..c4c9e4a84 100644 --- a/renderer/HardwareOpenGL.cpp +++ b/renderer/HardwareOpenGL.cpp @@ -20,7 +20,9 @@ #if defined(WIN32) #include #elif defined(__LINUX__) -#include "lnxscreenmode.h" +#include "lnxapp.h" +#include +#include #else #endif @@ -39,7 +41,7 @@ #include #include #include "HardwareInternal.h" -#include "../Descent3/args.h" +#include "args.h" #include @@ -48,6 +50,7 @@ #if defined(WIN32) #include "win/arb_extensions.h" +#include "winapp.h" #endif #include diff --git a/renderer/dyna_gl.h b/renderer/dyna_gl.h index 429e763ea..ed1699e84 100644 --- a/renderer/dyna_gl.h +++ b/renderer/dyna_gl.h @@ -21,7 +21,8 @@ #if defined(WIN32) #include #else -#include "SDL_opengl.h" +#include +#include #endif #include "module.h" diff --git a/sndlib/CMakeLists.txt b/sndlib/CMakeLists.txt index bd2c92227..a0e61070c 100644 --- a/sndlib/CMakeLists.txt +++ b/sndlib/CMakeLists.txt @@ -1,17 +1,21 @@ set(HEADERS - auddev.h ddsndgeometry.h - ds3dlib.h - ds3dlib_internal.h - eax2.h - eax.h hlsoundlib.h - mixer.h - sdlsound.h sndrender.h soundload.h ssl_lib.h - vmanpset.h + $<$: + auddev.h + ds3dlib.h + ds3dlib_internal.h + eax2.h + eax.h + vmanpset.h + > + $<$: + mixer.h + sdlsound.h + > ) set(CPPS diff --git a/sndlib/ds3dlib.cpp b/sndlib/ds3dlib.cpp index 93e9ee5e4..3ce73fffc 100644 --- a/sndlib/ds3dlib.cpp +++ b/sndlib/ds3dlib.cpp @@ -213,14 +213,14 @@ #include "mono.h" #include "soundload.h" #include "mem.h" -#include "application.h" +#include "winapp.h" #include "auddev.h" #include "Macros.h" #include "ddio.h" // Hacked window handle -- chrishack -static oeWin32Application *SoundApp = NULL; -static void *GameWindowHandle; +static oeApplication* SoundApp = nullptr; +static void* GameWindowHandle = nullptr; #define MIN_SOUND_MIX_VOLUME 0.0 #define MAX_WRITE_AHEAD .04 // Seconds to write ahead of the play position (in seconds) @@ -385,7 +385,7 @@ inline void opti_16s_mix(int16_t *cur_sample_16bit, const int num_write, int &sa *mb = l_sample; mb++; *mb = r_sample; - *mb++; + mb++; } samples_played += (i / 2); } @@ -1395,10 +1395,12 @@ int win_llsSystem::InitSoundLib(char mixer_type, oeApplication *sos, uint8_t Max // reset error system. SetError(SSL_OK); - SoundApp = (oeWin32Application *)sos; + SoundApp = sos; + + if (sos != nullptr) { + oeWin32Application *obj = dynamic_cast(sos); + ASSERT(obj != nullptr); - if (sos) { - oeWin32Application *obj = (oeWin32Application *)sos; // If the the library if already init'ed, then return o.k. if (m_f_sound_lib_init) @@ -1406,7 +1408,7 @@ int win_llsSystem::InitSoundLib(char mixer_type, oeApplication *sos, uint8_t Max GameWindowHandle = (void *)obj->m_hWnd; } else { - ASSERT(GameWindowHandle); + ASSERT(GameWindowHandle != nullptr); } ll_sound_ptr = this; diff --git a/stream_audio/streamaudio.cpp b/stream_audio/streamaudio.cpp index 66e7734cf..c48b2f868 100644 --- a/stream_audio/streamaudio.cpp +++ b/stream_audio/streamaudio.cpp @@ -165,13 +165,15 @@ * $NoKeywords: $ */ #include "streamaudio.h" + +#include +#include + #include "pserror.h" -#include "cfile.h" #include "mem.h" #include "Macros.h" #include "ddio.h" -#include -#include + // #include "samirlog.h" #define LOGFILE(_s) // this stream is for everyone (used by the StreamPlay interface) diff --git a/stream_audio/streamaudio.h b/stream_audio/streamaudio.h index 077ba0aaa..9fc9fe4eb 100644 --- a/stream_audio/streamaudio.h +++ b/stream_audio/streamaudio.h @@ -141,7 +141,6 @@ #include "adecode.h" #include "ssl_lib.h" -#include "TaskSystem.h" void *AudioStreamCB(void *user_data, int handle, int *size); int ADecodeFileRead(void *data, void *buf, uint32_t qty); diff --git a/ui/UIEdit.cpp b/ui/UIEdit.cpp index 910818b38..71030120b 100644 --- a/ui/UIEdit.cpp +++ b/ui/UIEdit.cpp @@ -136,7 +136,8 @@ #include #include -#include "UIlib.h" +#include "ui.h" +#include "ddio_common.h" #include "grtext.h" #include "Macros.h" #include "mem.h" diff --git a/ui/UISystem.cpp b/ui/UISystem.cpp index ae518f96f..cfa6825f7 100644 --- a/ui/UISystem.cpp +++ b/ui/UISystem.cpp @@ -168,10 +168,9 @@ #include "UIlib.h" #include "application.h" #include "bitmap.h" -#include "ddvid.h" #include "renderer.h" -#include "psclass.h" #include "Macros.h" + #define UI_MOUSE_HOTX 2 #define UI_MOUSE_HOTY 2 #define UI_FRAMETIME 0.05 diff --git a/win32/CMakeLists.txt b/win32/CMakeLists.txt index 3c11f1e50..ca2d9164b 100644 --- a/win32/CMakeLists.txt +++ b/win32/CMakeLists.txt @@ -1,6 +1,6 @@ set(HEADERS - win32app.h - win32database.h + winapp.h + windatabase.h wincontroller.h ) diff --git a/win32/winapp.cpp b/win32/winapp.cpp index 5dac33ba8..53599e557 100644 --- a/win32/winapp.cpp +++ b/win32/winapp.cpp @@ -146,16 +146,19 @@ */ #define OEAPP_INTERNAL_MODULE +#include "winapp.h" + +#include +#include + +#include +#include +#include -#include "application.h" #include "appconsole.h" #include "mono.h" #include "networking.h" -#include -#include -#include -#include // taken from winuser.h #ifndef WHEEL_DELTA diff --git a/win32/win32app.h b/win32/winapp.h similarity index 99% rename from win32/win32app.h rename to win32/winapp.h index 71c189478..be12597cd 100644 --- a/win32/win32app.h +++ b/win32/winapp.h @@ -83,6 +83,8 @@ #include #include +#include "application.h" + /* Basic Application Win32 data types, to prevent include of windows.h */ typedef uintptr_t HWnd; typedef uintptr_t HInstance; diff --git a/win32/wincon.cpp b/win32/wincon.cpp index c16fb3b92..60da0bee0 100644 --- a/win32/wincon.cpp +++ b/win32/wincon.cpp @@ -64,18 +64,17 @@ * $NoKeywords: $ */ +#include "appconsole.h" + +#include #include #include - -#include "application.h" -#include "appconsole.h" -#include "TaskSystem.h" +#include #include -#include #include -#include +#include "winapp.h" #define CON_SCROLL_ROWS 25 #define CON_SCROLL_COLS 80 diff --git a/win32/wincontroller.cpp b/win32/wincontroller.cpp index dca2908ee..43830f953 100644 --- a/win32/wincontroller.cpp +++ b/win32/wincontroller.cpp @@ -309,9 +309,9 @@ * $NoKeywords: $ */ -#include "controller.h" +#include "wincontroller.h" -#include +#include #include "pserror.h" #include "ddio.h" diff --git a/win32/windata.cpp b/win32/windata.cpp index 43761e0e3..0c71bdfdb 100644 --- a/win32/windata.cpp +++ b/win32/windata.cpp @@ -68,7 +68,7 @@ * $NoKeywords: $ */ -#include "AppDatabase.h" +#include "windatabase.h" #include #include diff --git a/win32/win32database.h b/win32/windatabase.h similarity index 99% rename from win32/win32database.h rename to win32/windatabase.h index b77fd7afa..b449bff8b 100644 --- a/win32/win32database.h +++ b/win32/windatabase.h @@ -51,6 +51,8 @@ #ifndef WIN32DATABASE #define WIN32DATABASE +#include "appdatabase.h" + /* oeWin32AppDatabase to get info about the application from a managed database (or a custom info file) we get our information from the registry!