Rearranged header files and #include's

Removed unused OS version check
Reduced number of headers
Fixed build with SDK 10.4
This commit is contained in:
alexey.lysiuk 2015-01-05 17:24:54 +02:00
parent d418648e59
commit cb681aad2d
6 changed files with 25 additions and 144 deletions

View file

@ -31,10 +31,23 @@
** **
*/ */
#import <AppKit/NSApplication.h> #import <AppKit/AppKit.h>
#import <AppKit/NSScreen.h>
#import <AppKit/NSView.h>
#import <AppKit/NSWindow.h> struct RenderBufferOptions
{
float pixelScale;
float shiftX;
float shiftY;
float width;
float height;
bool dirty;
};
extern RenderBufferOptions rbOpts;
inline bool I_IsHiDPISupported() inline bool I_IsHiDPISupported()

View file

@ -2,7 +2,7 @@
** i_input.mm ** i_input.mm
** **
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** Copyright 2012-2014 Alexey Lysiuk ** Copyright 2012-2015 Alexey Lysiuk
** All rights reserved. ** All rights reserved.
** **
** Redistribution and use in source and binary forms, with or without ** Redistribution and use in source and binary forms, with or without
@ -31,8 +31,8 @@
** **
*/ */
#import <AppKit/NSCursor.h> #include "i_common.h"
#import <AppKit/NSEvent.h>
#import <Carbon/Carbon.h> #import <Carbon/Carbon.h>
// Avoid collision between DObject class and Objective-C // Avoid collision between DObject class and Objective-C
@ -48,9 +48,6 @@
#include "doomstat.h" #include "doomstat.h"
#include "v_video.h" #include "v_video.h"
#include "i_common.h"
#include "i_rbopts.h"
#undef Class #undef Class

View file

@ -31,10 +31,9 @@
** **
*/ */
#include <sys/sysctl.h> #include "i_common.h"
#import <AppKit/NSMenu.h> #include <sys/sysctl.h>
#import <AppKit/NSEvent.h>
// Avoid collision between DObject class and Objective-C // Avoid collision between DObject class and Objective-C
#define Class ObjectClass #define Class ObjectClass
@ -49,9 +48,6 @@
#include "s_sound.h" #include "s_sound.h"
#include "version.h" #include "version.h"
#include "i_common.h"
#include "i_osversion.h"
#undef Class #undef Class
@ -492,27 +488,6 @@ void CreateMenu()
[NSApp setMainMenu:menuBar]; [NSApp setMainMenu:menuBar];
} }
DarwinVersion GetDarwinVersion()
{
DarwinVersion result = {};
int mib[2] = { CTL_KERN, KERN_OSRELEASE };
size_t size = 0;
if (0 == sysctl(mib, 2, NULL, &size, NULL, 0))
{
char* version = static_cast<char*>(alloca(size));
if (0 == sysctl(mib, 2, version, &size, NULL, 0))
{
sscanf(version, "%hu.%hu.%hu",
&result.major, &result.minor, &result.bugfix);
}
}
return result;
}
void ReleaseApplicationController() void ReleaseApplicationController()
{ {
if (NULL != appCtrl) if (NULL != appCtrl)
@ -528,9 +503,6 @@ void ReleaseApplicationController()
} // unnamed namespace } // unnamed namespace
const DarwinVersion darwinVersion = GetDarwinVersion();
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
for (int i = 0; i <= argc; ++i) for (int i = 0; i <= argc; ++i)

View file

@ -1,43 +0,0 @@
/*
** i_osversion.h
**
**---------------------------------------------------------------------------
** Copyright 2012-2014 Alexey Lysiuk
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/
#include <stdint.h>
struct DarwinVersion
{
uint16_t major;
uint16_t minor;
uint16_t bugfix;
};
extern const DarwinVersion darwinVersion;

View file

@ -1,52 +0,0 @@
/*
** i_rbopts.h
**
**---------------------------------------------------------------------------
** Copyright 2014 Alexey Lysiuk
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/
#ifndef SRC_COCOA_I_RBOPTS_H_INCLUDED
#define SRC_COCOA_I_RBOPTS_H_INCLUDED
struct RenderBufferOptions
{
float pixelScale;
float shiftX;
float shiftY;
float width;
float height;
bool dirty;
};
extern RenderBufferOptions rbOpts;
#endif // SRC_COCOA_I_RBOPTS_H_INCLUDED

View file

@ -2,7 +2,7 @@
** i_video.mm ** i_video.mm
** **
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** Copyright 2012-2014 Alexey Lysiuk ** Copyright 2012-2015 Alexey Lysiuk
** All rights reserved. ** All rights reserved.
** **
** Redistribution and use in source and binary forms, with or without ** Redistribution and use in source and binary forms, with or without
@ -31,11 +31,8 @@
** **
*/ */
#import <AppKit/NSButton.h> #include "i_common.h"
#import <AppKit/NSCursor.h>
#import <AppKit/NSImage.h>
#import <AppKit/NSOpenGL.h>
#import <AppKit/NSOpenGLView.h>
#import <Carbon/Carbon.h> #import <Carbon/Carbon.h>
#import <OpenGL/gl.h> #import <OpenGL/gl.h>
@ -58,9 +55,6 @@
#include "v_video.h" #include "v_video.h"
#include "version.h" #include "version.h"
#include "i_common.h"
#include "i_rbopts.h"
#undef Class #undef Class