mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
- console output is functional.
This commit is contained in:
parent
81e9c867da
commit
b6a3a60251
36 changed files with 116 additions and 85 deletions
|
@ -22,7 +22,7 @@ extern "C"
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
int32_t g_borderless=2;
|
int32_t g_borderless=2;
|
||||||
bool GUICapture = false;
|
int GUICapture = false;
|
||||||
|
|
||||||
// input
|
// input
|
||||||
char inputdevices = 0;
|
char inputdevices = 0;
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include "scriptfile.h"
|
#include "scriptfile.h"
|
||||||
#include "softsurface.h"
|
#include "softsurface.h"
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
|
#include "c_console.h"
|
||||||
|
#include "v_2ddrawer.h"
|
||||||
|
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
# include "glsurface.h"
|
# include "glsurface.h"
|
||||||
|
@ -10422,6 +10424,7 @@ void videoNextPage(void)
|
||||||
|
|
||||||
if (in3dmode())
|
if (in3dmode())
|
||||||
{
|
{
|
||||||
|
// software rendering only
|
||||||
videoBeginDrawing(); //{{{
|
videoBeginDrawing(); //{{{
|
||||||
for (bssize_t i=permtail; i!=permhead; i=((i+1)&(MAXPERMS-1)))
|
for (bssize_t i=permtail; i!=permhead; i=((i+1)&(MAXPERMS-1)))
|
||||||
{
|
{
|
||||||
|
@ -10433,9 +10436,12 @@ void videoNextPage(void)
|
||||||
}
|
}
|
||||||
videoEndDrawing(); //}}}
|
videoEndDrawing(); //}}}
|
||||||
|
|
||||||
//OSD_Draw();
|
C_DrawConsole();
|
||||||
|
GLInterface.Draw2D(&twod);
|
||||||
|
|
||||||
videoShowFrame(0);
|
videoShowFrame(0);
|
||||||
|
|
||||||
|
// software rendering only
|
||||||
videoBeginDrawing(); //{{{
|
videoBeginDrawing(); //{{{
|
||||||
for (bssize_t i=permtail; i!=permhead; i=((i+1)&(MAXPERMS-1)))
|
for (bssize_t i=permtail; i!=permhead; i=((i+1)&(MAXPERMS-1)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,6 +35,8 @@ int timerInit(int const tickspersecond)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TArray<void(*)(void)> callbacks;
|
||||||
|
|
||||||
ATTRIBUTE((flatten)) void timerUpdateClock(void)
|
ATTRIBUTE((flatten)) void timerUpdateClock(void)
|
||||||
{
|
{
|
||||||
auto time = steady_clock::now();
|
auto time = steady_clock::now();
|
||||||
|
@ -50,16 +52,14 @@ ATTRIBUTE((flatten)) void timerUpdateClock(void)
|
||||||
totalclock += n;
|
totalclock += n;
|
||||||
timerlastsample += n*nanoseconds(1000000000/timerticspersec);
|
timerlastsample += n*nanoseconds(1000000000/timerticspersec);
|
||||||
|
|
||||||
if (usertimercallback)
|
for (; n > 0; n--)
|
||||||
for (; n > 0; n--) usertimercallback();
|
{
|
||||||
|
for (auto cb : callbacks) cb();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void(*timerSetCallback(void(*callback)(void)))(void)
|
void(*timerSetCallback(void(*callback)(void)))(void)
|
||||||
{
|
{
|
||||||
void(*oldtimercallback)(void);
|
callbacks.Push(callback);
|
||||||
|
return nullptr;
|
||||||
oldtimercallback = usertimercallback;
|
|
||||||
usertimercallback = callback;
|
|
||||||
|
|
||||||
return oldtimercallback;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,8 @@ void DrawChar (F2DDrawer* drawer, FFont *font, int normalcolor, double x, double
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PalEntry color = 0xffffffff;
|
PalEntry color ;
|
||||||
|
parms.remap = font->GetColorTranslation((EColorRange)normalcolor, &color);
|
||||||
parms.color = PalEntry((color.a * parms.color.a) / 255, (color.r * parms.color.r) / 255, (color.g * parms.color.g) / 255, (color.b * parms.color.b) / 255);
|
parms.color = PalEntry((color.a * parms.color.a) / 255, (color.r * parms.color.r) / 255, (color.g * parms.color.g) / 255, (color.b * parms.color.b) / 255);
|
||||||
drawer->AddTexture(pic, parms);
|
drawer->AddTexture(pic, parms);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +127,6 @@ void DrawTextCommon(F2DDrawer* drawer, FFont *font, int normalcolor, double x, d
|
||||||
double cx;
|
double cx;
|
||||||
double cy;
|
double cy;
|
||||||
int boldcolor;
|
int boldcolor;
|
||||||
int range;
|
|
||||||
int kerning;
|
int kerning;
|
||||||
FTexture *pic;
|
FTexture *pic;
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ void DrawTextCommon(F2DDrawer* drawer, FFont *font, int normalcolor, double x, d
|
||||||
|
|
||||||
PalEntry colorparm = parms.color;
|
PalEntry colorparm = parms.color;
|
||||||
PalEntry color = 0xffffffff;
|
PalEntry color = 0xffffffff;
|
||||||
range = font->GetColorTranslation((EColorRange)normalcolor, &color);
|
parms.remap = font->GetColorTranslation((EColorRange)normalcolor, &color);
|
||||||
parms.color = PalEntry(colorparm.a, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255);
|
parms.color = PalEntry(colorparm.a, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255);
|
||||||
|
|
||||||
kerning = font->GetDefaultKerning();
|
kerning = font->GetDefaultKerning();
|
||||||
|
@ -166,7 +166,7 @@ void DrawTextCommon(F2DDrawer* drawer, FFont *font, int normalcolor, double x, d
|
||||||
EColorRange newcolor = V_ParseFontColor(ch, normalcolor, boldcolor);
|
EColorRange newcolor = V_ParseFontColor(ch, normalcolor, boldcolor);
|
||||||
if (newcolor != CR_UNDEFINED)
|
if (newcolor != CR_UNDEFINED)
|
||||||
{
|
{
|
||||||
range = font->GetColorTranslation(newcolor, &color);
|
parms.remap = font->GetColorTranslation(newcolor, &color);
|
||||||
parms.color = PalEntry(colorparm.a, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255);
|
parms.color = PalEntry(colorparm.a, (color.r * colorparm.r) / 255, (color.g * colorparm.g) / 255, (color.b * colorparm.b) / 255);
|
||||||
currentcolor = newcolor;
|
currentcolor = newcolor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include "v_draw.h"
|
#include "v_draw.h"
|
||||||
#include "v_font.h"
|
#include "v_font.h"
|
||||||
#include "printf.h"
|
#include "printf.h"
|
||||||
|
#include "inputstate.h"
|
||||||
|
|
||||||
|
|
||||||
#define LEFTMARGIN 8
|
#define LEFTMARGIN 8
|
||||||
|
@ -634,6 +635,8 @@ void C_InitConsole (int width, int height, bool ingame)
|
||||||
ConCols = ConWidth / cwidth;
|
ConCols = ConWidth / cwidth;
|
||||||
|
|
||||||
if (conbuffer == NULL) conbuffer = new FConsoleBuffer;
|
if (conbuffer == NULL) conbuffer = new FConsoleBuffer;
|
||||||
|
|
||||||
|
timerSetCallback(C_Ticker);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -1011,6 +1014,11 @@ void C_NewModeAdjust ()
|
||||||
int consoletic = 0;
|
int consoletic = 0;
|
||||||
void C_Ticker()
|
void C_Ticker()
|
||||||
{
|
{
|
||||||
|
// The engine timer ticks at 120 fps which is 4x too fast for this.
|
||||||
|
static int delay = 0;
|
||||||
|
if (++delay < 4) return;
|
||||||
|
delay = 0;
|
||||||
|
|
||||||
static int lasttic = 0;
|
static int lasttic = 0;
|
||||||
consoletic++;
|
consoletic++;
|
||||||
|
|
||||||
|
@ -1193,7 +1201,6 @@ void C_DrawConsole ()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PalEntry pe((uint8_t)(con_alpha * 255), 0, 0, 0);
|
PalEntry pe((uint8_t)(con_alpha * 255), 0, 0, 0);
|
||||||
0, (/*gamestate != GS_FULLCONSOLE*/true) ? (double)con_alpha : 1,
|
|
||||||
twod.AddColorOnlyQuad(0, 0, screen->GetWidth(), visheight, pe);
|
twod.AddColorOnlyQuad(0, 0, screen->GetWidth(), visheight, pe);
|
||||||
}
|
}
|
||||||
if (conline && visheight < screen->GetHeight())
|
if (conline && visheight < screen->GetHeight())
|
||||||
|
@ -1319,11 +1326,13 @@ void C_ToggleConsole ()
|
||||||
HistPos = NULL;
|
HistPos = NULL;
|
||||||
TabbedLast = false;
|
TabbedLast = false;
|
||||||
TabbedList = false;
|
TabbedList = false;
|
||||||
|
GUICapture++;
|
||||||
}
|
}
|
||||||
else //if (gamestate != GS_FULLCONSOLE && gamestate != GS_STARTUP)
|
else //if (gamestate != GS_FULLCONSOLE && gamestate != GS_STARTUP)
|
||||||
{
|
{
|
||||||
ConsoleState = c_rising;
|
ConsoleState = c_rising;
|
||||||
C_FlushDisplay ();
|
C_FlushDisplay ();
|
||||||
|
GUICapture--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1768,6 +1777,11 @@ CCMD (echo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CCMD(toggleconsole)
|
||||||
|
{
|
||||||
|
C_ToggleConsole();
|
||||||
|
}
|
||||||
|
|
||||||
#if 0 // The Build engine cannot do this at the moment. Q: Implement and redirect some messages here?
|
#if 0 // The Build engine cannot do this at the moment. Q: Implement and redirect some messages here?
|
||||||
/* Printing in the middle of the screen */
|
/* Printing in the middle of the screen */
|
||||||
|
|
||||||
|
|
|
@ -390,7 +390,7 @@ void FFont::BuildTranslations (const double *luminosity, const uint8_t *identity
|
||||||
|
|
||||||
remap.Palette[0] = 0;
|
remap.Palette[0] = 0;
|
||||||
|
|
||||||
for (j = 0; j < ActiveColors; j++)
|
for (j = 1; j < ActiveColors; j++)
|
||||||
{
|
{
|
||||||
int v = int(luminosity[j] * 256.0);
|
int v = int(luminosity[j] * 256.0);
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ struct HexDataSource
|
||||||
static HexDataSource hexdata;
|
static HexDataSource hexdata;
|
||||||
|
|
||||||
// This is a font character that reads RLE compressed data.
|
// This is a font character that reads RLE compressed data.
|
||||||
class FHexFontChar : public FTexture
|
class FHexFontChar : public FTileTexture
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FHexFontChar(uint8_t *sourcedata, int swidth, int width, int height);
|
FHexFontChar(uint8_t *sourcedata, int swidth, int width, int height);
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
extern char appactive;
|
extern char appactive;
|
||||||
|
|
||||||
typedef uint8_t kb_scancode;
|
typedef uint8_t kb_scancode;
|
||||||
extern bool GUICapture;
|
extern int GUICapture;
|
||||||
|
|
||||||
// This encapsulates the entire game-readable input state which previously was spread out across several files.
|
// This encapsulates the entire game-readable input state which previously was spread out across several files.
|
||||||
|
|
||||||
|
|
|
@ -6488,7 +6488,7 @@ MAIN_LOOP_RESTART:
|
||||||
|
|
||||||
int const moveClock = (int)totalclock;
|
int const moveClock = (int)totalclock;
|
||||||
|
|
||||||
if (((ud.show_help == 0 && (myplayer.gm & MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1))
|
if (((ud.show_help == 0 && !GUICapture && (myplayer.gm & MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1))
|
||||||
&& (myplayer.gm & MODE_GAME))
|
&& (myplayer.gm & MODE_GAME))
|
||||||
{
|
{
|
||||||
G_MoveLoop();
|
G_MoveLoop();
|
||||||
|
|
|
@ -61,18 +61,25 @@ PaletteManager::~PaletteManager()
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void PaletteManager::DeleteAll()
|
void PaletteManager::DeleteAllTextures()
|
||||||
{
|
{
|
||||||
for (auto& pal : palettes)
|
for (auto& pal : palettes)
|
||||||
{
|
{
|
||||||
if (pal.paltexture) delete pal.paltexture;
|
if (pal.paltexture) delete pal.paltexture;
|
||||||
|
pal.paltexture = nullptr;
|
||||||
}
|
}
|
||||||
for (auto& pal : palswaps)
|
for (auto& pal : palswaps)
|
||||||
{
|
{
|
||||||
if (pal.swaptexture) delete pal.swaptexture;
|
if (pal.swaptexture) delete pal.swaptexture;
|
||||||
|
pal.swaptexture = nullptr;
|
||||||
}
|
}
|
||||||
if (palswapTexture) delete palswapTexture;
|
if (palswapTexture) delete palswapTexture;
|
||||||
palswapTexture = nullptr;
|
palswapTexture = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PaletteManager::DeleteAll()
|
||||||
|
{
|
||||||
|
DeleteAllTextures();
|
||||||
palettes.Reset();
|
palettes.Reset();
|
||||||
palswaps.Reset();
|
palswaps.Reset();
|
||||||
lastindex = ~0u;
|
lastindex = ~0u;
|
||||||
|
@ -144,7 +151,7 @@ unsigned PaletteManager::FindPalswap(const uint8_t* paldata)
|
||||||
for (int i = 0; i < 255; i++)
|
for (int i = 0; i < 255; i++)
|
||||||
{
|
{
|
||||||
int map = paldata[i];
|
int map = paldata[i];
|
||||||
PalEntry color = palettes[0].colors[map];
|
PalEntry color = palettes[palettemap[0]].colors[map];
|
||||||
if (color.Luminance() < foundColor.Luminance())
|
if (color.Luminance() < foundColor.Luminance())
|
||||||
{
|
{
|
||||||
foundColor = color;
|
foundColor = color;
|
||||||
|
@ -154,7 +161,7 @@ unsigned PaletteManager::FindPalswap(const uint8_t* paldata)
|
||||||
|
|
||||||
// Determine the fade color. We pick what black, or the darkest color, maps to in the lowest shade level.
|
// Determine the fade color. We pick what black, or the darkest color, maps to in the lowest shade level.
|
||||||
int map = paldata[(numshades - 2) * 256 + found]; // do not look in the latest shade level because it doesn't always contain useful data for this.
|
int map = paldata[(numshades - 2) * 256 + found]; // do not look in the latest shade level because it doesn't always contain useful data for this.
|
||||||
pd.fadeColor = palettes[0].colors[map];
|
pd.fadeColor = palettes[palettemap[0]].colors[map];
|
||||||
if (pd.fadeColor.Luminance() < 10) pd.fadeColor = 0; // Account for the inability to check the last fade level by using a higher threshold for determining black fog.
|
if (pd.fadeColor.Luminance() < 10) pd.fadeColor = 0; // Account for the inability to check the last fade level by using a higher threshold for determining black fog.
|
||||||
|
|
||||||
return palswaps.Push(pd);
|
return palswaps.Push(pd);
|
||||||
|
|
|
@ -171,7 +171,7 @@ void GLInstance::Deinit()
|
||||||
if (vpxShader) delete vpxShader;
|
if (vpxShader) delete vpxShader;
|
||||||
vpxShader = nullptr;
|
vpxShader = nullptr;
|
||||||
activeShader = nullptr;
|
activeShader = nullptr;
|
||||||
palmanager.DeleteAll();
|
palmanager.DeleteAllTextures();
|
||||||
lastPalswapIndex = -1;
|
lastPalswapIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,16 +209,25 @@ void GLInstance::Draw(EDrawType type, size_t start, size_t count)
|
||||||
{
|
{
|
||||||
renderState.Apply(polymostShader);
|
renderState.Apply(polymostShader);
|
||||||
if (renderState.VertexBuffer != LastVertexBuffer || LastVB_Offset[0] != renderState.VB_Offset[0] || LastVB_Offset[1] != renderState.VB_Offset[1])
|
if (renderState.VertexBuffer != LastVertexBuffer || LastVB_Offset[0] != renderState.VB_Offset[0] || LastVB_Offset[1] != renderState.VB_Offset[1])
|
||||||
|
{
|
||||||
|
if (renderState.VertexBuffer)
|
||||||
{
|
{
|
||||||
static_cast<OpenGLRenderer::GLVertexBuffer*>(renderState.VertexBuffer)->Bind(renderState.VB_Offset);
|
static_cast<OpenGLRenderer::GLVertexBuffer*>(renderState.VertexBuffer)->Bind(renderState.VB_Offset);
|
||||||
|
}
|
||||||
|
else glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
LastVertexBuffer = renderState.VertexBuffer;
|
LastVertexBuffer = renderState.VertexBuffer;
|
||||||
LastVB_Offset[0] = renderState.VB_Offset[0];
|
LastVB_Offset[0] = renderState.VB_Offset[0];
|
||||||
LastVB_Offset[1] = renderState.VB_Offset[1];
|
LastVB_Offset[1] = renderState.VB_Offset[1];
|
||||||
}
|
}
|
||||||
if (renderState.IndexBuffer != LastIndexBuffer)
|
if (renderState.IndexBuffer != LastIndexBuffer)
|
||||||
|
{
|
||||||
|
if (renderState.IndexBuffer)
|
||||||
{
|
{
|
||||||
static_cast<OpenGLRenderer::GLIndexBuffer*>(renderState.IndexBuffer)->Bind();
|
static_cast<OpenGLRenderer::GLIndexBuffer*>(renderState.IndexBuffer)->Bind();
|
||||||
}
|
}
|
||||||
|
else glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||||
|
LastIndexBuffer = renderState.IndexBuffer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!LastVertexBuffer)
|
if (!LastVertexBuffer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,6 +16,7 @@ class PolymostShader;
|
||||||
class SurfaceShader;
|
class SurfaceShader;
|
||||||
class FTexture;
|
class FTexture;
|
||||||
class GLInstance;
|
class GLInstance;
|
||||||
|
class F2DDrawer;
|
||||||
|
|
||||||
struct PaletteData
|
struct PaletteData
|
||||||
{
|
{
|
||||||
|
@ -72,6 +73,7 @@ public:
|
||||||
{}
|
{}
|
||||||
~PaletteManager();
|
~PaletteManager();
|
||||||
void DeleteAll();
|
void DeleteAll();
|
||||||
|
void DeleteAllTextures();
|
||||||
void SetPalette(int index, const uint8_t *data);
|
void SetPalette(int index, const uint8_t *data);
|
||||||
void SetPalswapData(int index, const uint8_t* data, int numshades);
|
void SetPalswapData(int index, const uint8_t* data, int numshades);
|
||||||
|
|
||||||
|
@ -215,6 +217,7 @@ public:
|
||||||
void LoadPolymostShader();
|
void LoadPolymostShader();
|
||||||
void LoadSurfaceShader();
|
void LoadSurfaceShader();
|
||||||
void LoadVPXShader();
|
void LoadVPXShader();
|
||||||
|
void Draw2D(F2DDrawer* drawer);
|
||||||
|
|
||||||
void Deinit();
|
void Deinit();
|
||||||
|
|
||||||
|
|
|
@ -82,17 +82,18 @@ public:
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
void Draw2D(F2DDrawer *drawer, FRenderState &state)
|
void GLInstance::Draw2D(F2DDrawer *drawer)
|
||||||
{
|
{
|
||||||
VSMatrix mat(0);
|
VSMatrix mat(0);
|
||||||
GLInterface.SetMatrix(Matrix_View, mat.get());
|
SetMatrix(Matrix_View, mat.get());
|
||||||
GLInterface.SetMatrix(Matrix_ModelView, mat.get());
|
SetMatrix(Matrix_ModelView, mat.get());
|
||||||
GLInterface.SetMatrix(Matrix_Detail, mat.get());
|
SetMatrix(Matrix_Detail, mat.get());
|
||||||
mat.ortho(0, xdim, ydim, 0, -1, 1);
|
mat.ortho(0, xdim, ydim, 0, -1, 1);
|
||||||
GLInterface.SetMatrix(Matrix_Projection, mat.get());
|
SetMatrix(Matrix_Projection, mat.get());
|
||||||
GLInterface.SetViewport(0, 0, xdim, ydim);
|
SetViewport(0, 0, xdim, ydim);
|
||||||
GLInterface.EnableDepthTest(false);
|
EnableDepthTest(false);
|
||||||
GLInterface.EnableMultisampling(false);
|
EnableMultisampling(false);
|
||||||
|
EnableBlend(true);
|
||||||
|
|
||||||
auto &vertices = drawer->mVertices;
|
auto &vertices = drawer->mVertices;
|
||||||
auto &indices = drawer->mIndices;
|
auto &indices = drawer->mIndices;
|
||||||
|
@ -113,9 +114,9 @@ void Draw2D(F2DDrawer *drawer, FRenderState &state)
|
||||||
}
|
}
|
||||||
F2DVertexBuffer vb;
|
F2DVertexBuffer vb;
|
||||||
vb.UploadData(&vertices[0], vertices.Size(), &indices[0], indices.Size());
|
vb.UploadData(&vertices[0], vertices.Size(), &indices[0], indices.Size());
|
||||||
GLInterface.SetVertexBuffer(vb.GetBufferObjects().first, 0, 0);
|
SetVertexBuffer(vb.GetBufferObjects().first, 0, 0);
|
||||||
GLInterface.SetIndexBuffer(vb.GetBufferObjects().second);
|
SetIndexBuffer(vb.GetBufferObjects().second);
|
||||||
GLInterface.SetFadeDisable(true);
|
SetFadeDisable(true);
|
||||||
|
|
||||||
for(auto &cmd : commands)
|
for(auto &cmd : commands)
|
||||||
{
|
{
|
||||||
|
@ -139,37 +140,37 @@ void Draw2D(F2DDrawer *drawer, FRenderState &state)
|
||||||
{
|
{
|
||||||
sciX = sciY = sciW = sciH = -1;
|
sciX = sciY = sciW = sciH = -1;
|
||||||
}
|
}
|
||||||
//GLInterface.SetScissor(sciX, sciY, sciW, sciH);
|
//SetScissor(sciX, sciY, sciW, sciH);
|
||||||
|
|
||||||
//state.SetFog(cmd.mColor1, 0);
|
//state.SetFog(cmd.mColor1, 0);
|
||||||
GLInterface.SetColor(1, 1, 1);
|
SetColor(1, 1, 1);
|
||||||
//state.SetColor(1, 1, 1, 1, cmd.mDesaturate);
|
//state.SetColor(1, 1, 1, 1, cmd.mDesaturate);
|
||||||
|
|
||||||
GLInterface.SetAlphaThreshold(0.0f);
|
SetAlphaThreshold(0.0f);
|
||||||
|
|
||||||
if (cmd.mTexture != nullptr)
|
if (cmd.mTexture != nullptr)
|
||||||
{
|
{
|
||||||
auto tex = cmd.mTexture;
|
auto tex = cmd.mTexture;
|
||||||
GLInterface.SetNamedTexture(cmd.mTexture, cmd.mRemapIndex, cmd.mFlags & F2DDrawer::DTF_Wrap ? SamplerRepeat : SamplerClampXY);
|
SetNamedTexture(cmd.mTexture, cmd.mRemapIndex, cmd.mFlags & F2DDrawer::DTF_Wrap ? SamplerRepeat : SamplerClampXY);
|
||||||
GLInterface.UseColorOnly(false);
|
UseColorOnly(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GLInterface.UseColorOnly(true);
|
UseColorOnly(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cmd.mType)
|
switch (cmd.mType)
|
||||||
{
|
{
|
||||||
case F2DDrawer::DrawTypeTriangles:
|
case F2DDrawer::DrawTypeTriangles:
|
||||||
GLInterface.Draw(DT_TRIANGLES, cmd.mIndexIndex, cmd.mIndexCount);
|
Draw(DT_TRIANGLES, cmd.mIndexIndex, cmd.mIndexCount);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case F2DDrawer::DrawTypeLines:
|
case F2DDrawer::DrawTypeLines:
|
||||||
GLInterface.Draw(DT_LINES, cmd.mVertIndex, cmd.mVertCount);
|
//Draw(DT_LINES, cmd.mVertIndex, cmd.mVertCount);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case F2DDrawer::DrawTypePoints:
|
case F2DDrawer::DrawTypePoints:
|
||||||
//GLInterface.Draw(DT_POINTS, cmd.mVertIndex, cmd.mVertCount);
|
//Draw(DT_POINTS, cmd.mVertIndex, cmd.mVertCount);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -185,12 +186,13 @@ void Draw2D(F2DDrawer *drawer, FRenderState &state)
|
||||||
//state.SetScissor(-1, -1, -1, -1);
|
//state.SetScissor(-1, -1, -1, -1);
|
||||||
|
|
||||||
//state.SetRenderStyle(STYLE_Translucent);
|
//state.SetRenderStyle(STYLE_Translucent);
|
||||||
GLInterface.SetVertexBuffer(nullptr, 0, 0);
|
SetVertexBuffer(nullptr, 0, 0);
|
||||||
GLInterface.SetIndexBuffer(nullptr);
|
SetIndexBuffer(nullptr);
|
||||||
GLInterface.UseColorOnly(false);
|
UseColorOnly(false);
|
||||||
//state.EnableBrightmap(true);
|
//state.EnableBrightmap(true);
|
||||||
//state.SetTextureMode(TM_NORMAL);
|
//state.SetTextureMode(TM_NORMAL);
|
||||||
GLInterface.SetFadeDisable(false);
|
SetFadeDisable(false);
|
||||||
GLInterface.SetColor(1, 1, 1);
|
SetColor(1, 1, 1);
|
||||||
//drawer->mIsFirstPass = false;
|
//drawer->mIsFirstPass = false;
|
||||||
|
twod.Clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7896,7 +7896,7 @@ MAIN_LOOP_RESTART:
|
||||||
|
|
||||||
int const moveClock = (int) totalclock;
|
int const moveClock = (int) totalclock;
|
||||||
|
|
||||||
if (((ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
|
if (((ud.show_help == 0 && !GUICapture && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
|
||||||
(g_player[myconnectindex].ps->gm&MODE_GAME))
|
(g_player[myconnectindex].ps->gm&MODE_GAME))
|
||||||
{
|
{
|
||||||
G_MoveLoop();
|
G_MoveLoop();
|
||||||
|
|
|
@ -683,14 +683,11 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
|
||||||
inputState.ClearKeyStatus(inputState.GetLastScanCode());
|
inputState.ClearKeyStatus(inputState.GetLastScanCode());
|
||||||
|
|
||||||
//KeyboardKeys[currentkey][currentcol] = KB_GetLastScanCode();
|
//KeyboardKeys[currentkey][currentcol] = KB_GetLastScanCode();
|
||||||
if (currentkey != gamefunc_Show_Console)
|
|
||||||
{
|
|
||||||
#if 0 // [JM] Re-do this shit !CHECKME!
|
#if 0 // [JM] Re-do this shit !CHECKME!
|
||||||
CONTROL_MapKey(currentkey,
|
CONTROL_MapKey(currentkey,
|
||||||
KeyboardKeys[currentkey][0],
|
KeyboardKeys[currentkey][0],
|
||||||
KeyboardKeys[currentkey][1]);
|
KeyboardKeys[currentkey][1]);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
currentmode = 0;
|
currentmode = 0;
|
||||||
}
|
}
|
||||||
|
@ -733,11 +730,8 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
|
||||||
else if (inputState.GetKeyStatus(sc_Delete))
|
else if (inputState.GetKeyStatus(sc_Delete))
|
||||||
{
|
{
|
||||||
inputState.ClearKeyStatus(sc_Delete);
|
inputState.ClearKeyStatus(sc_Delete);
|
||||||
if (currentkey != gamefunc_Show_Console)
|
|
||||||
{
|
|
||||||
//Bindings.UnbindACommand(buttonMap.GetButtonName(M_KEYBOARDKEYS.currentEntry));
|
//Bindings.UnbindACommand(buttonMap.GetButtonName(M_KEYBOARDKEYS.currentEntry));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (inputState.GetKeyStatus(sc_Home))
|
else if (inputState.GetKeyStatus(sc_Home))
|
||||||
{
|
{
|
||||||
currentkey = 0;
|
currentkey = 0;
|
||||||
|
@ -787,8 +781,6 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
|
||||||
currentcol = 0;
|
currentcol = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentkey == gamefunc_Show_Console) currentcol = 0;
|
|
||||||
|
|
||||||
CONTROL_ClearUserInput(&inpt);
|
CONTROL_ClearUserInput(&inpt);
|
||||||
|
|
||||||
if (NUMGAMEFUNCTIONS > PGSIZ)
|
if (NUMGAMEFUNCTIONS > PGSIZ)
|
||||||
|
@ -827,8 +819,6 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
|
||||||
MNU_DrawSmallString(OPT_XSIDE, j, p, (i==currentkey) ? -5 : 12,
|
MNU_DrawSmallString(OPT_XSIDE, j, p, (i==currentkey) ? -5 : 12,
|
||||||
(i==currentkey && currentcol==0) ? 14 : 16);
|
(i==currentkey && currentcol==0) ? 14 : 16);
|
||||||
|
|
||||||
if (i == gamefunc_Show_Console) continue;
|
|
||||||
|
|
||||||
p = keyGetName(KeyboardKeys[i][1]);
|
p = keyGetName(KeyboardKeys[i][1]);
|
||||||
if (!p || KeyboardKeys[i][1]==0xff) p = " -";
|
if (!p || KeyboardKeys[i][1]==0xff) p = " -";
|
||||||
MNU_DrawSmallString(OPT_XSIDE + 4*14, j, p, (i==currentkey) ? -5 : 12,
|
MNU_DrawSmallString(OPT_XSIDE + 4*14, j, p, (i==currentkey) ? -5 : 12,
|
||||||
|
|
|
@ -68,7 +68,7 @@ J "+JumpBoots"
|
||||||
M "+MedKit"
|
M "+MedKit"
|
||||||
P "+ProximityBombs"
|
P "+ProximityBombs"
|
||||||
R "+RemoteBombs"
|
R "+RemoteBombs"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Mouse1 "+Fire"
|
Mouse1 "+Fire"
|
||||||
Mouse2 "+Alt_Fire"
|
Mouse2 "+Alt_Fire"
|
||||||
MWheelUp "+Previous_Weapon"
|
MWheelUp "+Previous_Weapon"
|
||||||
|
|
|
@ -64,7 +64,7 @@ J "+JumpBoots"
|
||||||
M "+MedKit"
|
M "+MedKit"
|
||||||
P "+ProximityBombs"
|
P "+ProximityBombs"
|
||||||
R "+RemoteBombs"
|
R "+RemoteBombs"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Mouse1 "+Fire"
|
Mouse1 "+Fire"
|
||||||
Mouse2 "+Open"
|
Mouse2 "+Open"
|
||||||
Mouse3 "+Run"
|
Mouse3 "+Run"
|
||||||
|
|
|
@ -69,7 +69,7 @@ J "+JumpBoots"
|
||||||
M "+MedKit"
|
M "+MedKit"
|
||||||
P "+ProximityBombs"
|
P "+ProximityBombs"
|
||||||
R "+RemoteBombs"
|
R "+RemoteBombs"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Mouse1 "+Fire"
|
Mouse1 "+Fire"
|
||||||
Mouse2 "+Alt_Fire"
|
Mouse2 "+Alt_Fire"
|
||||||
MWheelUp "+Previous_Weapon"
|
MWheelUp "+Previous_Weapon"
|
||||||
|
|
|
@ -63,7 +63,7 @@ R "+Steroids"
|
||||||
Q "+Quick_Kick"
|
Q "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
X "+Last_Used_Weapon"
|
X "+Last_Used_Weapon"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
|
|
|
@ -59,7 +59,7 @@ R "+Steroids"
|
||||||
Q "+Quick_Kick"
|
Q "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
|
|
|
@ -66,7 +66,7 @@ R "+Steroids"
|
||||||
` "+Quick_Kick"
|
` "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
C "+Show_Console"
|
C "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
|
|
|
@ -57,7 +57,7 @@ F "+Map_Follow_Mode"
|
||||||
K "+See_Coop_View"
|
K "+See_Coop_View"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
X "+Last_Used_Weapon"
|
X "+Last_Used_Weapon"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
|
|
|
@ -57,7 +57,7 @@ U "+Mouse_Aiming"
|
||||||
I "+Toggle_Crosshair"
|
I "+Toggle_Crosshair"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
|
|
|
@ -60,7 +60,7 @@ U "+Mouse_Aiming"
|
||||||
I "+Toggle_Crosshair"
|
I "+Toggle_Crosshair"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
C "+Show_Console"
|
C "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
|
|
|
@ -63,7 +63,7 @@ R "+Steroids"
|
||||||
Q "+Quick_Kick"
|
Q "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
X "+Last_Used_Weapon"
|
X "+Last_Used_Weapon"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
|
|
|
@ -63,7 +63,7 @@ R "+Steroids"
|
||||||
Q "+Quick_Kick"
|
Q "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
|
|
|
@ -66,7 +66,7 @@ R "+Steroids"
|
||||||
` "+Quick_Kick"
|
` "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
C "+Show_Console"
|
C "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
|
|
|
@ -64,7 +64,7 @@ M "+Steroids"
|
||||||
Q "+Quick_Kick"
|
Q "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
+ "+Dpad_Select"
|
+ "+Dpad_Select"
|
||||||
X "+Last_Used_Weapon"
|
X "+Last_Used_Weapon"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
|
|
|
@ -63,7 +63,7 @@ M "+Steroids"
|
||||||
Q "+Quick_Kick"
|
Q "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
F7 "+Third_Person_View"
|
F7 "+Third_Person_View"
|
||||||
|
|
|
@ -68,7 +68,7 @@ M "+Steroids"
|
||||||
` "+Quick_Kick"
|
` "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
V "+Show_Console"
|
V "toggleconsole"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
F7 "+Third_Person_View"
|
F7 "+Third_Person_View"
|
||||||
|
|
|
@ -36,7 +36,7 @@ F "+Map_Follow_Mode"
|
||||||
K "+See_Coop_View"
|
K "+See_Coop_View"
|
||||||
U "+Mouse_Aiming"
|
U "+Mouse_Aiming"
|
||||||
I "+Toggle_Crosshair"
|
I "+Toggle_Crosshair"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Mouse1 "+Fire"
|
Mouse1 "+Fire"
|
||||||
Mouse2 "+MediKit"
|
Mouse2 "+MediKit"
|
||||||
MWheelUp "+Previous_Weapon"
|
MWheelUp "+Previous_Weapon"
|
||||||
|
|
|
@ -58,7 +58,7 @@ U "+Mouse_Aiming"
|
||||||
I "+Toggle_Crosshair"
|
I "+Toggle_Crosshair"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Mouse1 "+Fire"
|
Mouse1 "+Fire"
|
||||||
Mouse2 "+Open"
|
Mouse2 "+Open"
|
||||||
Mouse3 "+Run"
|
Mouse3 "+Run"
|
||||||
|
|
|
@ -63,7 +63,7 @@ U "+Mouse_Aiming"
|
||||||
I "+Toggle_Crosshair"
|
I "+Toggle_Crosshair"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Mouse1 "+Fire"
|
Mouse1 "+Fire"
|
||||||
Mouse2 "+MediKit"
|
Mouse2 "+MediKit"
|
||||||
MWheelUp "+Previous_Weapon"
|
MWheelUp "+Previous_Weapon"
|
||||||
|
|
|
@ -63,7 +63,7 @@ R "+Steroids"
|
||||||
Q "+Quick_Kick"
|
Q "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
X "+Last_Used_Weapon"
|
X "+Last_Used_Weapon"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
|
|
|
@ -64,7 +64,7 @@ R "+Steroids"
|
||||||
Q "+Quick_Kick"
|
Q "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
` "+Show_Console"
|
` "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
|
|
|
@ -67,7 +67,7 @@ R "+Steroids"
|
||||||
` "+Quick_Kick"
|
` "+Quick_Kick"
|
||||||
' "+Next_Weapon"
|
' "+Next_Weapon"
|
||||||
; "+Previous_Weapon"
|
; "+Previous_Weapon"
|
||||||
C "+Show_Console"
|
C "toggleconsole"
|
||||||
Capslock "+AutoRun"
|
Capslock "+AutoRun"
|
||||||
F6 "+Quick_Save"
|
F6 "+Quick_Save"
|
||||||
F9 "+Quick_Load"
|
F9 "+Quick_Load"
|
||||||
|
|
Loading…
Reference in a new issue