Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2214-pre1
  • 2214-pre2
  • 2214-pre3
  • 2214-pre4
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-167
  • fix-cvar-conflicts
  • fix-opengl-parameter-crash
  • fix-opengl-shear-roll
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • just-in-case
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-gfx-2
  • lua-gfx-sprites
  • lua-local
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • map-components-signedness-fixes
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.15
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
142 results

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
117 results
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 622-teamlives-hud
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • add-arg-passing-alias
  • add-forth-interpreter
  • add-ipv6-indicator
  • add-namechange-lua-hook
  • add-server-pm-logging
  • add-textinput-hook
  • add-unblockable-console-key
  • alien-breed-3d
  • allow-non-important-files-dedicated
  • allow-percent-ipv6-address
  • appveyor
  • avoid-double-checkmobjtrigger-call
  • avoid-frame-cap-busywait
  • bbox
  • bbox-tweaks
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • botchanges
  • bustablemobjzfix
  • bustablesoundz
  • checksector-refactor
  • cleanup-opengl
  • cleanupmusic
  • close-connection-timeout
  • cmake-clang-tidy
  • cmake-enable-cxx
  • cmake-valgrind
  • compile-ffast-math
  • crawlacommander-sprites
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • deprecate-lua-dedicated-server
  • doomcom-global-refactor
  • dpl-2
  • dropshadows-spawning
  • emblem-drawing
  • ensure-ackpak-response
  • exchndl-xp-fix
  • few-kart-lua-changes
  • ffloorclip
  • fix-acknum-not-incrementing
  • fix-bot-2pai-desync
  • fix-compiler-error-touch
  • fix-cvar-conflicts
  • fix-dedicated-segfault
  • fix-move-mobj-reference
  • fix-netxcmd-integer-overflow
  • fix-opengl-shear-roll
  • fix-removemobj-seesound
  • fix-silver-segfault
  • fix-tty-not-resetting-properly
  • fix-unack-lockup
  • fixithreads
  • flipfuncpointers
  • floorsprite-and-shadow-fake-planes-fix
  • fof-lightlist-fixes
  • font-FUCK
  • font_drawer
  • forceverticalflipflag
  • forkmaster
  • frictionrefactor
  • fuck-macros-1
  • fullscreen-toggle
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • ghost-networking
  • gif-splitting
  • gitlab-ci
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-packet-tics
  • increase-unlockables
  • inline-mobjwasremoved
  • input-display
  • input-display-translucency
  • io
  • io-limit
  • ipv6
  • joystick-juggling-maz
  • keycodes-only
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
138 results
Show changes
...@@ -20,6 +20,10 @@ enum hud { ...@@ -20,6 +20,10 @@ enum hud {
hud_textspectator, hud_textspectator,
hud_crosshair, hud_crosshair,
hud_powerups, hud_powerups,
hud_gameover,
hud_pause,
hud_cecho,
hud_chat,
// Singleplayer / Co-op // Singleplayer / Co-op
hud_score, hud_score,
hud_time, hud_time,
...@@ -30,6 +34,7 @@ enum hud { ...@@ -30,6 +34,7 @@ enum hud {
hud_weaponrings, hud_weaponrings,
hud_powerstones, hud_powerstones,
hud_teamscores, hud_teamscores,
hud_itemhunt,
// NiGHTS mode // NiGHTS mode
hud_nightslink, hud_nightslink,
hud_nightsdrill, hud_nightsdrill,
......
...@@ -42,6 +42,10 @@ static const char *const hud_disable_options[] = { ...@@ -42,6 +42,10 @@ static const char *const hud_disable_options[] = {
"textspectator", "textspectator",
"crosshair", "crosshair",
"powerups", "powerups",
"gameover",
"pause",
"cecho",
"chat",
"score", "score",
"time", "time",
...@@ -52,6 +56,7 @@ static const char *const hud_disable_options[] = { ...@@ -52,6 +56,7 @@ static const char *const hud_disable_options[] = {
"weaponrings", "weaponrings",
"powerstones", "powerstones",
"teamscores", "teamscores",
"itemhunt",
"nightslink", "nightslink",
"nightsdrill", "nightsdrill",
...@@ -461,15 +466,29 @@ static int camera_set(lua_State *L) ...@@ -461,15 +466,29 @@ static int camera_set(lua_State *L)
static int libd_patchExists(lua_State *L) static int libd_patchExists(lua_State *L)
{ {
HUDONLY
lua_pushboolean(L, W_LumpExists(luaL_checkstring(L, 1))); lua_pushboolean(L, W_LumpExists(luaL_checkstring(L, 1)));
return 1; return 1;
} }
static int libd_cachePatch(lua_State *L) static int libd_cachePatch(lua_State *L)
{ {
HUDONLY const char *name = luaL_checkstring(L, 1);
LUA_PushUserdata(L, W_CachePatchLongName(luaL_checkstring(L, 1), PU_PATCH), META_PATCH); patch_t *patch = W_CachePatchLongName(name, PU_PATCH);
#ifdef ROTSPRITE
if (lua_isnumber(L, 2))
{
angle_t rollangle = luaL_checkangle(L, 2);
INT32 rot = R_GetRollAngle(rollangle);
if (rot) {
patch_t *rotpatch = Patch_GetRotated(patch, rot, false);
LUA_PushUserdata(L, rotpatch, META_PATCH);
return 1;
}
}
#endif
LUA_PushUserdata(L, patch, META_PATCH);
return 1; return 1;
} }
...@@ -481,7 +500,6 @@ static int libd_getSpritePatch(lua_State *L) ...@@ -481,7 +500,6 @@ static int libd_getSpritePatch(lua_State *L)
UINT8 angle = 0; UINT8 angle = 0;
spritedef_t *sprdef; spritedef_t *sprdef;
spriteframe_t *sprframe; spriteframe_t *sprframe;
HUDONLY
if (lua_isnumber(L, 1)) // sprite number given, e.g. SPR_THOK if (lua_isnumber(L, 1)) // sprite number given, e.g. SPR_THOK
{ {
...@@ -555,7 +573,6 @@ static int libd_getSprite2Patch(lua_State *L) ...@@ -555,7 +573,6 @@ static int libd_getSprite2Patch(lua_State *L)
spritedef_t *sprdef; spritedef_t *sprdef;
spriteframe_t *sprframe; spriteframe_t *sprframe;
boolean super = false; // add SPR2F_SUPER to sprite2 if true boolean super = false; // add SPR2F_SUPER to sprite2 if true
HUDONLY
// get skin first! // get skin first!
if (lua_isnumber(L, 1)) // find skin by number if (lua_isnumber(L, 1)) // find skin by number
...@@ -875,6 +892,28 @@ static int libd_drawFill(lua_State *L) ...@@ -875,6 +892,28 @@ static int libd_drawFill(lua_State *L)
return 0; return 0;
} }
static int libd_drawFixedFill(lua_State *L)
{
huddrawlist_h list;
INT32 x = luaL_optinteger(L, 1, 0);
INT32 y = luaL_optinteger(L, 2, 0);
INT32 w = luaL_optinteger(L, 3, BASEVIDWIDTH << FRACBITS);
INT32 h = luaL_optinteger(L, 4, BASEVIDHEIGHT << FRACBITS);
INT32 c = luaL_optinteger(L, 5, 31);
HUDONLY
lua_getfield(L, LUA_REGISTRYINDEX, "HUD_DRAW_LIST");
list = (huddrawlist_h) lua_touserdata(L, -1);
lua_pop(L, 1);
if (LUA_HUD_IsDrawListValid(list))
LUA_HUD_AddDrawFixedFill(list, x, y, w, h, c);
else
V_DrawFixedFill(x, y, w, h, c);
return 0;
}
static int libd_drawString(lua_State *L) static int libd_drawString(lua_State *L)
{ {
huddrawlist_h list; huddrawlist_h list;
...@@ -1130,13 +1169,12 @@ static int libd_levelTitleHeight(lua_State *L) ...@@ -1130,13 +1169,12 @@ static int libd_levelTitleHeight(lua_State *L)
static int libd_getColormap(lua_State *L) static int libd_getColormap(lua_State *L)
{ {
HUDONLY
INT32 skinnum = TC_DEFAULT; INT32 skinnum = TC_DEFAULT;
skincolornum_t color = luaL_optinteger(L, 2, 0); skincolornum_t color = luaL_optinteger(L, 2, 0);
UINT8* colormap = NULL; UINT8* colormap = NULL;
int translation_id = -1; int translation_id = -1;
HUDONLY
if (lua_isnoneornil(L, 1)) if (lua_isnoneornil(L, 1))
; // defaults to TC_DEFAULT ; // defaults to TC_DEFAULT
else if (lua_type(L, 1) == LUA_TNUMBER) // skin number else if (lua_type(L, 1) == LUA_TNUMBER) // skin number
...@@ -1176,9 +1214,10 @@ static int libd_getColormap(lua_State *L) ...@@ -1176,9 +1214,10 @@ static int libd_getColormap(lua_State *L)
static int libd_getStringColormap(lua_State *L) static int libd_getStringColormap(lua_State *L)
{ {
HUDONLY
INT32 flags = luaL_checkinteger(L, 1); INT32 flags = luaL_checkinteger(L, 1);
UINT8* colormap = NULL; UINT8* colormap = NULL;
HUDONLY
colormap = V_GetStringColormap(flags & V_CHARCOLORMASK); colormap = V_GetStringColormap(flags & V_CHARCOLORMASK);
if (colormap) { if (colormap) {
LUA_PushUserdata(L, colormap, META_COLORMAP); // push as META_COLORMAP userdata, specifically for patches to use! LUA_PushUserdata(L, colormap, META_COLORMAP); // push as META_COLORMAP userdata, specifically for patches to use!
...@@ -1189,6 +1228,7 @@ static int libd_getStringColormap(lua_State *L) ...@@ -1189,6 +1228,7 @@ static int libd_getStringColormap(lua_State *L)
static int libd_getSectorColormap(lua_State *L) static int libd_getSectorColormap(lua_State *L)
{ {
HUDONLY
boolean has_sector = false; boolean has_sector = false;
sector_t *sector = NULL; sector_t *sector = NULL;
if (!lua_isnoneornil(L, 1)) if (!lua_isnoneornil(L, 1))
...@@ -1264,21 +1304,18 @@ static int libd_fadeScreen(lua_State *L) ...@@ -1264,21 +1304,18 @@ static int libd_fadeScreen(lua_State *L)
static int libd_width(lua_State *L) static int libd_width(lua_State *L)
{ {
HUDONLY
lua_pushinteger(L, vid.width); // push screen width lua_pushinteger(L, vid.width); // push screen width
return 1; return 1;
} }
static int libd_height(lua_State *L) static int libd_height(lua_State *L)
{ {
HUDONLY
lua_pushinteger(L, vid.height); // push screen height lua_pushinteger(L, vid.height); // push screen height
return 1; return 1;
} }
static int libd_dup(lua_State *L) static int libd_dup(lua_State *L)
{ {
HUDONLY
lua_pushinteger(L, vid.dup); // push integral scale (patch scale) lua_pushinteger(L, vid.dup); // push integral scale (patch scale)
lua_pushfixed(L, vid.fdup); // push fixed point scale (position scale) lua_pushfixed(L, vid.fdup); // push fixed point scale (position scale)
return 2; return 2;
...@@ -1286,7 +1323,6 @@ static int libd_dup(lua_State *L) ...@@ -1286,7 +1323,6 @@ static int libd_dup(lua_State *L)
static int libd_renderer(lua_State *L) static int libd_renderer(lua_State *L)
{ {
HUDONLY
switch (rendermode) { switch (rendermode) {
case render_opengl: lua_pushliteral(L, "opengl"); break; // OpenGL renderer case render_opengl: lua_pushliteral(L, "opengl"); break; // OpenGL renderer
case render_soft: lua_pushliteral(L, "software"); break; // Software renderer case render_soft: lua_pushliteral(L, "software"); break; // Software renderer
...@@ -1300,14 +1336,12 @@ static int libd_renderer(lua_State *L) ...@@ -1300,14 +1336,12 @@ static int libd_renderer(lua_State *L)
static int libd_RandomFixed(lua_State *L) static int libd_RandomFixed(lua_State *L)
{ {
HUDONLY
lua_pushfixed(L, M_RandomFixed()); lua_pushfixed(L, M_RandomFixed());
return 1; return 1;
} }
static int libd_RandomByte(lua_State *L) static int libd_RandomByte(lua_State *L)
{ {
HUDONLY
lua_pushinteger(L, M_RandomByte()); lua_pushinteger(L, M_RandomByte());
return 1; return 1;
} }
...@@ -1316,7 +1350,6 @@ static int libd_RandomKey(lua_State *L) ...@@ -1316,7 +1350,6 @@ static int libd_RandomKey(lua_State *L)
{ {
INT32 a = (INT32)luaL_checkinteger(L, 1); INT32 a = (INT32)luaL_checkinteger(L, 1);
HUDONLY
lua_pushinteger(L, M_RandomKey(a)); lua_pushinteger(L, M_RandomKey(a));
return 1; return 1;
} }
...@@ -1326,7 +1359,6 @@ static int libd_RandomRange(lua_State *L) ...@@ -1326,7 +1359,6 @@ static int libd_RandomRange(lua_State *L)
INT32 a = (INT32)luaL_checkinteger(L, 1); INT32 a = (INT32)luaL_checkinteger(L, 1);
INT32 b = (INT32)luaL_checkinteger(L, 2); INT32 b = (INT32)luaL_checkinteger(L, 2);
HUDONLY
lua_pushinteger(L, M_RandomRange(a, b)); lua_pushinteger(L, M_RandomRange(a, b));
return 1; return 1;
} }
...@@ -1334,7 +1366,6 @@ static int libd_RandomRange(lua_State *L) ...@@ -1334,7 +1366,6 @@ static int libd_RandomRange(lua_State *L)
// Macros. // Macros.
static int libd_SignedRandom(lua_State *L) static int libd_SignedRandom(lua_State *L)
{ {
HUDONLY
lua_pushinteger(L, M_SignedRandom()); lua_pushinteger(L, M_SignedRandom());
return 1; return 1;
} }
...@@ -1342,7 +1373,6 @@ static int libd_SignedRandom(lua_State *L) ...@@ -1342,7 +1373,6 @@ static int libd_SignedRandom(lua_State *L)
static int libd_RandomChance(lua_State *L) static int libd_RandomChance(lua_State *L)
{ {
fixed_t p = luaL_checkfixed(L, 1); fixed_t p = luaL_checkfixed(L, 1);
HUDONLY
lua_pushboolean(L, M_RandomChance(p)); lua_pushboolean(L, M_RandomChance(p));
return 1; return 1;
} }
...@@ -1351,7 +1381,6 @@ static int libd_RandomChance(lua_State *L) ...@@ -1351,7 +1381,6 @@ static int libd_RandomChance(lua_State *L)
// Could as well be thrown in global vars for ease of access but I guess it makes sense for it to be a HUD fn // Could as well be thrown in global vars for ease of access but I guess it makes sense for it to be a HUD fn
static int libd_getlocaltransflag(lua_State *L) static int libd_getlocaltransflag(lua_State *L)
{ {
HUDONLY
lua_pushinteger(L, (10-st_translucency)*V_10TRANS); lua_pushinteger(L, (10-st_translucency)*V_10TRANS);
return 1; return 1;
} }
...@@ -1359,7 +1388,6 @@ static int libd_getlocaltransflag(lua_State *L) ...@@ -1359,7 +1388,6 @@ static int libd_getlocaltransflag(lua_State *L)
// Get cv_translucenthud's value for HUD rendering as a normal V_xxTRANS int // Get cv_translucenthud's value for HUD rendering as a normal V_xxTRANS int
static int libd_getusertransflag(lua_State *L) static int libd_getusertransflag(lua_State *L)
{ {
HUDONLY
lua_pushinteger(L, (10-cv_translucenthud.value)*V_10TRANS); // A bit weird that it's called "translucenthud" yet 10 is fully opaque :V lua_pushinteger(L, (10-cv_translucenthud.value)*V_10TRANS); // A bit weird that it's called "translucenthud" yet 10 is fully opaque :V
return 1; return 1;
} }
...@@ -1381,6 +1409,7 @@ static luaL_Reg lib_draw[] = { ...@@ -1381,6 +1409,7 @@ static luaL_Reg lib_draw[] = {
{"drawNum", libd_drawNum}, {"drawNum", libd_drawNum},
{"drawPaddedNum", libd_drawPaddedNum}, {"drawPaddedNum", libd_drawPaddedNum},
{"drawFill", libd_drawFill}, {"drawFill", libd_drawFill},
{"drawFixedFill", libd_drawFixedFill},
{"drawString", libd_drawString}, {"drawString", libd_drawString},
{"drawNameTag", libd_drawNameTag}, {"drawNameTag", libd_drawNameTag},
{"drawScaledNameTag", libd_drawScaledNameTag}, {"drawScaledNameTag", libd_drawScaledNameTag},
...@@ -1452,6 +1481,26 @@ static luaL_Reg lib_hud[] = { ...@@ -1452,6 +1481,26 @@ static luaL_Reg lib_hud[] = {
{"disable", lib_huddisable}, {"disable", lib_huddisable},
{"enabled", lib_hudenabled}, {"enabled", lib_hudenabled},
{"add", lib_hudadd}, {"add", lib_hudadd},
{"patchExists", libd_patchExists},
{"cachePatch", libd_cachePatch},
{"getSpritePatch", libd_getSpritePatch},
{"getSprite2Patch", libd_getSprite2Patch},
{"width", libd_width},
{"height", libd_height},
{"scale", libd_dup},
{"renderer", libd_renderer},
{NULL, NULL}
};
// globalized client_side random functions.
static luaL_Reg lib_randomclient[] = {
// m_random
{"localFixed",libd_RandomFixed},
{"localByte",libd_RandomByte},
{"localKey",libd_RandomKey},
{"localRange",libd_RandomRange},
{"localSignedRandom",libd_SignedRandom}, // MACRO
{"localChance",libd_RandomChance}, // MACRO
{NULL, NULL} {NULL, NULL}
}; };
...@@ -1478,6 +1527,7 @@ int LUA_HudLib(lua_State *L) ...@@ -1478,6 +1527,7 @@ int LUA_HudLib(lua_State *L)
LUA_RegisterGlobalUserdata(L, "hudinfo", lib_getHudInfo, NULL, lib_hudinfolen); LUA_RegisterGlobalUserdata(L, "hudinfo", lib_getHudInfo, NULL, lib_hudinfolen);
luaL_register(L, "hud", lib_hud); luaL_register(L, "hud", lib_hud);
luaL_register(L, "random", lib_randomclient);
return 0; return 0;
} }
......
...@@ -25,6 +25,7 @@ enum drawitem_e { ...@@ -25,6 +25,7 @@ enum drawitem_e {
DI_DrawNum, DI_DrawNum,
DI_DrawPaddedNum, DI_DrawPaddedNum,
DI_DrawFill, DI_DrawFill,
DI_DrawFixedFill,
DI_DrawString, DI_DrawString,
DI_DrawNameTag, DI_DrawNameTag,
DI_DrawScaledNameTag, DI_DrawScaledNameTag,
...@@ -346,6 +347,25 @@ void LUA_HUD_AddDrawFill( ...@@ -346,6 +347,25 @@ void LUA_HUD_AddDrawFill(
item->c = c; item->c = c;
} }
void LUA_HUD_AddDrawFixedFill(
huddrawlist_h list,
fixed_t x,
fixed_t y,
fixed_t w,
fixed_t h,
INT32 c
)
{
size_t i = AllocateDrawItem(list);
drawitem_t *item = &list->items[i];
item->type = DI_DrawFixedFill;
item->x = x;
item->y = y;
item->w = w;
item->h = h;
item->c = c;
}
void LUA_HUD_AddDrawString( void LUA_HUD_AddDrawString(
huddrawlist_h list, huddrawlist_h list,
fixed_t x, fixed_t x,
...@@ -482,6 +502,9 @@ void LUA_HUD_DrawList(huddrawlist_h list) ...@@ -482,6 +502,9 @@ void LUA_HUD_DrawList(huddrawlist_h list)
case DI_DrawFill: case DI_DrawFill:
V_DrawFill(item->x, item->y, item->w, item->h, item->c); V_DrawFill(item->x, item->y, item->w, item->h, item->c);
break; break;
case DI_DrawFixedFill:
V_DrawFixedFill(item->x, item->y, item->w, item->h, item->c);
break;
case DI_DrawString: case DI_DrawString:
switch(item->align) switch(item->align)
{ {
......
...@@ -98,6 +98,14 @@ void LUA_HUD_AddDrawFill( ...@@ -98,6 +98,14 @@ void LUA_HUD_AddDrawFill(
INT32 h, INT32 h,
INT32 c INT32 c
); );
void LUA_HUD_AddDrawFixedFill(
huddrawlist_h list,
fixed_t x,
fixed_t y,
fixed_t w,
fixed_t h,
INT32 c
);
void LUA_HUD_AddDrawString( void LUA_HUD_AddDrawString(
huddrawlist_h list, huddrawlist_h list,
fixed_t x, fixed_t x,
......
...@@ -1158,6 +1158,7 @@ enum mobjinfo_e ...@@ -1158,6 +1158,7 @@ enum mobjinfo_e
mobjinfo_activesound, mobjinfo_activesound,
mobjinfo_flags, mobjinfo_flags,
mobjinfo_raisestate, mobjinfo_raisestate,
mobjinfo_name,
}; };
const char *const mobjinfo_opt[] = { const char *const mobjinfo_opt[] = {
...@@ -1185,6 +1186,7 @@ const char *const mobjinfo_opt[] = { ...@@ -1185,6 +1186,7 @@ const char *const mobjinfo_opt[] = {
"activesound", "activesound",
"flags", "flags",
"raisestate", "raisestate",
"name",
NULL, NULL,
}; };
...@@ -1199,6 +1201,8 @@ static int mobjinfo_get(lua_State *L) ...@@ -1199,6 +1201,8 @@ static int mobjinfo_get(lua_State *L)
I_Assert(info != NULL); I_Assert(info != NULL);
I_Assert(info >= mobjinfo); I_Assert(info >= mobjinfo);
mobjtype_t id = info-mobjinfo;
switch (field) switch (field)
{ {
case mobjinfo_doomednum: case mobjinfo_doomednum:
...@@ -1273,6 +1277,21 @@ static int mobjinfo_get(lua_State *L) ...@@ -1273,6 +1277,21 @@ static int mobjinfo_get(lua_State *L)
case mobjinfo_raisestate: case mobjinfo_raisestate:
lua_pushinteger(L, info->raisestate); lua_pushinteger(L, info->raisestate);
break; break;
case mobjinfo_name:
if (id < MT_FIRSTFREESLOT)
{
lua_pushstring(L, MOBJTYPE_LIST[id]+3);
return 1;
}
id -= MT_FIRSTFREESLOT;
if (id < NUMMOBJFREESLOTS && FREE_MOBJS[id])
{
lua_pushstring(L, FREE_MOBJS[id]);
return 1;
}
return 0;
default: default:
lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS);
I_Assert(lua_istable(L, -1)); I_Assert(lua_istable(L, -1));
......
...@@ -10,16 +10,19 @@ ...@@ -10,16 +10,19 @@
/// \brief input library for Lua scripting /// \brief input library for Lua scripting
#include "doomdef.h" #include "doomdef.h"
#include "doomstat.h"
#include "fastcmp.h" #include "fastcmp.h"
#include "g_input.h" #include "g_input.h"
#include "g_game.h" #include "g_game.h"
#include "hu_stuff.h" #include "hu_stuff.h"
#include "i_system.h" #include "i_system.h"
#include "console.h"
#include "lua_script.h" #include "lua_script.h"
#include "lua_libs.h" #include "lua_libs.h"
boolean mousegrabbedbylua = true; boolean mousegrabbedbylua = true;
boolean textinputmodeenabledbylua = false;
boolean ignoregameinputs = false; boolean ignoregameinputs = false;
/////////////// ///////////////
...@@ -129,6 +132,20 @@ static int lib_getCursorPosition(lua_State *L) ...@@ -129,6 +132,20 @@ static int lib_getCursorPosition(lua_State *L)
return 2; return 2;
} }
static int lib_setTextInputMode(lua_State *L)
{
textinputmodeenabledbylua = luaL_checkboolean(L, 1);
if (!(menuactive || CON_Ready() || chat_on))
I_SetTextInputMode(textinputmodeenabledbylua);
return 0;
}
static int lib_getTextInputMode(lua_State *L)
{
lua_pushinteger(L, textinputmodeenabledbylua);
return 1;
}
static luaL_Reg lib[] = { static luaL_Reg lib[] = {
{"gameControlDown", lib_gameControlDown}, {"gameControlDown", lib_gameControlDown},
{"gameControl2Down", lib_gameControl2Down}, {"gameControl2Down", lib_gameControl2Down},
...@@ -143,6 +160,8 @@ static luaL_Reg lib[] = { ...@@ -143,6 +160,8 @@ static luaL_Reg lib[] = {
{"getMouseGrab", lib_getMouseGrab}, {"getMouseGrab", lib_getMouseGrab},
{"setMouseGrab", lib_setMouseGrab}, {"setMouseGrab", lib_setMouseGrab},
{"getCursorPosition", lib_getCursorPosition}, {"getCursorPosition", lib_getCursorPosition},
{"setTextInputMode", lib_setTextInputMode},
{"getTextInputMode", lib_getTextInputMode},
{NULL, NULL} {NULL, NULL}
}; };
...@@ -220,6 +239,28 @@ static int lib_lenGameKeyDown(lua_State *L) ...@@ -220,6 +239,28 @@ static int lib_lenGameKeyDown(lua_State *L)
return 1; return 1;
} }
////////////////
// TEXT EVENT //
////////////////
static int textevent_get(lua_State *L)
{
event_t *event = *((event_t **)luaL_checkudata(L, 1, META_TEXTEVENT));
const char *field = luaL_checkstring(L, 2);
I_Assert(event != NULL);
if (fastcmp(field,"text"))
{
char s[2] = { event->key, 0 };
lua_pushstring(L, s);
}
else
return luaL_error(L, "textevent_t has no field named %s", field);
return 1;
}
/////////////// ///////////////
// KEY EVENT // // KEY EVENT //
/////////////// ///////////////
...@@ -285,6 +326,7 @@ static int mouse_num(lua_State *L) ...@@ -285,6 +326,7 @@ static int mouse_num(lua_State *L)
int LUA_InputLib(lua_State *L) int LUA_InputLib(lua_State *L)
{ {
LUA_RegisterUserdataMetatable(L, META_TEXTEVENT, textevent_get, NULL, NULL);
LUA_RegisterUserdataMetatable(L, META_KEYEVENT, keyevent_get, NULL, NULL); LUA_RegisterUserdataMetatable(L, META_KEYEVENT, keyevent_get, NULL, NULL);
LUA_RegisterUserdataMetatable(L, META_MOUSE, mouse_get, NULL, mouse_num); LUA_RegisterUserdataMetatable(L, META_MOUSE, mouse_get, NULL, mouse_num);
......
This diff is collapsed.
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
extern lua_State *gL; extern lua_State *gL;
extern boolean mousegrabbedbylua; extern boolean mousegrabbedbylua;
extern boolean textinputmodeenabledbylua;
extern boolean ignoregameinputs; extern boolean ignoregameinputs;
#define MUTABLE_TAGS #define MUTABLE_TAGS
...@@ -46,6 +47,8 @@ extern boolean ignoregameinputs; ...@@ -46,6 +47,8 @@ extern boolean ignoregameinputs;
#define META_SKINSPRITESLIST "SKIN_T*SKINSPRITES[]" #define META_SKINSPRITESLIST "SKIN_T*SKINSPRITES[]"
#define META_SKINSPRITESCOMPAT "SKIN_T*SPRITES" // TODO: 2.3: Delete #define META_SKINSPRITESCOMPAT "SKIN_T*SPRITES" // TODO: 2.3: Delete
#define META_MUSICDEF "MUSICDEF_T*"
#define META_VERTEX "VERTEX_T*" #define META_VERTEX "VERTEX_T*"
#define META_LINE "LINE_T*" #define META_LINE "LINE_T*"
#define META_SIDE "SIDE_T*" #define META_SIDE "SIDE_T*"
...@@ -69,11 +72,15 @@ extern boolean ignoregameinputs; ...@@ -69,11 +72,15 @@ extern boolean ignoregameinputs;
#ifdef MUTABLE_TAGS #ifdef MUTABLE_TAGS
#define META_SECTORTAGLIST "sector_t.taglist" #define META_SECTORTAGLIST "sector_t.taglist"
#endif #endif
#define META_SECTORCUSTOMARGS "SECTOR_T*CUSTOMARGS"
#define META_SIDENUM "LINE_T*SIDENUM" #define META_SIDENUM "LINE_T*SIDENUM"
#define META_LINEARGS "LINE_T*ARGS" #define META_LINEARGS "LINE_T*ARGS"
#define META_LINESTRINGARGS "LINE_T*STRINGARGS" #define META_LINESTRINGARGS "LINE_T*STRINGARGS"
#define META_LINECUSTOMARGS "LINE_T*CUSTOMARGS"
#define META_SIDECUSTOMARGS "SIDE_T*CUSTOMARGS"
#define META_THINGARGS "MAPTHING_T*ARGS" #define META_THINGARGS "MAPTHING_T*ARGS"
#define META_THINGSTRINGARGS "MAPTHING_T*STRINGARGS" #define META_THINGSTRINGARGS "MAPTHING_T*STRINGARGS"
#define META_THINGCUSTOMARGS "MAPTHING_T*CUSTOMARGS"
#define META_POLYOBJVERTICES "POLYOBJ_T*VERTICES" #define META_POLYOBJVERTICES "POLYOBJ_T*VERTICES"
#define META_POLYOBJLINES "POLYOBJ_T*LINES" #define META_POLYOBJLINES "POLYOBJ_T*LINES"
#ifdef HAVE_LUA_SEGS #ifdef HAVE_LUA_SEGS
...@@ -93,9 +100,12 @@ extern boolean ignoregameinputs; ...@@ -93,9 +100,12 @@ extern boolean ignoregameinputs;
#define META_LUABANKS "LUABANKS[]*" #define META_LUABANKS "LUABANKS[]*"
#define META_TEXTEVENT "TEXTEVENT_T*"
#define META_KEYEVENT "KEYEVENT_T*" #define META_KEYEVENT "KEYEVENT_T*"
#define META_MOUSE "MOUSE_T*" #define META_MOUSE "MOUSE_T*"
#define META_INTERCEPT "INTERCEPT_T*"
boolean luaL_checkboolean(lua_State *L, int narg); boolean luaL_checkboolean(lua_State *L, int narg);
int LUA_EnumLib(lua_State *L); int LUA_EnumLib(lua_State *L);
...@@ -116,3 +126,4 @@ int LUA_BlockmapLib(lua_State *L); ...@@ -116,3 +126,4 @@ int LUA_BlockmapLib(lua_State *L);
int LUA_HudLib(lua_State *L); int LUA_HudLib(lua_State *L);
int LUA_ColorLib(lua_State *L); int LUA_ColorLib(lua_State *L);
int LUA_InputLib(lua_State *L); int LUA_InputLib(lua_State *L);
int LUA_InterceptLib(lua_State *L);
This diff is collapsed.
...@@ -973,6 +973,7 @@ enum mapthing_e { ...@@ -973,6 +973,7 @@ enum mapthing_e {
mapthing_taglist, mapthing_taglist,
mapthing_args, mapthing_args,
mapthing_stringargs, mapthing_stringargs,
mapthing_customargs,
mapthing_mobj, mapthing_mobj,
}; };
...@@ -994,6 +995,7 @@ const char *const mapthing_opt[] = { ...@@ -994,6 +995,7 @@ const char *const mapthing_opt[] = {
"taglist", "taglist",
"args", "args",
"stringargs", "stringargs",
"customargs",
"mobj", "mobj",
NULL, NULL,
}; };
...@@ -1072,6 +1074,9 @@ static int mapthing_get(lua_State *L) ...@@ -1072,6 +1074,9 @@ static int mapthing_get(lua_State *L)
case mapthing_stringargs: case mapthing_stringargs:
LUA_PushUserdata(L, mt->stringargs, META_THINGSTRINGARGS); LUA_PushUserdata(L, mt->stringargs, META_THINGSTRINGARGS);
break; break;
case mapthing_customargs:
LUA_PushUserdata(L, mt->customargs, META_THINGCUSTOMARGS);
break;
case mapthing_mobj: case mapthing_mobj:
LUA_PushUserdata(L, mt->mobj, META_MOBJ); LUA_PushUserdata(L, mt->mobj, META_MOBJ);
break; break;
......
...@@ -226,6 +226,7 @@ enum player_e ...@@ -226,6 +226,7 @@ enum player_e
player_quittime, player_quittime,
player_lastinputtime, player_lastinputtime,
player_ping, player_ping,
player_muted,
player_fovadd player_fovadd
}; };
...@@ -374,6 +375,7 @@ static const char *const player_opt[] = { ...@@ -374,6 +375,7 @@ static const char *const player_opt[] = {
"quittime", "quittime",
"lastinputtime", "lastinputtime",
"ping", "ping",
"muted",
"fovadd", "fovadd",
NULL, NULL,
}; };
...@@ -835,6 +837,9 @@ static int player_get(lua_State *L) ...@@ -835,6 +837,9 @@ static int player_get(lua_State *L)
case player_ping: case player_ping:
lua_pushinteger(L, playerpingtable[plr - players]); lua_pushinteger(L, playerpingtable[plr - players]);
break; break;
case player_muted:
lua_pushboolean(L, plr->muted);
break;
case player_fovadd: case player_fovadd:
lua_pushfixed(L, plr->fovadd); lua_pushfixed(L, plr->fovadd);
break; break;
...@@ -1359,6 +1364,9 @@ static int player_set(lua_State *L) ...@@ -1359,6 +1364,9 @@ static int player_set(lua_State *L)
case player_lastinputtime: case player_lastinputtime:
plr->lastinputtime = (tic_t)luaL_checkinteger(L, 3); plr->lastinputtime = (tic_t)luaL_checkinteger(L, 3);
break; break;
case player_muted:
plr->muted = lua_toboolean(L, 3);
break;
case player_fovadd: case player_fovadd:
plr->fovadd = luaL_checkfixed(L, 3); plr->fovadd = luaL_checkfixed(L, 3);
break; break;
......
This diff is collapsed.
This diff is collapsed.
...@@ -1110,9 +1110,9 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c ...@@ -1110,9 +1110,9 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c
mt->pitch = mt->roll = 0; mt->pitch = mt->roll = 0;
// Ignore offsets // Ignore offsets
if (mt->type == MT_EMBLEM) if (mt->type == mobjinfo[MT_EMBLEM].doomednum)
mt->args[1] = 1; mt->args[1] = 1;
else else if (!(mt->type == mobjinfo[MT_METALSONIC_RACE].doomednum || mt->type == mobjinfo[MT_ROSY].doomednum))
mt->args[0] = 1; mt->args[0] = 1;
return mt; return mt;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.