mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 23:12:24 +00:00
- remove some dead code.
This commit is contained in:
parent
a001a5304d
commit
6cd26dec01
14 changed files with 10 additions and 140 deletions
|
@ -2,7 +2,7 @@
|
|||
#define __GL_FRAMEBUFFER
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "win32iface.h"
|
||||
#include "hardware.h"
|
||||
#include "win32gliface.h"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -465,37 +465,3 @@ int SDLGLFB::GetClientHeight()
|
|||
return height;
|
||||
}
|
||||
|
||||
void SDLGLFB::ScaleCoordsFromWindow(int16_t &x, int16_t &y)
|
||||
{
|
||||
int w, h;
|
||||
SDL_GetWindowSize (Screen, &w, &h);
|
||||
|
||||
// Detect if we're doing scaling in the Window and adjust the mouse
|
||||
// coordinates accordingly. This could be more efficent, but I
|
||||
// don't think performance is an issue in the menus.
|
||||
if(IsFullscreen())
|
||||
{
|
||||
int realw = w, realh = h;
|
||||
ScaleWithAspect (realw, realh, SCREENWIDTH, SCREENHEIGHT);
|
||||
if (realw != SCREENWIDTH || realh != SCREENHEIGHT)
|
||||
{
|
||||
double xratio = (double)SCREENWIDTH/realw;
|
||||
double yratio = (double)SCREENHEIGHT/realh;
|
||||
if (realw < w)
|
||||
{
|
||||
x = (x - (w - realw)/2)*xratio;
|
||||
y *= yratio;
|
||||
}
|
||||
else
|
||||
{
|
||||
y = (y - (h - realh)/2)*yratio;
|
||||
x *= xratio;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x = (int16_t)(x*Width/w);
|
||||
y = (int16_t)(y*Height/h);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,8 +70,6 @@ public:
|
|||
int GetClientWidth();
|
||||
int GetClientHeight();
|
||||
|
||||
virtual void ScaleCoordsFromWindow(int16_t &x, int16_t &y);
|
||||
|
||||
SDL_Window *GetSDLWindow() override { return Screen; }
|
||||
|
||||
virtual int GetTrueHeight() { return GetClientHeight(); }
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include <windows.h>
|
||||
|
||||
#include "hardware.h"
|
||||
#include "win32iface.h"
|
||||
#include "i_video.h"
|
||||
#include "i_system.h"
|
||||
#include "c_console.h"
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include "c_dispatch.h"
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "win32iface.h"
|
||||
#include "hardware.h"
|
||||
#include "templates.h"
|
||||
#include "gameconfigfile.h"
|
||||
#include "cmdlib.h"
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
#include "s_sound.h"
|
||||
#include "m_misc.h"
|
||||
#include "gameconfigfile.h"
|
||||
#include "win32iface.h"
|
||||
#include "hardware.h"
|
||||
#include "templates.h"
|
||||
#include "cmdlib.h"
|
||||
#include "d_event.h"
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include "c_cvars.h"
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "win32iface.h"
|
||||
#include "hardware.h"
|
||||
#include "rawinput.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include "c_cvars.h"
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "win32iface.h"
|
||||
#include "hardware.h"
|
||||
#include "rawinput.h"
|
||||
#include "menu/menu.h"
|
||||
#include "events.h"
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include "c_dispatch.h"
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "win32iface.h"
|
||||
#include "hardware.h"
|
||||
#include "templates.h"
|
||||
#include "gameconfigfile.h"
|
||||
#include "cmdlib.h"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#include "c_dispatch.h"
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "win32iface.h"
|
||||
#include "hardware.h"
|
||||
#include "templates.h"
|
||||
#include "gameconfigfile.h"
|
||||
#include "cmdlib.h"
|
||||
|
|
|
@ -39,14 +39,11 @@
|
|||
#include <GL/gl.h>
|
||||
#include "wglext.h"
|
||||
|
||||
#include "win32iface.h"
|
||||
#include "win32gliface.h"
|
||||
//#include "gl/gl_intern.h"
|
||||
#include "x86.h"
|
||||
#include "templates.h"
|
||||
#include "version.h"
|
||||
#include "c_console.h"
|
||||
#include "hardware.h"
|
||||
#include "v_video.h"
|
||||
#include "i_input.h"
|
||||
#include "i_system.h"
|
||||
|
@ -981,7 +978,7 @@ bool Win32GLVideo::SetFullscreen(const char *devicename, int w, int h, int bits,
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
Win32GLFrameBuffer::Win32GLFrameBuffer(void *hMonitor, int width, int height, int bits, int refreshHz, bool fullscreen, bool bgra) : BaseWinFB(width, height, bgra)
|
||||
Win32GLFrameBuffer::Win32GLFrameBuffer(void *hMonitor, int width, int height, int bits, int refreshHz, bool fullscreen, bool bgra) : DFrameBuffer(width, height, bgra)
|
||||
{
|
||||
m_Width = width;
|
||||
m_Height = height;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define __WIN32GLIFACE_H__
|
||||
|
||||
#include "hardware.h"
|
||||
#include "win32iface.h"
|
||||
#include "v_video.h"
|
||||
#include "tarray.h"
|
||||
|
||||
|
@ -25,9 +24,9 @@ FRenderer *gl_CreateInterface();
|
|||
|
||||
|
||||
|
||||
class Win32GLFrameBuffer : public BaseWinFB
|
||||
class Win32GLFrameBuffer : public DFrameBuffer
|
||||
{
|
||||
typedef BaseWinFB Super;
|
||||
typedef DFrameBuffer Super;
|
||||
|
||||
public:
|
||||
Win32GLFrameBuffer() {}
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
** win32iface.h
|
||||
**
|
||||
**---------------------------------------------------------------------------
|
||||
** Copyright 1998-2008 Randy Heit
|
||||
** 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 __WIN32IFACE_H
|
||||
#define __WIN32IFACE_H
|
||||
|
||||
#include "hardware.h"
|
||||
|
||||
|
||||
EXTERN_CVAR (Bool, vid_vsync)
|
||||
|
||||
struct FSoftwareRenderer;
|
||||
|
||||
|
||||
class BaseWinFB : public DFrameBuffer
|
||||
{
|
||||
typedef DFrameBuffer Super;
|
||||
public:
|
||||
BaseWinFB(int width, int height, bool bgra) : DFrameBuffer(width, height, bgra), Windowed(true) {}
|
||||
|
||||
bool IsFullscreen () { return !Windowed; }
|
||||
virtual void ScaleCoordsFromWindow(int16_t &x, int16_t &y);
|
||||
|
||||
protected:
|
||||
virtual int GetTrueHeight() { return GetHeight(); }
|
||||
|
||||
bool Windowed;
|
||||
|
||||
friend class Win32Video;
|
||||
|
||||
BaseWinFB() {}
|
||||
};
|
||||
|
||||
|
||||
#endif // __WIN32IFACE_H
|
|
@ -70,7 +70,6 @@
|
|||
#include "v_text.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "win32iface.h"
|
||||
|
||||
#include "optwin32.h"
|
||||
|
||||
|
@ -179,26 +178,3 @@ void I_FPSLimit()
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// BaseWinFB :: ScaleCoordsFromWindow
|
||||
//
|
||||
// Given coordinates in window space, return coordinates in what the game
|
||||
// thinks screen space is.
|
||||
//
|
||||
//==========================================================================
|
||||
extern HWND Window;
|
||||
|
||||
void BaseWinFB::ScaleCoordsFromWindow(int16_t &x, int16_t &y)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
int TrueHeight = GetTrueHeight();
|
||||
if (GetClientRect(Window, &rect))
|
||||
{
|
||||
x = int16_t(x * Width / (rect.right - rect.left));
|
||||
y = int16_t(y * TrueHeight / (rect.bottom - rect.top));
|
||||
}
|
||||
// Subtract letterboxing borders
|
||||
y -= (TrueHeight - Height) / 2;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue