Compare commits

...
22 Commits
Author SHA1 Message Date
Alug 8b72cc6b01 Merge branch 'Saturn-Next' into Saturn 2024-04-01 18:28:32 +02:00
Alug 8ed8182a1b Zzz... 2024-04-01 17:18:38 +02:00
Alug e2f4e1f08e update menu text for keyboard layout 2024-04-01 16:38:38 +02:00
Alug 6e59fdacb5 add AZERTY layout as toggable option
so no need to update that thing seperately anymore
2024-04-01 16:34:01 +02:00
Alug 33501b6798 Merge pull request #123 from Indev450/linkedtex
Manage Gpu Textures with a list
2024-04-01 14:31:15 +02:00
Alug ffb72f5fe3 Fix vertical aim being off when using lack of perspective 2024-03-31 23:27:30 +02:00
indev d3f6b983f4 Use 'find' directly in help 2024-03-30 22:18:51 +03:00
indev 9435fa8d6b If command is not found via 'help', tell user about 'find' command 2024-03-30 22:03:10 +03:00
Alug 0ceb9e5ea5 fix this for splitscreen and move to own function 2024-03-30 03:34:58 +01:00
Alug 95c0951727 Merge pull request #122 from Indev450/luadebuglib
Expose debug library to Lua
2024-03-28 15:08:31 +01:00
Alug de6a54bc8c why tf is that here 2024-03-28 14:25:07 +01:00
Alug 1e524a8240 when the GLENCORE 2024-03-28 13:22:06 +01:00
Alug ca1302475e use this instead 2024-03-28 08:13:23 +01:00
Alug 8486bddaf2 fix highresscale issue on startup in the worst way ever cause CV_NOINIT doesent work for whatever reason 2024-03-28 00:15:55 +01:00
Alug 847a8cfd81 Zzz... 2024-03-27 20:38:29 +01:00
Alug 2fc6a26e77 GL_GENERATE_MIPMAP is enough
also made MajorGL and MinorGL extern, so can be used in other parts if needed to check for it
2024-03-27 20:36:07 +01:00
Alug 4847d2d844 Handle OpenGL textures with a linked list 2024-03-27 17:51:58 +01:00
Alug 56f3249679 Expose debug library to Lua
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2404
2024-03-26 21:03:18 +01:00
Alug 9b7eff1a33 cute icon 2024-03-17 19:42:01 +01:00
indev c45aec4634 Merge pull request #87 from riomccloud/patch-1
Delete org.srb2.SRB2Kart-Saturn.metainfo.xml
2024-01-13 20:04:37 +03:00
riomccloud 7e11bbb5ca Delete org.srb2.SRB2Kart-Saturn.metainfo.xml 2024-01-13 12:18:45 -03:00
indev d5ccf6cad0 Update org.srb2.SRB2Kart-Saturn.metainfo.xml 2024-01-03 10:43:09 +00:00
29 changed files with 811 additions and 227 deletions

No files matched your search

-80
View File
@@ -1,80 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2023 Flathub maintainers -->
<component type="desktop-application">
<id>org.srb2.SRB2Kart-Saturn</id>
<metadata_license>FSFAP</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>Sonic Robo Blast 2 Kart Saturn</name>
<summary>Modded SRB2Kart adding many custom features</summary>
<description>
<p>
A modded net-compatible version of SRB2Kart v1.6 that offers multiple code optimizations, palette rendering, player sprite rotation, base Kart HUD customization, and many more.
</p>
</description>
<launchable type="desktop-id">org.srb2.SRB2Kart-Saturn.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://wiki.srb2.org/w/images/a/ac/Srb2kart_title.png</image>
<caption>Title screen</caption>
</screenshot>
<screenshot>
<image>https://user-images.githubusercontent.com/15758649/227740700-26e0962b-5572-486c-b633-7d4990d86f89.png</image>
<caption>Game modes</caption>
</screenshot>
<screenshot>
<image>https://user-images.githubusercontent.com/1964655/82821921-3d180c00-9ea5-11ea-937b-e1f53fe6c686.png</image>
<caption>Game play as Sonic</caption>
</screenshot>
<screenshot>
<image>https://user-images.githubusercontent.com/1964655/82821933-41442980-9ea5-11ea-9146-38998161edae.png</image>
<caption>Game play as Tails</caption>
</screenshot>
<screenshot>
<image>https://user-images.githubusercontent.com/1964655/82821966-502adc00-9ea5-11ea-9cbd-274d7adb479e.png</image>
<caption>Game play as Eggman</caption>
</screenshot>
<screenshot>
<image>https://user-images.githubusercontent.com/1964655/82821980-5620bd00-9ea5-11ea-9eec-2835ebb2a262.png</image>
<caption>Game play as Metal Sonic</caption>
</screenshot>
</screenshots>
<url type="homepage">https://github.com/Indev450/SRB2Kart-Saturn</url>
<url type="bugtracker">https://github.com/Indev450/SRB2Kart-Saturn/issues</url>
<developer_name>Indev450</developer_name>
<provides>
<binary>srb2kart</binary>
</provides>
<releases>
<release version="5.1" date="2023-12-20">
<description>
<p>The complete changelog can be found on the build's GitHub repository.</p>
</description>
<url>https://github.com/Indev450/SRB2Kart-Saturn/releases/tag/v5.1</url>
</release>
<release version="5.0" date="2023-12-17">
<description>
<p>The complete changelog can be found on the build's GitHub repository.</p>
</description>
<url>https://github.com/Indev450/SRB2Kart-Saturn/releases/tag/v5</url>
</release>
</releases>
<categories>
<category>Game</category>
<category>SportsGame</category>
</categories>
<recommends>
<control>keyboard</control>
<control>gamepad</control>
</recommends>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">moderate</content_attribute>
<content_attribute id="language-humor">mild</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="social-info">mild</content_attribute>
</content_rating>
<keywords>
<keyword>doom</keyword>
<keyword>multiplayer</keyword>
<keyword>racing</keyword>
</keywords>
</component>
+1
View File
@@ -260,6 +260,7 @@ if(${SRB2_CONFIG_HAVE_BLUA})
blua/lapi.c
blua/lauxlib.c
blua/lbaselib.c
blua/ldblib.c
blua/lcode.c
blua/ldebug.c
blua/ldo.c
+1
View File
@@ -14,6 +14,7 @@ OBJS:=$(OBJS) \
$(OBJDIR)/lapi.o \
$(OBJDIR)/lbaselib.o \
$(OBJDIR)/ldo.o \
$(OBJDIR)/ldblib.o \
$(OBJDIR)/lfunc.o \
$(OBJDIR)/linit.o \
$(OBJDIR)/liolib.o \
+310
View File
@@ -0,0 +1,310 @@
/*
** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ldblib_c
#define LUA_LIB
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
static void settabss (lua_State *L, const char *i, const char *v) {
lua_pushstring(L, v);
lua_setfield(L, -2, i);
}
static void settabsi (lua_State *L, const char *i, int v) {
lua_pushinteger(L, v);
lua_setfield(L, -2, i);
}
static lua_State *getthread (lua_State *L, int *arg) {
if (lua_isthread(L, 1)) {
*arg = 1;
return lua_tothread(L, 1);
}
else {
*arg = 0;
return L;
}
}
static void treatstackoption (lua_State *L, lua_State *L1, const char *fname) {
if (L == L1) {
lua_pushvalue(L, -2);
lua_remove(L, -3);
}
else
lua_xmove(L1, L, 1);
lua_setfield(L, -2, fname);
}
static int db_getinfo (lua_State *L) {
lua_Debug ar;
int arg;
lua_State *L1 = getthread(L, &arg);
const char *options = luaL_optstring(L, arg+2, "flnSu");
if (lua_isnumber(L, arg+1)) {
if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) {
lua_pushnil(L); /* level out of range */
return 1;
}
}
else if (lua_isfunction(L, arg+1)) {
lua_pushfstring(L, ">%s", options);
options = lua_tostring(L, -1);
lua_pushvalue(L, arg+1);
lua_xmove(L, L1, 1);
}
else
return luaL_argerror(L, arg+1, "function or level expected");
if (!lua_getinfo(L1, options, &ar))
return luaL_argerror(L, arg+2, "invalid option");
lua_createtable(L, 0, 2);
if (strchr(options, 'S')) {
settabss(L, "source", ar.source);
settabss(L, "short_src", ar.short_src);
settabsi(L, "linedefined", ar.linedefined);
settabsi(L, "lastlinedefined", ar.lastlinedefined);
settabss(L, "what", ar.what);
}
if (strchr(options, 'l'))
settabsi(L, "currentline", ar.currentline);
if (strchr(options, 'u'))
settabsi(L, "nups", ar.nups);
if (strchr(options, 'n')) {
settabss(L, "name", ar.name);
settabss(L, "namewhat", ar.namewhat);
}
if (strchr(options, 'L'))
treatstackoption(L, L1, "activelines");
if (strchr(options, 'f'))
treatstackoption(L, L1, "func");
return 1; /* return table */
}
static int db_getlocal (lua_State *L) {
int arg;
lua_State *L1 = getthread(L, &arg);
lua_Debug ar;
const char *name;
if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */
return luaL_argerror(L, arg+1, "level out of range");
name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2));
if (name) {
lua_xmove(L1, L, 1);
lua_pushstring(L, name);
lua_pushvalue(L, -2);
return 2;
}
else {
lua_pushnil(L);
return 1;
}
}
static int auxupvalue (lua_State *L, int get) {
const char *name;
int n = luaL_checkint(L, 2);
luaL_checktype(L, 1, LUA_TFUNCTION);
if (lua_iscfunction(L, 1)) return 0; /* cannot touch C upvalues from Lua */
name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n);
if (name == NULL) return 0;
lua_pushstring(L, name);
lua_insert(L, -(get+1));
return get + 1;
}
static int db_getupvalue (lua_State *L) {
return auxupvalue(L, 1);
}
static char KEY_HOOK = 'h';
static void hookf (lua_State *L, lua_Debug *ar) {
static const char *const hooknames[] =
{"call", "return", "line", "count", "tail return"};
lua_pushlightuserdata(L, (void *)&KEY_HOOK);
lua_rawget(L, LUA_REGISTRYINDEX);
lua_pushlightuserdata(L, L);
lua_rawget(L, -2);
if (lua_isfunction(L, -1)) {
lua_pushstring(L, hooknames[(int)ar->event]);
if (ar->currentline >= 0)
lua_pushinteger(L, ar->currentline);
else lua_pushnil(L);
lua_assert(lua_getinfo(L, "lS", ar));
lua_call(L, 2, 0);
}
}
static int makemask (const char *smask, int count) {
int mask = 0;
if (strchr(smask, 'c')) mask |= LUA_MASKCALL;
if (strchr(smask, 'r')) mask |= LUA_MASKRET;
if (strchr(smask, 'l')) mask |= LUA_MASKLINE;
if (count > 0) mask |= LUA_MASKCOUNT;
return mask;
}
static char *unmakemask (int mask, char *smask) {
int i = 0;
if (mask & LUA_MASKCALL) smask[i++] = 'c';
if (mask & LUA_MASKRET) smask[i++] = 'r';
if (mask & LUA_MASKLINE) smask[i++] = 'l';
smask[i] = '\0';
return smask;
}
static void gethooktable (lua_State *L) {
lua_pushlightuserdata(L, (void *)&KEY_HOOK);
lua_rawget(L, LUA_REGISTRYINDEX);
if (!lua_istable(L, -1)) {
lua_pop(L, 1);
lua_createtable(L, 0, 1);
lua_pushlightuserdata(L, (void *)&KEY_HOOK);
lua_pushvalue(L, -2);
lua_rawset(L, LUA_REGISTRYINDEX);
}
}
static int db_sethook (lua_State *L) {
int arg, mask, count;
lua_Hook func;
lua_State *L1 = getthread(L, &arg);
if (lua_isnoneornil(L, arg+1)) {
lua_settop(L, arg+1);
func = NULL; mask = 0; count = 0; /* turn off hooks */
}
else {
const char *smask = luaL_checkstring(L, arg+2);
luaL_checktype(L, arg+1, LUA_TFUNCTION);
count = luaL_optint(L, arg+3, 0);
func = hookf; mask = makemask(smask, count);
}
gethooktable(L);
lua_pushlightuserdata(L, L1);
lua_pushvalue(L, arg+1);
lua_rawset(L, -3); /* set new hook */
lua_pop(L, 1); /* remove hook table */
lua_sethook(L1, func, mask, count); /* set hooks */
return 0;
}
static int db_gethook (lua_State *L) {
int arg;
lua_State *L1 = getthread(L, &arg);
char buff[5];
int mask = lua_gethookmask(L1);
lua_Hook hook = lua_gethook(L1);
if (hook != NULL && hook != hookf) /* external hook? */
lua_pushliteral(L, "external hook");
else {
gethooktable(L);
lua_pushlightuserdata(L, L1);
lua_rawget(L, -2); /* get hook */
lua_remove(L, -2); /* remove hook table */
}
lua_pushstring(L, unmakemask(mask, buff));
lua_pushinteger(L, lua_gethookcount(L1));
return 3;
}
#define LEVELS1 12 /* size of the first part of the stack */
#define LEVELS2 10 /* size of the second part of the stack */
static int db_errorfb (lua_State *L) {
int level;
int firstpart = 1; /* still before eventual `...' */
int arg;
lua_State *L1 = getthread(L, &arg);
lua_Debug ar;
if (lua_isnumber(L, arg+2)) {
level = (int)lua_tointeger(L, arg+2);
lua_pop(L, 1);
}
else
level = (L == L1) ? 1 : 0; /* level 0 may be this own function */
if (lua_gettop(L) == arg)
lua_pushliteral(L, "");
else if (!lua_isstring(L, arg+1)) return 1; /* message is not a string */
else lua_pushliteral(L, "\n");
lua_pushliteral(L, "stack traceback:");
while (lua_getstack(L1, level++, &ar)) {
if (level > LEVELS1 && firstpart) {
/* no more than `LEVELS2' more levels? */
if (!lua_getstack(L1, level+LEVELS2, &ar))
level--; /* keep going */
else {
lua_pushliteral(L, "\n\t..."); /* too many levels */
while (lua_getstack(L1, level+LEVELS2, &ar)) /* find last levels */
level++;
}
firstpart = 0;
continue;
}
lua_pushliteral(L, "\n\t");
lua_getinfo(L1, "Snl", &ar);
lua_pushfstring(L, "%s:", ar.short_src);
if (ar.currentline > 0)
lua_pushfstring(L, "%d:", ar.currentline);
if (*ar.namewhat != '\0') /* is there a name? */
lua_pushfstring(L, " in function " LUA_QS, ar.name);
else {
if (*ar.what == 'm') /* main? */
lua_pushfstring(L, " in main chunk");
else if (*ar.what == 'C' || *ar.what == 't')
lua_pushliteral(L, " ?"); /* C function or tail call */
else
lua_pushfstring(L, " in function <%s:%d>",
ar.short_src, ar.linedefined);
}
lua_concat(L, lua_gettop(L) - arg);
}
lua_concat(L, lua_gettop(L) - arg);
return 1;
}
static const luaL_Reg dblib[] = {
{"gethook", db_gethook},
{"getinfo", db_getinfo},
{"getlocal", db_getlocal},
{"getupvalue", db_getupvalue},
{"sethook", db_sethook},
{"traceback", db_errorfb},
{NULL, NULL}
};
LUALIB_API int luaopen_debug (lua_State *L) {
luaL_register(L, LUA_DBLIBNAME, dblib);
return 1;
}
+1
View File
@@ -19,6 +19,7 @@ static const luaL_Reg lualibs[] = {
{LUA_TABLIBNAME, luaopen_table},
{LUA_IOLIBNAME, luaopen_io},
{LUA_STRLIBNAME, luaopen_string},
{LUA_DBLIBNAME, luaopen_debug},
{NULL, NULL}
};
+3
View File
@@ -27,6 +27,9 @@ LUALIB_API int (luaopen_io) (lua_State *L);
#define LUA_STRLIBNAME "string"
LUALIB_API int (luaopen_string) (lua_State *L);
#define LUA_DBLIBNAME "debug"
LUALIB_API int (luaopen_debug) (lua_State *L);
/* open all previous libraries */
LUALIB_API void (luaL_openlibs) (lua_State *L);
+2 -2
View File
@@ -872,8 +872,8 @@ static void COM_Help_f(void)
return;
}
CONS_Printf("No variable or command named %s", help);
CONS_Printf("\x82""\nCheck wiki.srb2.org for more or try typing help without arguments\n");
CONS_Printf("Variable or command not found, trying \"find %s\"...\n", help);
COM_ImmedExecute(va("find %s", help));
}
return;
+53 -5
View File
@@ -643,6 +643,30 @@ INT32 CON_ShiftChar(INT32 ch)
return ch;
}
INT32 CON_ShitAndAltGrChar(INT32 ch)
{
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
{
if (shiftdown ^ capslock)
ch = shiftxform[ch];
}
else // if we're holding shift we should still shift non letter symbols
{
if (shiftdown)
ch = shiftxform[ch];
else if (altdown & 0x2)
{
ch = french_altgrxform[ch];
}
else
{
ch = HU_FallBackFrSpecialLetter(ch);
}
}
return ch;
}
// Clear time of console heads up messages
//
void CON_ClearHUD(void)
@@ -941,7 +965,7 @@ boolean CON_Responder(event_t *ev)
return true;
// ctrl modifier -- changes behavior, adds shortcuts
if (ctrldown)
if ((cv_keyboardlayout.value != 3 && ctrldown) || (cv_keyboardlayout.value == 3 && ctrldown && !altdown))
{
// show all cvars/commands that match what we have inputted
if (key == KEY_TAB)
@@ -1211,13 +1235,37 @@ boolean CON_Responder(event_t *ev)
// same capslock code as hu_stuff.c's HU_responder. Check there for details.
if ((key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z'))
{
if (shiftdown ^ capslock)
key = shiftxform[key];
if (cv_keyboardlayout.value == 3)
{
if (shiftdown ^ capslock)
key = shiftxform[key];
else if (altdown & 0x2)
key = french_altgrxform[key];
else
key = HU_FallBackFrSpecialLetter(key);
}
else
{
if (shiftdown ^ capslock)
key = shiftxform[key];
}
}
else
{
if (shiftdown)
key = shiftxform[key];
if (cv_keyboardlayout.value == 3)
{
if (shiftdown)
key = shiftxform[key];
else if (altdown & 0x2)
key = french_altgrxform[key];
else
key = HU_FallBackFrSpecialLetter(key);
}
else
{
if (shiftdown)
key = shiftxform[key];
}
}
// enter a char into the command prompt
+1
View File
@@ -46,6 +46,7 @@ extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *or
extern UINT8 *consolebgmap;
INT32 CON_ShiftChar(INT32 ch);
INT32 CON_ShitAndAltGrChar(INT32 ch);
void CON_SetupBackColormap(void);
void CON_ClearHUD(void); // clear heads up messages
+1 -1
View File
@@ -821,7 +821,7 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_recordmultiplayerdemos);
CV_RegisterVar(&cv_netdemosyncquality);
CV_RegisterVar(&cv_maxdemosize);
CV_RegisterVar(&cv_nativekeyboard);
CV_RegisterVar(&cv_keyboardlayout);
}
// =========================================================================
+1 -1
View File
@@ -8461,7 +8461,7 @@ boolean G_DemoTitleResponder(event_t *ev)
if (len < 64)
{
demo.titlename[len+1] = 0;
demo.titlename[len] = CON_ShiftChar(ch);
demo.titlename[len] = cv_keyboardlayout.value == 3 ? CON_ShitAndAltGrChar(ch) : CON_ShiftChar(ch);
}
}
else if (ch == KEY_BACKSPACE)
+10 -5
View File
@@ -492,6 +492,7 @@ static void FreeMipmapColormap(INT32 patchnum, void *patch)
if (next->data)
Z_Free(next->data);
next->data = NULL;
HWD.pfnDeleteTexture(next);
// Free the old colormap mipmap from memory.
free(next);
@@ -535,7 +536,11 @@ void HWR_LoadTextures(size_t pnumtextures)
HWR_FreeTextureCache();
gr_numtextures = pnumtextures;
#ifdef GLENCORE
gr_textures = calloc(pnumtextures, sizeof (*gr_textures)*2); // *2 - 1 for encore-remapped texture and another for noencore texture (unused when not in encore)
#else
gr_textures = calloc(pnumtextures, sizeof (*gr_textures));
#endif
if (gr_textures == NULL)
I_Error("HWR_LoadTextures: ran out of memory for OpenGL textures. Sad!");
}
@@ -555,9 +560,11 @@ GLMapTexture_t *HWR_GetTexture(INT32 tex, boolean noencore)
tex = 0;
#endif
}
#ifdef GLENCORE
grtex = &gr_textures[tex*2 + (encoremap && !noencore ? 0 : 1)];
#else
grtex = &gr_textures[tex];
#endif
if (!grtex->mipmap.data && !grtex->mipmap.downloaded)
HWR_GenerateTexture(tex, grtex, noencore);
@@ -665,7 +672,7 @@ static void HWR_LoadMappedPatch(GLMipmap_t *grmip, GLPatch_t *gpatch)
{
patch_t *patch = gpatch->rawpatch;
if (!patch)
patch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC);
patch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC);
HWR_MakePatch(patch, gpatch, grmip, true);
// You can't free rawpatch for some reason?
@@ -678,7 +685,6 @@ static void HWR_LoadMappedPatch(GLMipmap_t *grmip, GLPatch_t *gpatch)
// If hardware does not have the texture, then call pfnSetTexture to upload it
if (!grmip->downloaded)
HWD.pfnSetTexture(grmip);
HWR_SetCurrentTexture(grmip);
// The system-memory data can be purged now.
@@ -709,7 +715,6 @@ void HWR_GetPatch(GLPatch_t *gpatch)
// If hardware does not have the texture, then call pfnSetTexture to upload it
if (!gpatch->mipmap->downloaded)
HWD.pfnSetTexture(gpatch->mipmap);
HWR_SetCurrentTexture(gpatch->mipmap);
// The system-memory patch data can be purged now.
+11 -1
View File
@@ -253,7 +253,17 @@ enum ETextureFlags
TF_TRANSPARENT = 0x00000040, // texture with some alpha == 0
};
typedef struct GLMipmap_s FTextureInfo;
struct FTextureInfo
{
UINT32 width, height;
UINT32 downloaded;
UINT32 format;
struct GLMipmap_s *texture;
struct FTextureInfo *prev, *next;
};
typedef struct FTextureInfo FTextureInfo;
struct FLightInfo
{
+4 -2
View File
@@ -36,8 +36,9 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI
EXPORT void HWRAPI(DrawIndexedTriangles) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, unsigned int *IndexArray);
EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FBOOLEAN StencilMask, FRGBAFloat *ClearColor);
EXPORT void HWRAPI(SetTexture) (FTextureInfo *TexInfo);
EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *TexInfo);
EXPORT void HWRAPI(SetTexture) (GLMipmap_t *TexInfo);
EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *TexInfo);
EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *TexInfo);
EXPORT void HWRAPI(ReadScreenTexture) (int tex, UINT16 *dst_data);
EXPORT void HWRAPI(GClipRect) (INT32 minx, INT32 miny, INT32 maxx, INT32 maxy, float nearclip, float farclip);
EXPORT void HWRAPI(ClearMipMapCache) (void);
@@ -99,6 +100,7 @@ struct hwdriver_s
ClearBuffer pfnClearBuffer;
SetTexture pfnSetTexture;
UpdateTexture pfnUpdateTexture;
DeleteTexture pfnDeleteTexture;
ReadScreenTexture pfnReadScreenTexture;
GClipRect pfnGClipRect;
ClearMipMapCache pfnClearMipMapCache;
-1
View File
@@ -4947,7 +4947,6 @@ void HWR_ProjectSprite(mobj_t *thing)
spritexscale = FIXED_TO_FLOAT(interp.spritexscale);
spriteyscale = FIXED_TO_FLOAT(interp.spriteyscale);
// transform the origin point
tr_x = FIXED_TO_FLOAT(interp.x) - gr_viewx;
tr_y = FIXED_TO_FLOAT(interp.y) - gr_viewy;
-2
View File
@@ -17,8 +17,6 @@
/// \file
/// \brief 3D render mode functions
#define GLENCORE
#ifndef __HWR_MAIN_H__
#define __HWR_MAIN_H__
+96 -90
View File
@@ -79,8 +79,9 @@ static GLuint lt_downloaded = 0; // currently bound lighttable texture
static GLfloat fov = 90.0f;
static FBITFIELD CurrentPolyFlags;
static FTextureInfo *gr_cachetail = NULL;
static FTextureInfo *gr_cachehead = NULL;
// Linked list of all textures.
static FTextureInfo *TexCacheTail = NULL;
static FTextureInfo *TexCacheHead = NULL;
static RGBA_t *textureBuffer = NULL;
static size_t textureBufferSize = 0;
@@ -103,12 +104,16 @@ static GLboolean MipMap = GL_FALSE;
static GLint min_filter = GL_LINEAR;
static GLint mag_filter = GL_LINEAR;
static GLint anisotropic_filter = 0;
boolean supportMipMap = false;
static FTransform md2_transform;
const GLubyte *gl_version = NULL;
const GLubyte *gl_renderer = NULL;
const GLubyte *gl_extensions = NULL;
// Loaded OpenGL version
int majorGL = 0, minorGL = 0;
//Hurdler: 04/10/2000: added for the kick ass coronas as Boris wanted;-)
static GLfloat modelMatrix[16];
GLfloat projMatrix[16];
@@ -157,9 +162,6 @@ static const GLfloat byte2float[256] = {
0.972549f, 0.976471f, 0.980392f, 0.984314f, 0.988235f, 0.992157f, 0.996078f, 1.000000f
};
// Loaded OpenGL version
static int majorGL = 0, minorGL = 0;
// -----------------+
// GL_DBG_Printf : Output debug messages to debug log if DEBUG_TO_FILE is defined,
// : else do nothing
@@ -428,12 +430,6 @@ typedef void (APIENTRY * PFNglCopyTexSubImage2D) (GLenum target, GLint level, GL
static PFNglCopyTexSubImage2D pglCopyTexSubImage2D;
#endif
/* 3.0 functions */
#ifdef GL_VERSION_3_0
typedef void (APIENTRY * PFNglGenerateMipmap) (GLenum target);
static PFNglGenerateMipmap pglGenerateMipmap;
#endif
/* 1.2 functions for 3D textures */
typedef void (APIENTRY * PFNglTexImage3D) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
static PFNglTexImage3D pglTexImage3D;
@@ -716,10 +712,6 @@ void SetupGLFunc4(void)
pglUniform2fv = GetGLFunc("glUniform2fv");
pglUniform3fv = GetGLFunc("glUniform3fv");
pglGetUniformLocation = GetGLFunc("glGetUniformLocation");
#ifdef GL_VERSION_3_0
pglGenerateMipmap = GetGLFunc("glGenerateMipmap");
#endif
}
EXPORT boolean HWRAPI(InitShaders) (void)
@@ -935,7 +927,7 @@ void SetStates(void)
pglEnable(GL_STENCIL_TEST);
pglEnable(GL_DEPTH_TEST); // check the depth buffer
pglDepthMask(GL_TRUE); // enable writing to depth buffer
pglDepthMask(GL_TRUE); // enable writing to depth buffer
pglClearDepth(1.0f);
pglDepthRange(0.0f, 1.0f);
pglDepthFunc(GL_LEQUAL);
@@ -954,6 +946,40 @@ void SetStates(void)
pglScalef(1.0f, 1.0f, -1.0f);
pglGetFloatv(GL_MODELVIEW_MATRIX, modelMatrix); // added for new coronas' code (without depth buffer)
}
// -----------------+
// DeleteTexture : Deletes a texture from the GPU and frees its data
// -----------------+
EXPORT void HWRAPI(DeleteTexture) (GLMipmap_t *pTexInfo)
{
FTextureInfo *head = TexCacheHead;
if (!pTexInfo)
return;
else if (pTexInfo->downloaded)
pglDeleteTextures(1, (GLuint *)&pTexInfo->downloaded);
while (head)
{
if (head->downloaded == pTexInfo->downloaded)
{
if (head->next)
head->next->prev = head->prev;
else // no next -> tail is being deleted -> update TexCacheTail
TexCacheTail = head->prev;
if (head->prev)
head->prev->next = head->next;
else // no prev -> head is being deleted -> update TexCacheHead
TexCacheHead = head->next;
free(head);
break;
}
head = head->next;
}
pTexInfo->downloaded = 0;
}
// -----------------+
// Flush : flush OpenGL textures
@@ -961,21 +987,29 @@ void SetStates(void)
// -----------------+
void Flush(void)
{
//GL_DBG_Printf("HWR_Flush()\n");
//GL_DBG_Printf ("HWR_Flush()\n");
while (gr_cachehead)
while (TexCacheHead)
{
// this is not necessary at all, because you have loaded them normally,
// and so they already are in your list!
if (gr_cachehead->downloaded)
pglDeleteTextures(1, (GLuint *)&gr_cachehead->downloaded);
gr_cachehead->downloaded = 0;
gr_cachehead = gr_cachehead->nextmipmap;
}
gr_cachetail = gr_cachehead = NULL; //Hurdler: well, gr_cachehead is already NULL
FTextureInfo *pTexInfo = TexCacheHead;
GLMipmap_t *texture = pTexInfo->texture;
if (pTexInfo->downloaded)
{
pglDeleteTextures(1, (GLuint *)&pTexInfo->downloaded);
pTexInfo->downloaded = 0;
}
if (texture)
texture->downloaded = 0;
TexCacheHead = pTexInfo->next;
free(pTexInfo);
}
TexCacheTail = TexCacheHead = NULL; //Hurdler: well, TexCacheHead is already NULL
tex_downloaded = 0;
free(textureBuffer);
textureBuffer = NULL;
textureBufferSize = 0;
@@ -1334,7 +1368,7 @@ static void AllocTextureBuffer(GLMipmap_t *pTexInfo)
// -----------------+
// UpdateTexture : Updates texture data.
// -----------------+
EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *pTexInfo)
EXPORT void HWRAPI(UpdateTexture) (GLMipmap_t *pTexInfo)
{
// Upload a texture
GLuint num = pTexInfo->downloaded;
@@ -1391,7 +1425,6 @@ EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *pTexInfo)
tex[w*j+i].s.alpha = *pImgData;
pImgData++;
}
}
}
}
@@ -1458,23 +1491,14 @@ EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *pTexInfo)
//pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
if (MipMap)
{
if ((majorGL == 1 && minorGL >= 4) || (majorGL == 2))
{
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
pglTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
}
#ifdef GL_VERSION_3_0
else if (majorGL >= 3)
{
pglTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglGenerateMipmap(GL_TEXTURE_2D);
}
#endif
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
pglTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
if (pTexInfo->flags & TF_TRANSPARENT)
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
else
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 16);
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
//pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_LINEAR_MIPMAP_LINEAR);
}
else
@@ -1490,23 +1514,14 @@ EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *pTexInfo)
//pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
if (MipMap)
{
if ((majorGL == 1 && minorGL >= 4) || (majorGL == 2))
{
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
}
#ifdef GL_VERSION_3_0
else if (majorGL >= 3)
{
pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglGenerateMipmap(GL_TEXTURE_2D);
}
#endif
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0);
if (pTexInfo->flags & TF_TRANSPARENT)
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
else
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 16);
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
//pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_LINEAR_MIPMAP_LINEAR);
}
else
@@ -1521,24 +1536,15 @@ EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *pTexInfo)
{
if (MipMap)
{
if ((majorGL == 1 && minorGL >= 4) || (majorGL == 2))
{
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
pglTexImage2D(GL_TEXTURE_2D, 0, textureformatGL, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
}
#ifdef GL_VERSION_3_0
else if (majorGL >= 3)
{
pglTexImage2D(GL_TEXTURE_2D, 0, textureformatGL, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
pglGenerateMipmap(GL_TEXTURE_2D);
}
#endif
pglTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
pglTexImage2D(GL_TEXTURE_2D, 0, textureformatGL, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex);
// Control the mipmap level of detail
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0); // the lower the number, the higer the detail
if (pTexInfo->flags & TF_TRANSPARENT)
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff
else
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 16);
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 5);
}
else
{
@@ -1567,7 +1573,7 @@ EXPORT void HWRAPI(UpdateTexture) (FTextureInfo *pTexInfo)
// -----------------+
// SetTexture : The mipmap becomes the current texture source
// -----------------+
EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
EXPORT void HWRAPI(SetTexture) (GLMipmap_t *pTexInfo)
{
if (!pTexInfo)
{
@@ -1584,15 +1590,25 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
}
else
{
FTextureInfo *newTex = calloc(1, sizeof (*newTex));
UpdateTexture(pTexInfo);
pTexInfo->nextmipmap = NULL;
if (gr_cachetail)
{ // insertion at the tail
gr_cachetail->nextmipmap = pTexInfo;
gr_cachetail = pTexInfo;
newTex->texture = pTexInfo;
newTex->downloaded = (UINT32)pTexInfo->downloaded;
newTex->width = (UINT32)pTexInfo->width;
newTex->height = (UINT32)pTexInfo->height;
newTex->format = (UINT32)pTexInfo->format;
// insertion at the tail
if (TexCacheTail)
{
newTex->prev = TexCacheTail;
TexCacheTail->next = newTex;
TexCacheTail = newTex;
}
else // initialization of the linked list
gr_cachetail = gr_cachehead = pTexInfo;
TexCacheTail = TexCacheHead = newTex;
}
}
@@ -2176,22 +2192,12 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
mag_filter = GL_LINEAR;
min_filter = GL_NEAREST;
}
if (majorGL == 1 && minorGL <= 3)
if (!supportMipMap)
{
MipMap = GL_FALSE;
min_filter = GL_LINEAR;
}
#ifdef GL_VERSION_3_0
else
{
if (!pglGenerateMipmap)
{
MipMap = GL_FALSE;
min_filter = GL_LINEAR;
}
}
#endif
Flush(); //??? if we want to change filter mode by texture, remove this
break;
@@ -2772,7 +2778,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
// https://zdoom.org/wiki/Y-shearing
if (shearing)
{
float dy = FIXED_TO_FLOAT(AIMINGTODY(stransform->viewaiming)) * 2; //screen_width/BASEVIDWIDTH;
float dy = FIXED_TO_FLOAT(AIMINGTODY((stransform->viewaiming)) * 2)* ((float)vid.width / vid.height) / ((float)BASEVIDWIDTH / BASEVIDHEIGHT); //screen_width/BASEVIDWIDTH;
if (stransform->flip)
dy *= -1.0f;
pglTranslatef(0.0f, -dy/BASEVIDHEIGHT, 0.0f);
@@ -2794,7 +2800,7 @@ EXPORT void HWRAPI(SetTransform) (FTransform *stransform)
EXPORT INT32 HWRAPI(GetTextureUsed) (void)
{
FTextureInfo *tmp = gr_cachehead;
FTextureInfo *tmp = TexCacheHead;
INT32 res = 0;
while (tmp)
@@ -2811,7 +2817,7 @@ EXPORT INT32 HWRAPI(GetTextureUsed) (void)
// Add it up!
res += tmp->height*tmp->width*bpp;
tmp = tmp->nextmipmap;
tmp = tmp->next;
}
return res;
+3
View File
@@ -112,11 +112,14 @@ extern const GLubyte *gl_version;
extern const GLubyte *gl_renderer;
extern const GLubyte *gl_extensions;
extern int majorGL, minorGL;
extern RGBA_t myPaletteData[];
extern GLint screen_width;
extern GLint screen_height;
extern GLbyte screen_depth;
extern GLint maximumAnisotropy;
extern boolean supportMipMap;
/** \brief OpenGL flags for video driver
*/
+107 -1
View File
@@ -174,6 +174,107 @@ char english_shiftxform[] =
'{', '|', '}', '~', 127
};
char french_shiftxform[] =
{
0,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31,
' ','$', //shift-!
'3', //shift-"
'#', '$', '%',
'1', //shift-&
'4', // shift-'
'5', // shift-(
')', // shift-)
'*', '+',
'?', // shift-,
'6', // shift--
'.', '/',
'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9',
'/', // shitf-:
'.', // shift-;
'>', // shift-<
'+', // shift-=
'>', '?', '@',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'[', '\\', ']', '^',
'8', //shift-_
'`',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'{', '|', '}', '~', 127,
128, 129,
'2',
131, 132,
'0',
134,
'9',
136, 137,
'7',
139, 140,
'%'
};
char french_altgrxform[] =
{
0,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31,
' ', '!',
'#', //altgr-"
'#', '$', '%', '&',
'{', //altgr-'
'[', //altgr-(
']', //altgr-)
'*', '+', ',',
'|', //altg--
'.', '/',
'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9',
':', ';', '<',
'}', //altgr-=
'>', '?', '@',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'[', '\\', ']', '^',
'\\', //altgr-backslash
'`',
'a', 'b', 'c', 'd', 'E', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'{', '|', '}', '~', 127,
128, 129,
'~',
131, 132,
'@',
134,
'^',
136, 137,
'`',
139, 140,
KEY_FR_U_GRAVE
};
//fallback for special letter non displayable in the game (i.e.: 'é','à',etc.)
INT32 HU_FallBackFrSpecialLetter(INT32 key)
{
switch(key){
case KEY_FR_E_AIGUE: return 'e';
case KEY_FR_E_GRAVE: return 'e';
case KEY_FR_C_CEDILLE: return 'c';
case KEY_FR_A_GRAVE: return 'a';
case KEY_FR_U_GRAVE: return 'u';
default: return key;
}
}
static char cechotext[1024];
static tic_t cechotimer = 0;
static tic_t cechoduration = 5*TICRATE;
@@ -371,6 +472,11 @@ void HU_Start(void)
headsupactive = true;
}
void HU_Shiftform(void)
{
shiftxform = cv_keyboardlayout.value == 3 ? french_shiftxform : english_shiftxform;
}
//======================================================================
// EXECUTION
//======================================================================
@@ -1378,7 +1484,7 @@ boolean HU_Responder(event_t *ev)
&& ev->data1 != gamecontrol[gc_talkkey][1]))
return false;
c = CON_ShiftChar(c);
c = cv_keyboardlayout.value == 3 ? CON_ShitAndAltGrChar(c) : CON_ShiftChar(c);
// pasting. pasting is cool. chat is a bit limited, though :(
if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE)
+8
View File
@@ -47,6 +47,12 @@
extern char *shiftxform; // english translation shift table
extern char english_shiftxform[];
extern char french_shiftxform[];
extern char french_altgrxform[];
//fallback for special letter non displayable in the game (i.e.: 'é','à',etc.)
INT32 HU_FallBackFrSpecialLetter(INT32 key);
//------------------------------------
// sorted player lines
//------------------------------------
@@ -109,6 +115,8 @@ void HU_LoadGraphics(void);
// reset heads up when consoleplayer respawns.
void HU_Start(void);
void HU_Shiftform(void);
boolean HU_Responder(event_t *ev);
void HU_Ticker(void);
void HU_TickSongCredits(void);
+9 -1
View File
@@ -15,7 +15,7 @@
#include "console.h"
extern consvar_t cv_nativekeyboard;
extern consvar_t cv_keyboardlayout;
// These are the key codes as posted by the keyboard handler,
// ascii codes are 0->127,
@@ -30,6 +30,14 @@ extern consvar_t cv_nativekeyboard;
#define KEY_MINUS 45
#define KEY_EQUALS 61
//azerty special keys support
//(necessary for being able to print 'regular' chars in azerty)
#define KEY_FR_E_AIGUE (0x80+2)
#define KEY_FR_E_GRAVE (0x80+10)
#define KEY_FR_C_CEDILLE (0x80+7)
#define KEY_FR_A_GRAVE (0x80+5)
#define KEY_FR_U_GRAVE (0x80+13)
#define KEY_NUMLOCK (0x80+69)
#define KEY_SCROLLLOCK (0x80+70)
+71 -11
View File
@@ -2011,7 +2011,7 @@ static menuitem_t OP_SaturnMenu[] =
{IT_STRING | IT_CVAR, NULL, "Show Localskin Menus", &cv_showlocalskinmenus, 90},
{IT_STRING | IT_CVAR, NULL, "Uppercase Menu", &cv_menucaps, 95},
{IT_STRING | IT_CVAR, NULL, "Native Keyboard Layout", &cv_nativekeyboard, 105},
{IT_STRING | IT_CVAR, NULL, "Keyboard Layout", &cv_keyboardlayout, 105},
{IT_STRING | IT_CVAR, NULL, "Less Midnight Channel Flicker", &cv_lessflicker, 115},
@@ -2043,7 +2043,7 @@ static const char* OP_SaturnTooltips[] =
"Show the big Cecho Messages.",
"Show Localskin Menus.",
"Force menu to only use uppercase.",
"Use your native Keyboard Layout for Text Input\nThis does not affect gameplay!.",
"Use your desired Keyboard Layout for Text Input\nthis is either the Default, Native or Azerty\nNative does not affect Gameplay only Text!",
"Disables the flicker effect on Midnight Channel.",
"Nametag Options.",
"Driftgauge Options.",
@@ -3300,8 +3300,23 @@ static boolean M_ChangeStringCvar(INT32 choice)
char buf[MAXSTRINGLENGTH];
size_t len;
if (shiftdown && choice >= 32 && choice <= 127)
choice = shiftxform[choice];
if (cv_keyboardlayout.value == 3)
{
if (choice >= 32 && choice <= 141)
{
if (shiftdown)
choice = shiftxform[choice];
else if (altdown & 0x2)
choice = french_altgrxform[choice];
else
choice = HU_FallBackFrSpecialLetter(choice);
}
}
else
{
if (shiftdown && choice >= 32 && choice <= 127)
choice = shiftxform[choice];
}
switch (choice)
{
@@ -3323,7 +3338,7 @@ static boolean M_ChangeStringCvar(INT32 choice)
}
return true;
default:
if (choice >= 32 && choice <= 127)
if ((cv_keyboardlayout.value != 3 && choice >= 32 && choice <= 127) || (cv_keyboardlayout.value == 3 && choice >= 32 && choice <= 141))
{
len = strlen(cv->string);
if (len < MAXSTRINGLENGTH - 1)
@@ -3648,8 +3663,23 @@ boolean M_Responder(event_t *ev)
if (routine && (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_KEYHANDLER)
{
menu_text_input = true;
if (shiftdown && ch >= 32 && ch <= 127)
ch = shiftxform[ch];
if (cv_keyboardlayout.value == 3)
{
if(ch >= 32 && ch <= 141)
{
if (shiftdown)
ch = shiftxform[ch];
else if (altdown & 0x2)
ch = french_altgrxform[ch];
else
ch = HU_FallBackFrSpecialLetter(ch);
}
}
else
{
if (shiftdown && ch >= 32 && ch <= 127)
ch = shiftxform[ch];
}
routine(ch);
return true;
}
@@ -3689,8 +3719,23 @@ boolean M_Responder(event_t *ev)
if ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING)
{
menu_text_input = true;
if (shiftdown && ch >= 32 && ch <= 127)
ch = shiftxform[ch];
if (cv_keyboardlayout.value == 3)
{
if(ch >= 32 && ch <= 141)
{
if (shiftdown)
ch = shiftxform[ch];
else if (altdown & 0x2)
ch = french_altgrxform[ch];
else
ch = HU_FallBackFrSpecialLetter(ch);
}
}
else
{
if (shiftdown && ch >= 32 && ch <= 127)
ch = shiftxform[ch];
}
if (M_ChangeStringCvar(ch))
return true;
else
@@ -6385,8 +6430,23 @@ static void M_AddonAutoLoad(INT32 ch)
#define len menusearch[0]
static boolean M_ChangeStringAddons(INT32 choice)
{
if (shiftdown && choice >= 32 && choice <= 127)
choice = shiftxform[choice];
if (cv_keyboardlayout.value == 3)
{
if(choice >= 32 && choice <= 141)
{
if(shiftdown)
choice = shiftxform[choice];
else if(altdown & 0x2)
choice = french_altgrxform[choice];
else
choice = HU_FallBackFrSpecialLetter(choice);
}
}
else
{
if (shiftdown && choice >= 32 && choice <= 127)
choice = shiftxform[choice];
}
switch (choice)
{
+1
View File
@@ -156,6 +156,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam);
void P_SlideCameraMove(camera_t *thiscam);
void P_DemoCameraMovement(camera_t *cam);
boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled);
void P_ResetLocalCamAiming(player_t *player);
void P_InitCameraCmd(void);
boolean P_PlayerInPain(player_t *player);
void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor);
+17 -7
View File
@@ -3968,6 +3968,18 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
return (x == thiscam->x && y == thiscam->y && z == thiscam->z && angle == thiscam->aiming);
}
void P_ResetLocalCamAiming(player_t *player)
{
for (int i = 0; i <= splitscreen; i++)
{
UINT8 id = (i == 0) ? consoleplayer : displayplayers[i];
if (player - players == id)
{
localaiming[i] = 0;
}
}
}
boolean P_SpectatorJoinGame(player_t *player)
{
// Team changing isn't allowed.
@@ -4017,10 +4029,9 @@ boolean P_SpectatorJoinGame(player_t *player)
player->kartstuff[k_spectatewait] = 0;
player->ctfteam = changeto;
player->playerstate = PST_REBORN;
//center camera if its not already
if ((P_IsLocalPlayer(player)) && localaiming[0] != 0)
localaiming[0] = 0;
//center camera
P_ResetLocalCamAiming(player);
//Reset away view
if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer)
@@ -4046,9 +4057,8 @@ boolean P_SpectatorJoinGame(player_t *player)
player->kartstuff[k_spectatewait] = 0;
player->playerstate = PST_REBORN;
//center camera if its not already
if ((P_IsLocalPlayer(player)) && localaiming[0] != 0)
localaiming[0] = 0;
//center camera
P_ResetLocalCamAiming(player);
//Reset away view
if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer)
+4 -14
View File
@@ -639,6 +639,10 @@ typedef struct
// textures from the TEXTURE1 list of patches.
//
// WARNING: this structure is cloned in GLPatch_t
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
INT16 width; // bounding box size
@@ -656,20 +660,6 @@ typedef struct
#endif
} patch_t;
#if defined(_MSC_VER)
#pragma pack(1)
#endif
typedef struct
{
INT16 width; // bounding box size
INT16 height;
INT16 leftoffset; // pixels to the left of origin
INT16 topoffset; // pixels below the origin
INT32 columnofs[8]; // only [width] used
// the [0] is &columnofs[width]
} ATTRPACK softwarepatch_t;
#ifdef _MSC_VER
#pragma warning(disable : 4200)
#endif
+2 -1
View File
@@ -74,7 +74,8 @@ consvar_t cv_highreshudscale = {"highreshudscale", "1", CV_SAVE|CV_FLOAT|CV_CALL
static void Highreshudscale_OnChange(void)
{
SCR_Recalc();
if (!con_startup)
SCR_Recalc();
}
static void SCR_ChangeFullscreen (void);
+1
View File
@@ -86,6 +86,7 @@ void *hwSym(const char *funcName,void *handle)
GETFUNC(ClearBuffer);
GETFUNC(SetTexture);
GETFUNC(UpdateTexture);
GETFUNC(DeleteTexture);
GETFUNC(ReadScreenTexture);
GETFUNC(GClipRect);
GETFUNC(ClearMipMapCache);
+88 -2
View File
@@ -111,7 +111,14 @@ boolean a2c = false;
#endif
boolean highcolor = false;
consvar_t cv_nativekeyboard = {"nativekeyboard", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static void KeyboardLayout_OnChange(void)
{
HU_Shiftform();
}
static CV_PossibleValue_t keyboardlayout_cons_t[] = {{1,"Default US"}, {2, "Native"}, {3, "AZERTY"}, {0, NULL}};
consvar_t cv_keyboardlayout = {"keyboardlayout", "Default US", CV_SAVE|CV_CALL, keyboardlayout_cons_t, KeyboardLayout_OnChange, 0, NULL, NULL, 0, 0, NULL};
static void Impl_SetVsync(void);
@@ -528,6 +535,82 @@ static INT32 GetTypedChar(SDL_Scancode code, SDL_Keysym *sym)
return 0;
}
static INT32 Impl_SDL_Keysym_To_Keycode_FR(SDL_Keysym keysym)
{
SDL_Keycode keycode= keysym.sym;
SDL_Scancode scancode= keysym.scancode;
if (keycode >= SDLK_a && keycode <= SDLK_z){
// get lowercase ASCII
return keycode;
}
if (keycode >= SDLK_F1 && keycode <= SDLK_F10)
{
return KEY_F1 + (keycode - SDLK_F1);
}
if(scancode == SDL_SCANCODE_APOSTROPHE){
return KEY_FR_U_GRAVE;
}
switch(scancode){
case SDL_SCANCODE_APOSTROPHE: return KEY_FR_U_GRAVE;
case SDL_SCANCODE_LEFTBRACKET: return '^';
default: break;
}
switch (keycode)
{
// F11 and F12 are separated from the rest of the function keys
case SDLK_F11: return KEY_F11;
case SDLK_F12: return KEY_F12;
case SDLK_RETURN: return KEY_ENTER;
case SDLK_ESCAPE: return KEY_ESCAPE;
case SDLK_BACKSPACE: return KEY_BACKSPACE;
case SDLK_TAB: return KEY_TAB;
case SDLK_SPACE: return KEY_SPACE;
case SDLK_EQUALS: return KEY_EQUALS;
case SDLK_SEMICOLON: return ';';
case SDLK_COMMA: return ',';
case SDLK_COLON: return ':';
case SDLK_EXCLAIM: return '!';
case SDLK_DOLLAR: return '$';
case SDLK_ASTERISK: return '*';
case SDLK_PERCENT: return '%';
case SDLK_0: return KEY_FR_A_GRAVE;
case SDLK_1:
case SDLK_AMPERSAND: return '&';
case SDLK_2: return KEY_FR_E_AIGUE;
case SDLK_3:
case SDLK_QUOTEDBL: return '"';
case SDLK_4: return '\'';
case SDLK_5:
case SDLK_LEFTPAREN: return '(';
case SDLK_6:
case SDLK_MINUS: return KEY_MINUS;
case SDLK_7: return KEY_FR_E_GRAVE;
case SDLK_8:
case SDLK_UNDERSCORE: return '_';
case SDLK_9: return KEY_FR_C_CEDILLE;
case SDLK_RIGHTPAREN: return ')';
case SDLK_SLASH: return '/';
case SDLK_LESS: return '<';
case SDLK_KP_0: return KEY_KEYPAD0;
case SDLK_KP_1: return KEY_KEYPAD1;
case SDLK_KP_2: return KEY_KEYPAD2;
case SDLK_KP_3: return KEY_KEYPAD3;
case SDLK_KP_4: return KEY_KEYPAD4;
case SDLK_KP_5: return KEY_KEYPAD5;
case SDLK_KP_6: return KEY_KEYPAD6;
case SDLK_KP_7: return KEY_KEYPAD7;
case SDLK_KP_8: return KEY_KEYPAD8;
case SDLK_KP_9: return KEY_KEYPAD9;
default: break;
}
return Impl_SDL_Scancode_To_Keycode(scancode);
}
static void SDLdoGrabMouse(void)
{
SDL_ShowCursor(SDL_DISABLE);
@@ -843,8 +926,10 @@ static void Impl_HandleKeyboardEvent(SDL_KeyboardEvent evt, Uint32 type)
return;
}
if (cv_nativekeyboard.value && (chat_on || CON_Ready() || (menu_text_input && menuactive))) //only use this this if on chat or console or the current menu wants inputs from us (except if its the control setup menu ig)
if (cv_keyboardlayout.value == 2 && (chat_on || CON_Ready() || (menu_text_input && menuactive))) //only use this this if on chat or console or the current menu wants inputs from us (except if its the control setup menu ig)
event.data1 = GetTypedChar(evt.keysym.scancode, &evt.keysym);
else if (cv_keyboardlayout.value == 3)
event.data1 = Impl_SDL_Keysym_To_Keycode_FR(evt.keysym);
else
event.data1 = Impl_SDL_Scancode_To_Keycode(evt.keysym.scancode);
@@ -2268,6 +2353,7 @@ void I_StartupGraphics(void)
HWD.pfnClearBuffer = hwSym("ClearBuffer",NULL);
HWD.pfnSetTexture = hwSym("SetTexture",NULL);
HWD.pfnUpdateTexture = hwSym("UpdateTexture",NULL);
HWD.pfnDeleteTexture = hwSym("DeleteTexture",NULL);
HWD.pfnReadScreenTexture= hwSym("ReadScreenTexture",NULL);
HWD.pfnGClipRect = hwSym("GClipRect",NULL);
HWD.pfnClearMipMapCache = hwSym("ClearMipMapCache",NULL);
+5
View File
@@ -161,6 +161,11 @@ boolean OglSdlSurface(INT32 w, INT32 h)
SetupGLFunc4();
if (majorGL == 1 && minorGL <= 3) // GL_GENERATE_MIPMAP is unavailible for OGL 1.3 and below
supportMipMap = false;
else
supportMipMap = true;
granisotropicmode_cons_t[1].value = maximumAnisotropy;
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);