- made video base code game independent

This commit is contained in:
Christoph Oelckers 2020-04-28 17:22:17 +02:00
parent 2196b4fb04
commit ddef3f7b98
56 changed files with 251 additions and 241 deletions

View file

@ -39,7 +39,8 @@
#include "v_draw.h"
#include "fcolormap.h"
F2DDrawer* twod;
static F2DDrawer drawer;
F2DDrawer* twod = &drawer;
EXTERN_CVAR(Float, transsouls)

View file

@ -198,7 +198,7 @@ public:
int GetWidth() const { return Width; }
int GetHeight() const { return Height; }
void SetSize(int w, int h) { Width = w; Height = h; }
void Begin() { isIn2D = true; }
void Begin(int w, int h) { isIn2D = true; Width = w; Height = h; }
void End() { isIn2D = false; }
bool HasBegun2D() { return isIn2D; }

View file

@ -1222,7 +1222,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Screen, DrawThickLine, DrawThickLine)
//==========================================================================
//
// DCanvas :: Clear
// ClearRect
//
// Set an area to a specified color.
//
@ -1281,7 +1281,7 @@ DEFINE_ACTION_FUNCTION(_Screen, Clear)
//==========================================================================
//
// DCanvas :: Dim
// DoDim
//
// Applies a colored overlay to an area of the screen.
//

View file

@ -219,7 +219,6 @@ void DoDim(F2DDrawer* drawer, PalEntry color, float amount, int x1, int y1, int
void Dim(F2DDrawer* drawer, PalEntry color, float damount, int x1, int y1, int w, int h, FRenderStyle* style = nullptr);
void FillBorder(F2DDrawer *drawer, FGameTexture* img); // Fills the border around a 4:3 part of the screen on non-4:3 displays
void DrawFrame(F2DDrawer* drawer, int left, int top, int width, int height);
void DrawBorder(F2DDrawer* drawer, FTextureID, int x1, int y1, int x2, int y2);
void DrawFrame(F2DDrawer* twod, PalEntry color, int left, int top, int width, int height, int thickness);

View file

@ -1,6 +1,7 @@
#pragma once
#include "zstring.h"
#include "intrect.h"
struct SystemCallbacks
{
@ -13,6 +14,8 @@ struct SystemCallbacks
void (*PlayStartupSound)(const char* name);
bool (*IsSpecialUI)();
bool (*DisableTextureFilter)();
void (*OnScreenSizeChanged)();
IntRect(*GetSceneRect)();
};
extern SystemCallbacks *sysCallbacks;

View file

@ -38,7 +38,6 @@
#include "palentry.h"
#include "name.h"
class DCanvas;
class FGameTexture;
struct FRemapTable;

View file

@ -31,13 +31,13 @@
#include "sc_man.h"
#include "m_crc32.h"
#include "printf.h"
#include "models.h"
#include "model_ue1.h"
#include "model_obj.h"
#include "model_md2.h"
#include "model_md3.h"
#include "model_kvx.h"
#include "i_time.h"
#include "voxels.h"
#include "texturemanager.h"
#include "modelrenderer.h"

View file

@ -2,6 +2,7 @@
#include <stdint.h>
#include "textureid.h"
#include "i_modelvertexbuffer.h"
class FModelRenderer;
class FGameTexture;

View file

@ -1,5 +1,7 @@
#include "models.h"
#include "renderstyle.h"
#include "matrix.h"
#include "model.h"
class FModelRenderer
{

View file

@ -30,6 +30,7 @@
#include "model_md2.h"
#include "texturemanager.h"
#include "modelrenderer.h"
#include "printf.h"
#ifdef _MSC_VER
#pragma warning(disable:4244) // warning C4244: conversion from 'double' to 'float', possible loss of data

View file

@ -23,6 +23,8 @@
#include "model_obj.h"
#include "texturemanager.h"
#include "modelrenderer.h"
#include "printf.h"
#include "textureid.h"
/**
* Load an OBJ model

View file

@ -33,6 +33,10 @@
#include "image.h"
#include "texturemanager.h"
#include "modelrenderer.h"
#include "voxels.h"
#include "texturemanager.h"
#include "palettecontainer.h"
#include "textures.h"
#ifdef _MSC_VER
#pragma warning(disable:4244) // warning C4244: conversion from 'double' to 'float', possible loss of data

View file

@ -43,7 +43,6 @@
#include "v_video.h"
#include "sc_man.h"
#include "voxels.h"
#include "info.h"
#include "printf.h"
void VOX_AddVoxel(int sprnum, int frame, FVoxelDef *def);

View file

@ -1,8 +1,7 @@
#ifndef __RES_VOXEL_H
#define __RES_VOXEL_H
#include "doomdef.h"
#include <stdint.h>
// [RH] Voxels from Build
#define MAXVOXMIPS 5

View file

@ -35,6 +35,7 @@
#include "v_video.h"
#include "templates.h"
#include "hw_vrmodes.h"
#include "v_draw.h"
extern bool vid_hdr_active;
@ -123,7 +124,7 @@ void FGLRenderer::Flush()
if (eyeCount - eye_ix > 1)
mBuffers->NextEye(eyeCount);
}
screen->Clear2D();
twod->Clear();
FGLPostProcessState savedState;
FGLDebug::PushGroup("PresentEyes");
@ -143,7 +144,7 @@ void FGLRenderer::Flush()
void FGLRenderer::CopyToBackbuffer(const IntRect *bounds, bool applyGamma)
{
screen->Draw2D(); // draw all pending 2D stuff before copying the buffer
screen->Clear2D();
twod->Clear();
GLPPRenderState renderstate(mBuffers);
hw_postprocess.customShaders.Run(&renderstate, "screen");

View file

@ -26,13 +26,10 @@
*/
#include "templates.h"
#include "doomstat.h"
#include "r_data/colormaps.h"
#include "gl_system.h"
#include "gl_interface.h"
#include "hw_cvars.h"
#include "flatvertices.h"
#include "hwrenderer/scene/hw_skydome.h"
#include "gl_shader.h"
#include "gl/renderer/gl_renderer.h"
#include "hw_lightbuffer.h"

View file

@ -40,12 +40,11 @@
#include "v_draw.h"
#include "i_interface.h"
#include "printf.h"
#include "version.h"
#define NUMSCALEMODES countof(vScaleTable)
extern bool setsizeneeded;
EXTERN_CVAR(Int, vid_aspect)
CUSTOM_CVAR(Int, vid_scale_customwidth, VID_MIN_WIDTH, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
if (self < VID_MIN_WIDTH)

View file

@ -50,6 +50,12 @@ private:
int texnum;
};
class FNullTextureID : public FTextureID
{
public:
FNullTextureID() : FTextureID(0) {}
};
// This is for the script interface which needs to do casts from int to texture.
class FSetTextureID : public FTextureID
{

View file

@ -124,12 +124,6 @@ class FMultipatchTextureBuilder;
extern int r_spriteadjustSW, r_spriteadjustHW;
class FNullTextureID : public FTextureID
{
public:
FNullTextureID() : FTextureID(0) {}
};
enum FTextureFormat : uint32_t
{
TEX_Pal,