Compilation changes

Few compile time attempts to speed things up

Swap include guards for pramga once
Change compile options in the cmakeLists for source
generate a pch

small tweaks
This commit is contained in:
marauder2k7 2026-05-21 23:55:35 +01:00
parent 0df3bea9ca
commit 68e762130d
1016 changed files with 2848 additions and 5532 deletions

View file

@ -19,6 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#pragma once
#ifndef _PLATFORMWIN32_H_
#define _PLATFORMWIN32_H_
@ -31,12 +32,9 @@
#endif
#include <windows.h>
#ifndef _PLATFORM_H_
#include "platform/platform.h"
#endif
#ifndef _MRECT_H_
#include "math/mRect.h"
#endif
#if defined(TORQUE_COMPILER_CODEWARRIOR)
# include <ansi_prefix.win32.h>
@ -51,8 +49,6 @@
#pragma warning(disable: 4996) // turn off "deprecation" warnings
#endif
#define NOMINMAX
// Hack to get a correct HWND instead of using global state.
extern HWND getWin32WindowHandle();

View file

@ -19,6 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#pragma once
#ifndef _WMI_CARDINFO_H_
#define _WMI_CARDINFO_H_

View file

@ -19,14 +19,14 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#pragma once
#pragma once
#ifndef _WINCONSOLE_H_
#define _WINCONSOLE_H_
#define MAX_CMDS 10
#ifndef _CONSOLE_H_
#include "console/console.h"
#endif
class WinConsole
{

View file

@ -1089,8 +1089,8 @@ void DInputDevice::rumble(F32 x, F32 y)
}
// Clamp the input floats to [0 - 1]
x = max(0, min(1, x));
y = max(0, min(1, y));
x = getMax(0.0f, getMin(1.0f, x));
y = getMax(0.0f, getMin(1.0f, y));
if ( 1 == mNumForceFeedbackAxes )
{

View file

@ -19,16 +19,14 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#pragma once
#pragma once
#ifndef _WINDINPUTDEVICE_H_
#define _WINDINPUTDEVICE_H_
#ifndef _PLATFORMWIN32_H_
#include "platformWin32/platformWin32.h"
#endif
#ifndef _PLATFORMINPUT_H_
#include "platform/platformInput.h"
#endif
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>

View file

@ -19,19 +19,16 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#pragma once
#pragma once
#ifndef _WINDIRECTINPUT_H_
#define _WINDIRECTINPUT_H_
#ifndef _PLATFORMWIN32_H_
#include "platformWin32/platformWin32.h"
#endif
#ifndef _PLATFORMINPUT_H_
#include "platform/platformInput.h"
#endif
#ifndef _WINDINPUTDEVICE_H_
#include "platformWin32/winDInputDevice.h"
#endif
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>

View file

@ -20,8 +20,6 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "platform/types.h"

View file

@ -30,6 +30,8 @@
#include "core/util/safeDelete.h"
#include "util/tempAlloc.h"
#include <shellapi.h>
//-----------------------------------------------------------------------------
// Thread for executing in
//-----------------------------------------------------------------------------

View file

@ -19,10 +19,10 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#ifndef _PLATFORMFONT_H_
#include "platform/platformFont.h"
#endif
#pragma once
#pragma once
#ifndef _WINFONT_H_
#define _WINFONT_H_

View file

@ -21,7 +21,6 @@
//-----------------------------------------------------------------------------
// Grab the win32 headers so we can access QPC
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include "platform/platformTimer.h"

View file

@ -19,13 +19,12 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#pragma once
#pragma once
#ifndef _WINVOLUME_H_
#define _WINVOLUME_H_
#ifndef _VOLUME_H_
#include "core/volume.h"
#endif
namespace Torque
{