- prepared folder for merging.

This commit is contained in:
Christoph Oelckers 2020-06-21 22:18:12 +02:00
parent 99958342a9
commit 0596078978
35 changed files with 1271 additions and 1923 deletions

View file

@ -802,6 +802,7 @@ set (PCH_SOURCES
core/raze_sound.cpp core/raze_sound.cpp
core/palette.cpp core/palette.cpp
core/zcompile.cpp core/zcompile.cpp
core/statusbar.cpp
core/2d/screentext.cpp core/2d/screentext.cpp

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define actors_c_ #define actors_c_
#include "duke3d_ed.h" #include "duke3d.h"
BEGIN_DUKE_NS BEGIN_DUKE_NS
@ -1111,6 +1111,23 @@ static int P_Submerge(int, int, DukePlayer_t *, int, int);
static int P_Emerge(int, int, DukePlayer_t *, int, int); static int P_Emerge(int, int, DukePlayer_t *, int, int);
static void P_FinishWaterChange(int, DukePlayer_t *, int, int, int); static void P_FinishWaterChange(int, DukePlayer_t *, int, int, int);
static fix16_t P_GetQ16AngleDeltaForTic(DukePlayer_t const *pPlayer)
{
auto oldAngle = pPlayer->oq16ang;
auto newAngle = pPlayer->q16ang;
if (klabs(fix16_sub(oldAngle, newAngle)) < F16(1024))
return fix16_sub(newAngle, oldAngle);
if (newAngle > F16(1024))
newAngle = fix16_sub(newAngle, F16(2048));
if (oldAngle > F16(1024))
oldAngle = fix16_sub(oldAngle, F16(2048));
return fix16_sub(newAngle, oldAngle);
}
ACTOR_STATIC void G_MovePlayers(void) ACTOR_STATIC void G_MovePlayers(void)
{ {
int spriteNum = headspritestat[STAT_PLAYER]; int spriteNum = headspritestat[STAT_PLAYER];
@ -1164,7 +1181,7 @@ ACTOR_STATIC void G_MovePlayers(void)
if (G_HaveActor(sprite[spriteNum].picnum)) if (G_HaveActor(sprite[spriteNum].picnum))
A_Execute(spriteNum, P_GetP(pSprite), otherPlayerDist); A_Execute(spriteNum, P_GetP(pSprite), otherPlayerDist);
pPlayer->q16angvel = G_GetQ16AngleDelta(pPlayer->oq16ang, pPlayer->q16ang); pPlayer->q16angvel = P_GetQ16AngleDeltaForTic(pPlayer);
pPlayer->oq16ang = pPlayer->q16ang; pPlayer->oq16ang = pPlayer->q16ang;
pPlayer->oq16horiz = pPlayer->q16horiz; pPlayer->oq16horiz = pPlayer->q16horiz;
pPlayer->oq16horizoff = pPlayer->q16horizoff; pPlayer->oq16horizoff = pPlayer->q16horizoff;
@ -1211,7 +1228,7 @@ ACTOR_STATIC void G_MovePlayers(void)
if (pPlayer->wackedbyactor >= 0 && sprite[pPlayer->wackedbyactor].statnum < MAXSTATUS) if (pPlayer->wackedbyactor >= 0 && sprite[pPlayer->wackedbyactor].statnum < MAXSTATUS)
{ {
pPlayer->q16ang += fix16_from_int(G_GetAngleDelta(fix16_to_int(pPlayer->q16ang), pPlayer->q16ang += fix16_to_int(G_GetAngleDelta(pPlayer->q16ang,
getangle(sprite[pPlayer->wackedbyactor].x - pPlayer->pos.x, getangle(sprite[pPlayer->wackedbyactor].x - pPlayer->pos.x,
sprite[pPlayer->wackedbyactor].y - pPlayer->pos.y)) sprite[pPlayer->wackedbyactor].y - pPlayer->pos.y))
>> 1); >> 1);

View file

@ -40,6 +40,7 @@ BEGIN_DUKE_NS
#define ACTOR_MAXFALLINGZVEL 6144 #define ACTOR_MAXFALLINGZVEL 6144
#define ACTOR_ONWATER_ADDZ (24<<8) #define ACTOR_ONWATER_ADDZ (24<<8)
// KEEPINSYNC lunatic/con_lang.lua
#define STAT_DEFAULT 0 #define STAT_DEFAULT 0
#define STAT_ACTOR 1 #define STAT_ACTOR 1
#define STAT_ZOMBIEACTOR 2 #define STAT_ZOMBIEACTOR 2
@ -117,6 +118,8 @@ enum actionflags
AF_VIEWPOINT = 1u<<0u, AF_VIEWPOINT = 1u<<0u,
}; };
// Select an actor's actiontics and movflags locations depending on
// whether we compile the Lunatic build.
// <spr>: sprite pointer // <spr>: sprite pointer
// <a>: actor_t pointer // <a>: actor_t pointer
# define AC_ACTIONTICS(spr, a) ((spr)->lotag) # define AC_ACTIONTICS(spr, a) ((spr)->lotag)
@ -176,6 +179,7 @@ typedef struct
} tiledata_t; } tiledata_t;
// KEEPINSYNC lunatic/con_lang.lua
enum sflags_t enum sflags_t
{ {
SFLAG_SHADOW = 0x00000001, SFLAG_SHADOW = 0x00000001,

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "baselayer.h" #include "baselayer.h"
#include "baselayer.h" #include "baselayer.h"
#include "duke3d_ed.h" #include "duke3d.h"
#include "animlib.h" #include "animlib.h"
#include "compat.h" #include "compat.h"
#include "cmdlib.h" #include "cmdlib.h"
@ -480,7 +480,7 @@ int32_t Anim_Play(const char *fn)
{ {
AnimTextures animtex; AnimTextures animtex;
animtex.SetSize(320, 200); animtex.SetSize(AnimTexture::Paletted, 320, 200);
do do
{ {
@ -562,7 +562,6 @@ int32_t Anim_Play(const char *fn)
end_anim_restore_gl: end_anim_restore_gl:
gl_texture_filter = ogltexfiltermode; gl_texture_filter = ogltexfiltermode;
gltexapplyprops();
end_anim: end_anim:
inputState.ClearAllInput(); inputState.ClearAllInput();
anim->animbuf = nullptr; anim->animbuf = nullptr;

View file

@ -25,7 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_DUKE_NS BEGIN_DUKE_NS
struct animsound_t { struct animsound_t
{
uint16_t frame = 0; uint16_t frame = 0;
int16_t sound = 0; int16_t sound = 0;
}; };

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "duke3d_ed.h" #include "duke3d.h"
#include "osdcmds.h" #include "osdcmds.h"
#include "cheats.h" #include "cheats.h"
#include "mapinfo.h" #include "mapinfo.h"
@ -428,9 +428,9 @@ void G_DoCheats(void)
{ {
case CHEAT_WEAPONS: case CHEAT_WEAPONS:
{ {
int const weaponLimit = (VOLUMEONE) ? 6 : 0; int const weaponLimit = (VOLUMEONE) ? SHRINKER_WEAPON : MAX_WEAPONS;
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS-weaponLimit; weaponNum++) for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++)
{ {
P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]); P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]);
pPlayer->gotweapon |= (1<<weaponNum); pPlayer->gotweapon |= (1<<weaponNum);
@ -565,12 +565,12 @@ void G_DoCheats(void)
case CHEAT_STUFF: case CHEAT_STUFF:
{ {
int const weaponLimit = (VOLUMEONE) ? 6 : 0; int const weaponLimit = (VOLUMEONE) ? SHRINKER_WEAPON : MAX_WEAPONS;
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS-weaponLimit; weaponNum++) for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++)
pPlayer->gotweapon |= (1<<weaponNum); pPlayer->gotweapon |= (1 << weaponNum);
for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < MAX_WEAPONS-weaponLimit; weaponNum++) for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++)
P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]); P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]);
if (RRRA) if (RRRA)

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "duke3d_ed.h" #include "duke3d.h"
#include "demo.h" #include "demo.h"
#include "screens.h" #include "screens.h"
#include "baselayer.h" #include "baselayer.h"

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "duke3d_ed.h" #include "duke3d.h"
#include "osdcmds.h" #include "osdcmds.h"
#include "baselayer.h" #include "baselayer.h"
#include "cmdline.h" #include "cmdline.h"
@ -42,7 +42,7 @@ int32_t CONFIG_ReadSetup(void)
ud.camera_time = 0;//4; ud.camera_time = 0;//4;
ud.screen_tilting = 1; ud.screen_tilting = 1;
ud.statusbarflags = STATUSBAR_NOSHRINK; ud.statusbarflags = 0;// STATUSBAR_NOSHRINK;
playerteam = 0; playerteam = 0;
ud.angleinterpolation = 0; ud.angleinterpolation = 0;

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "cheats.h" #include "cheats.h"
#include "compat.h" #include "compat.h"
#include "demo.h" #include "demo.h"
#include "duke3d_ed.h" #include "duke3d.h"
#include "menus.h" #include "menus.h"
#include "osdcmds.h" #include "osdcmds.h"
@ -326,7 +326,7 @@ void Menu_DHLeaonardHeadDisplay(vec2_t pos)
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
class Duke3dListMenu : public DListMenu class DukeListMenu : public DListMenu
{ {
using Super = DListMenu; using Super = DListMenu;
protected: protected:
@ -369,17 +369,17 @@ protected:
} }
}; };
class Duke3dMainMenu : public Duke3dListMenu class DukeMainMenu : public DukeListMenu
{ {
virtual void Init(DMenu* parent = NULL, FListMenuDescriptor* desc = NULL) override virtual void Init(DMenu* parent = NULL, FListMenuDescriptor* desc = NULL) override
{ {
Duke3dListMenu::Init(parent, desc); DukeListMenu::Init(parent, desc);
Menu_DHLeaonardHeadReset(); Menu_DHLeaonardHeadReset();
} }
void PreDraw() override void PreDraw() override
{ {
Duke3dListMenu::PreDraw(); DukeListMenu::PreDraw();
if (DEER) if (DEER)
{ {
vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) }; vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) };
@ -405,11 +405,11 @@ class Duke3dMainMenu : public Duke3dListMenu
}; };
class Duke3dHuntMenu : public Duke3dListMenu class DukeHuntMenu : public DukeListMenu
{ {
void PreDraw() override void PreDraw() override
{ {
Duke3dListMenu::PreDraw(); DukeListMenu::PreDraw();
vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) }; vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) };
int t1, t2; int t1, t2;
short ang; short ang;
@ -443,11 +443,11 @@ class Duke3dHuntMenu : public Duke3dListMenu
} }
}; };
class Duke3dTargetMenu : public Duke3dListMenu class DukeTargetMenu : public DukeListMenu
{ {
void PreDraw() override void PreDraw() override
{ {
Duke3dListMenu::PreDraw(); DukeListMenu::PreDraw();
vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) }; vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) };
int t1, t2; int t1, t2;
short ang; short ang;
@ -472,11 +472,11 @@ class Duke3dTargetMenu : public Duke3dListMenu
} }
}; };
class Duke3dWeaponMenu : public Duke3dListMenu class DukeWeaponMenu : public DukeListMenu
{ {
void PreDraw() override void PreDraw() override
{ {
Duke3dListMenu::PreDraw(); DukeListMenu::PreDraw();
vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) }; vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) };
int t1, t2; int t1, t2;
switch (mDesc->mSelectedItem) switch (mDesc->mSelectedItem)
@ -508,11 +508,11 @@ class Duke3dWeaponMenu : public Duke3dListMenu
} }
}; };
class Duke3dTrophiesMenu : public Duke3dListMenu class DukeTrophiesMenu : public DukeListMenu
{ {
void PreDraw() override void PreDraw() override
{ {
Duke3dListMenu::PreDraw(); DukeListMenu::PreDraw();
vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) }; vec2_t forigin = { int(origin.X * 65536), int(origin.Y * 65536) };
if (g_player[myconnectindex].ps->gm & MODE_GAME) if (g_player[myconnectindex].ps->gm & MODE_GAME)
{ {
@ -580,7 +580,7 @@ void GameInterface::DrawNativeMenuText(int fontnum, int state, double xpos, doub
void GameInterface::MenuOpened() void GameInterface::MenuOpened()
{ {
S_PauseSound(true, false); S_PauseSounds(true);
if ((!g_netServer && ud.multimode < 2)) if ((!g_netServer && ud.multimode < 2))
{ {
ready2send = 0; ready2send = 0;
@ -646,7 +646,7 @@ void GameInterface::MenuClosed()
} }
G_UpdateScreenArea(); G_UpdateScreenArea();
S_ResumeSound(false); S_PauseSounds(false);
} }
} }
@ -775,13 +775,13 @@ END_DUKE_NS
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static TMenuClassDescriptor<Duke3d::Duke3dMainMenu> _mm("Duke3d.MainMenu"); static TMenuClassDescriptor<Duke3d::DukeMainMenu> _mm("Duke.MainMenu");
static TMenuClassDescriptor<Duke3d::Duke3dListMenu> _lm("Duke3d.ListMenu"); static TMenuClassDescriptor<Duke3d::DukeListMenu> _lm("Duke.ListMenu");
static TMenuClassDescriptor<Duke3d::Duke3dHuntMenu> _dhm("Duke3d.HuntMenu"); static TMenuClassDescriptor<Duke3d::DukeHuntMenu> _dhm("Duke.HuntMenu");
static TMenuClassDescriptor<Duke3d::Duke3dTargetMenu> _dtm("Duke3d.TargetMenu"); static TMenuClassDescriptor<Duke3d::DukeTargetMenu> _dtm("Duke.TargetMenu");
static TMenuClassDescriptor<Duke3d::Duke3dWeaponMenu> _dwm("Duke3d.WeaponMenu"); static TMenuClassDescriptor<Duke3d::DukeWeaponMenu> _dwm("Duke.WeaponMenu");
static TMenuClassDescriptor<Duke3d::Duke3dTrophiesMenu> _dttm("Duke3d.TrophiesMenu"); static TMenuClassDescriptor<Duke3d::DukeTrophiesMenu> _dttm("Duke.TrophiesMenu");
static TMenuClassDescriptor<DImageScrollerMenu> _ism("Duke3d.ImageScrollerMenu"); // does not implement a new class, we only need the descriptor. static TMenuClassDescriptor<DImageScrollerMenu> _ism("Duke.ImageScrollerMenu"); // does not implement a new class, we only need the descriptor.
void RegisterDuke3dMenus() void RegisterDuke3dMenus()
{ {

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "demo.h" #include "demo.h"
#include "duke3d_ed.h" #include "duke3d.h"
#include "menus.h" #include "menus.h"
#include "savegame.h" #include "savegame.h"
@ -120,7 +120,7 @@ static int32_t G_OpenDemoRead(int32_t g_whichDemo) // 0 = mine
gFullMap = false; gFullMap = false;
ud.god = ud.cashman = ud.eog = 0; ud.god = ud.cashman = ud.eog = 0;
ud.noclip = ud.scrollmode = ud.overhead_on = 0; //= paused = 0; ud.noclip = ud.scrollmode = ud.overhead_on = 0; //= ud.pause_on = 0;
totalclock = ototalclock = lockclock = 0; totalclock = ototalclock = lockclock = 0;
@ -591,7 +591,7 @@ RECHECK:
Demo_FinishProfile(); Demo_FinishProfile();
while (totalclock >= (lockclock+TICSPERFRAME) while (totalclock >= (lockclock+TICSPERFRAME)
// || (ud.reccnt > REALGAMETICSPERSEC*2 && paused) // || (ud.reccnt > REALGAMETICSPERSEC*2 && ud.pause_on)
|| (g_demo_goalCnt>0 && g_demo_cnt<g_demo_goalCnt)) || (g_demo_goalCnt>0 && g_demo_cnt<g_demo_goalCnt))
{ {
if (ud.reccnt<=0) if (ud.reccnt<=0)

View file

@ -3,6 +3,7 @@
#define EDUKE32_EVENTS_DEFS_H_ #define EDUKE32_EVENTS_DEFS_H_
// the order of these can't be changed or else compatibility with EDuke 2.0 mods will break // the order of these can't be changed or else compatibility with EDuke 2.0 mods will break
// KEEPINSYNC with EventNames[] and lunatic/con_lang.lua
enum GameEvent_t { enum GameEvent_t {
EVENT_INIT, // 0 EVENT_INIT, // 0
EVENT_ENTERLEVEL, EVENT_ENTERLEVEL,

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define game_c_ #define game_c_
#include "duke3d_ed.h" #include "duke3d.h"
#include "compat.h" #include "compat.h"
#include "baselayer.h" #include "baselayer.h"
#include "osdcmds.h" #include "osdcmds.h"
@ -49,7 +49,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "mapinfo.h" #include "mapinfo.h"
#include "v_video.h" #include "v_video.h"
#include "glbackend/glbackend.h" #include "glbackend/glbackend.h"
#include "playmve.h"
// Uncomment to prevent anything except mirrors from drawing. It is sensible to // Uncomment to prevent anything except mirrors from drawing. It is sensible to
// also uncomment ENGINE_CLEAR_SCREEN in build/src/engine_priv.h. // also uncomment ENGINE_CLEAR_SCREEN in build/src/engine_priv.h.
@ -833,7 +832,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
if (pub > 0 || videoGetRenderMode() >= REND_POLYMOST) // JBF 20040101: redraw background always if (pub > 0 || videoGetRenderMode() >= REND_POLYMOST) // JBF 20040101: redraw background always
{ {
videoClearScreen(0); //videoClearScreen(0);
#ifndef EDUKE32_TOUCH_DEVICES #ifndef EDUKE32_TOUCH_DEVICES
if (ud.screen_size >= 8) if (ud.screen_size >= 8)
#endif #endif
@ -850,7 +849,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
videoSetCorrectedAspect(); videoSetCorrectedAspect();
} }
if (paused || pPlayer->on_crane > -1) if (ud.pause_on || pPlayer->on_crane > -1)
smoothRatio = 65536; smoothRatio = 65536;
else else
smoothRatio = calc_smoothratio(totalclock, ototalclock); smoothRatio = calc_smoothratio(totalclock, ototalclock);
@ -918,14 +917,14 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
)) ))
{ {
#ifdef USE_OPENGL #ifdef USE_OPENGL
renderSetRollAngle(fix16_to_float(pPlayer->q16rotscrnang)); renderSetRollAngle(pPlayer->orotscrnang + mulscale16(((pPlayer->rotscrnang - pPlayer->orotscrnang + 1024)&2047)-1024, smoothRatio));
#endif #endif
pPlayer->oq16rotscrnang = pPlayer->q16rotscrnang; pPlayer->orotscrnang = pPlayer->rotscrnang;
} }
if (RRRA && pPlayer->drug_mode > 0) if (RRRA && pPlayer->drug_mode > 0)
{ {
while (pPlayer->drug_timer < totalclock && !(pPlayer->gm & MODE_MENU) && !paused && !System_WantGuiCapture()) while (pPlayer->drug_timer < totalclock && !(pPlayer->gm & MODE_MENU) && !ud.pause_on && !System_WantGuiCapture())
{ {
int aspect; int aspect;
if (pPlayer->drug_stat[0] == 0) if (pPlayer->drug_stat[0] == 0)
@ -1016,7 +1015,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
omypos.z + mulscale16(mypos.z - omypos.z, smoothRatio) }; omypos.z + mulscale16(mypos.z - omypos.z, smoothRatio) };
CAMERA(pos) = camVect; CAMERA(pos) = camVect;
CAMERA(q16ang) = myang + pPlayer->q16look_ang; CAMERA(q16ang) = myang + fix16_from_int(pPlayer->look_ang);
CAMERA(q16horiz) = myhoriz + myhorizoff; CAMERA(q16horiz) = myhoriz + myhorizoff;
CAMERA(sect) = mycursectnum; CAMERA(sect) = mycursectnum;
} }
@ -1026,21 +1025,9 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
pPlayer->opos.y + mulscale16(pPlayer->pos.y - pPlayer->opos.y, smoothRatio), pPlayer->opos.y + mulscale16(pPlayer->pos.y - pPlayer->opos.y, smoothRatio),
pPlayer->opos.z + mulscale16(pPlayer->pos.z - pPlayer->opos.z, smoothRatio) }; pPlayer->opos.z + mulscale16(pPlayer->pos.z - pPlayer->opos.z, smoothRatio) };
CAMERA(pos) = camVect; CAMERA(pos) = camVect;
CAMERA(q16ang) = pPlayer->q16ang + fix16_from_int(pPlayer->look_ang);
if (pPlayer->wackedbyactor >= 0) CAMERA(q16horiz) = pPlayer->q16horiz + pPlayer->q16horizoff;
{
CAMERA(q16ang) = pPlayer->oq16ang
+ mulscale16(((pPlayer->q16ang + F16(1024) - pPlayer->oq16ang) & 0x7FFFFFF) - F16(1024), smoothRatio)
+ pPlayer->q16look_ang;
CAMERA(q16horiz) = pPlayer->oq16horiz + pPlayer->oq16horizoff
+ mulscale16((pPlayer->q16horiz + pPlayer->q16horizoff - pPlayer->oq16horiz - pPlayer->oq16horizoff), smoothRatio);
}
else
{
CAMERA(q16ang) = pPlayer->q16ang + pPlayer->q16look_ang;
CAMERA(q16horiz) = pPlayer->q16horiz + pPlayer->q16horizoff;
}
} }
if (cl_viewbob) if (cl_viewbob)
@ -1070,7 +1057,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio)
// looking through viewscreen // looking through viewscreen
CAMERA(pos) = camVect; CAMERA(pos) = camVect;
CAMERA(q16ang) = pPlayer->q16ang + pPlayer->q16look_ang; CAMERA(q16ang) = pPlayer->q16ang + fix16_from_int(pPlayer->look_ang);
CAMERA(q16horiz) = fix16_from_int(100 + sprite[pPlayer->newowner].shade); CAMERA(q16horiz) = fix16_from_int(100 + sprite[pPlayer->newowner].shade);
CAMERA(sect) = sprite[pPlayer->newowner].sectnum; CAMERA(sect) = sprite[pPlayer->newowner].sectnum;
} }
@ -3180,8 +3167,7 @@ rr_badguy:
} }
else changespritestat(newSprite, STAT_ZOMBIEACTOR); else changespritestat(newSprite, STAT_ZOMBIEACTOR);
if (RR && spriteNum >= 0) pSprite->shade = sprite[spriteNum].shade;
pSprite->shade = sprite[spriteNum].shade;
} }
break; break;
@ -5026,7 +5012,7 @@ default_case1:
spritesortcnt++; spritesortcnt++;
} }
if (g_player[playerNum].input->extbits & (1 << 7) && !paused && spritesortcnt < maxspritesonscreen) if (g_player[playerNum].input->extbits & (1 << 7) && !ud.pause_on && spritesortcnt < maxspritesonscreen)
{ {
tspritetype *const playerTyping = t; tspritetype *const playerTyping = t;
@ -5280,11 +5266,11 @@ default_case2:
if ((unsigned)scrofs_action + ACTION_VIEWTYPE >= (unsigned)g_scriptSize) if ((unsigned)scrofs_action + ACTION_VIEWTYPE >= (unsigned)g_scriptSize)
goto skip; goto skip;
l = apScript[scrofs_action + ACTION_VIEWTYPE]; int viewtype = apScript[scrofs_action + ACTION_VIEWTYPE];
uint16_t const action_flags = apScript[scrofs_action + ACTION_FLAGS]; uint16_t const action_flags = apScript[scrofs_action + ACTION_FLAGS];
int const invertp = l < 0; int const invertp = viewtype < 0;
l = klabs(l); l = klabs(viewtype);
#ifdef USE_OPENGL #ifdef USE_OPENGL
if (videoGetRenderMode() >= REND_POLYMOST && hw_models && md_tilehasmodel(pSprite->picnum,t->pal) >= 0 && !(spriteext[i].flags&SPREXT_NOTMD)) if (videoGetRenderMode() >= REND_POLYMOST && hw_models && md_tilehasmodel(pSprite->picnum,t->pal) >= 0 && !(spriteext[i].flags&SPREXT_NOTMD))
@ -6598,12 +6584,6 @@ static inline void G_CheckGametype(void)
ud.m_respawn_items = ud.m_respawn_inventory = 1; ud.m_respawn_items = ud.m_respawn_inventory = 1;
} }
static void G_PostLoadPalette(void)
{
//if (!(duke3d_globalflags & DUKE3D_NO_HARDCODED_FOGPALS))
// paletteSetupDefaultFog();
}
#define SETFLAG(Tilenum, Flag) g_tile[Tilenum].flags |= Flag #define SETFLAG(Tilenum, Flag) g_tile[Tilenum].flags |= Flag
// Has to be after setting the dynamic names (e.g. SHARK). // Has to be after setting the dynamic names (e.g. SHARK).
@ -7123,8 +7103,6 @@ int GameInterface::app_main()
enginePostInit(); enginePostInit();
G_PostLoadPalette();
tileDelete(MIRROR); tileDelete(MIRROR);
skiptile = W_FORCEFIELD + 1; skiptile = W_FORCEFIELD + 1;
@ -7297,58 +7275,48 @@ MAIN_LOOP_RESTART:
char gameUpdate = false; char gameUpdate = false;
double const gameUpdateStartTime = timerGetHiTicks(); double const gameUpdateStartTime = timerGetHiTicks();
updatePauseStatus(); while (((g_netClient || g_netServer) || !(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO))) && (int)(totalclock - ototalclock) >= TICSPERFRAME)
{
ototalclock += TICSPERFRAME;
if (paused) if (RRRA && g_player[myconnectindex].ps->on_motorcycle)
{ P_GetInputMotorcycle(myconnectindex);
ototalclock = totalclock - TICSPERFRAME; else if (RRRA && g_player[myconnectindex].ps->on_boat)
buttonMap.ResetButtonStates(); P_GetInputBoat(myconnectindex);
} else
else P_GetInput(myconnectindex);
{
while (((g_netClient || g_netServer) || !(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO))) && (int)(totalclock - ototalclock) >= TICSPERFRAME) // this is where we fill the input_t struct that is actually processed by P_ProcessInput()
auto const pPlayer = g_player[myconnectindex].ps;
auto const q16ang = fix16_to_int(pPlayer->q16ang);
auto & input = inputfifo[g_player[myconnectindex].movefifoend&(MOVEFIFOSIZ-1)][myconnectindex];
input = localInput;
input.fvel = mulscale9(localInput.fvel, sintable[(q16ang + 2560) & 2047]) +
mulscale9(localInput.svel, sintable[(q16ang + 2048) & 2047]) +
pPlayer->fric.x;
input.svel = mulscale9(localInput.fvel, sintable[(q16ang + 2048) & 2047]) +
mulscale9(localInput.svel, sintable[(q16ang + 1536) & 2047]) +
pPlayer->fric.y;
localInput = {};
g_player[myconnectindex].movefifoend++;
if (((!System_WantGuiCapture() && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU) || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
(g_player[myconnectindex].ps->gm&MODE_GAME))
{ {
if (RRRA && g_player[myconnectindex].ps->on_motorcycle) G_MoveLoop();
P_GetInputMotorcycle(myconnectindex);
else if (RRRA && g_player[myconnectindex].ps->on_boat)
P_GetInputBoat(myconnectindex);
else
P_GetInput(myconnectindex);
// this is where we fill the input_t struct that is actually processed by P_ProcessInput()
auto const pPlayer = g_player[myconnectindex].ps;
auto const q16ang = fix16_to_int(pPlayer->q16ang);
auto & input = inputfifo[g_player[myconnectindex].movefifoend&(MOVEFIFOSIZ-1)][myconnectindex];
input = localInput;
input.fvel = mulscale9(localInput.fvel, sintable[(q16ang + 2560) & 2047]) +
mulscale9(localInput.svel, sintable[(q16ang + 2048) & 2047]) +
pPlayer->fric.x;
input.svel = mulscale9(localInput.fvel, sintable[(q16ang + 2048) & 2047]) +
mulscale9(localInput.svel, sintable[(q16ang + 1536) & 2047]) +
pPlayer->fric.y;
localInput = {};
g_player[myconnectindex].movefifoend++;
ototalclock += TICSPERFRAME;
if (paused == 0 && (!System_WantGuiCapture() || ud.recstat == 2 || (g_netServer || ud.multimode > 1)) &&
(g_player[myconnectindex].ps->gm&MODE_GAME))
{
G_MoveLoop();
}
} }
gameUpdate = true;
g_gameUpdateTime = timerGetHiTicks()-gameUpdateStartTime;
if (g_gameUpdateAvgTime < 0.f)
g_gameUpdateAvgTime = g_gameUpdateTime;
g_gameUpdateAvgTime = ((GAMEUPDATEAVGTIMENUMSAMPLES-1.f)*g_gameUpdateAvgTime+g_gameUpdateTime)/((float) GAMEUPDATEAVGTIMENUMSAMPLES);
G_DoCheats();
} }
gameUpdate = true;
g_gameUpdateTime = timerGetHiTicks()-gameUpdateStartTime;
if (g_gameUpdateAvgTime < 0.f)
g_gameUpdateAvgTime = g_gameUpdateTime;
g_gameUpdateAvgTime = ((GAMEUPDATEAVGTIMENUMSAMPLES-1.f)*g_gameUpdateAvgTime+g_gameUpdateTime)/((float) GAMEUPDATEAVGTIMENUMSAMPLES);
G_DoCheats();
if (g_player[myconnectindex].ps->gm & (MODE_EOL|MODE_RESTART)) if (g_player[myconnectindex].ps->gm & (MODE_EOL|MODE_RESTART))
{ {
switch (G_EndOfLevel()) switch (G_EndOfLevel())
@ -7531,8 +7499,11 @@ int G_DoMoveThings(void)
everyothertime++; everyothertime++;
if (g_earthquakeTime > 0) g_earthquakeTime--; if (g_earthquakeTime > 0) g_earthquakeTime--;
if (ud.pause_on == 0)
{
g_globalRandom = krand2(); g_globalRandom = krand2();
A_MoveDummyPlayers();//ST 13 A_MoveDummyPlayers();//ST 13
}
for (bssize_t TRAVERSE_CONNECT(i)) for (bssize_t TRAVERSE_CONNECT(i))
{ {
@ -7554,11 +7525,15 @@ int G_DoMoveThings(void)
if (!DEER) if (!DEER)
P_HandleSharedKeys(i); P_HandleSharedKeys(i);
if (ud.pause_on == 0)
{
P_ProcessInput(i); P_ProcessInput(i);
if (!DEER) if (!DEER)
P_CheckSectors(i); P_CheckSectors(i);
} }
}
if (ud.pause_on == 0)
G_MoveWorld(); G_MoveWorld();
Net_CorrectPrediction(); Net_CorrectPrediction();

View file

@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#endif #endif
#include "fix16.h" #include "fix16.h"
#include "gamedefs.h"
#include "gamedef.h" #include "gamedef.h"
#include "net.h" #include "net.h"
#include "mmulti.h" #include "mmulti.h"
@ -123,6 +122,8 @@ void A_DeleteSprite(int spriteNum);
#define MAX_RETURN_VALUES 6 #define MAX_RETURN_VALUES 6
// KEEPINSYNC lunatic/_defs_game.lua
typedef struct { typedef struct {
vec3_t camerapos; vec3_t camerapos;
int32_t const_visibility,uw_framerate; int32_t const_visibility,uw_framerate;
@ -312,7 +313,7 @@ static inline int32_t calc_smoothratio(ClockTicks totalclk, ClockTicks ototalclk
if (!(((!g_netServer && ud.multimode < 2) && ((g_player[myconnectindex].ps->gm & MODE_MENU) == 0)) || if (!(((!g_netServer && ud.multimode < 2) && ((g_player[myconnectindex].ps->gm & MODE_MENU) == 0)) ||
(g_netServer || ud.multimode > 1) || (g_netServer || ud.multimode > 1) ||
ud.recstat == 2) || ud.recstat == 2) ||
paused) ud.pause_on)
{ {
return 65536; return 65536;
} }

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "duke3d_ed.h" #include "duke3d.h"
#include "namesdyn.h" #include "namesdyn.h"
#include "gamedef.h" #include "gamedef.h"
#include "gameexec.h" #include "gameexec.h"

View file

@ -348,6 +348,7 @@ enum ScriptKeywords_t
CON_IFPUPWIND, // 166 CON_IFPUPWIND, // 166
CON_END CON_END
}; };
// KEEPINSYNC with the keyword list in lunatic/con_lang.lua
END_DUKE_NS END_DUKE_NS

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h" #include "compat.h"
#include "duke3d_ed.h" #include "duke3d.h"
#include "anim.h" #include "anim.h"
@ -261,8 +261,8 @@ GAMEEXEC_STATIC GAMEEXEC_INLINE void P_ForceAngle(DukePlayer_t *pPlayer)
pPlayer->q16horiz += F16(64); pPlayer->q16horiz += F16(64);
pPlayer->return_to_center = 9; pPlayer->return_to_center = 9;
pPlayer->q16rotscrnang = fix16_from_int(nAngle >> 1); pPlayer->rotscrnang = nAngle >> 1;
pPlayer->q16look_ang = pPlayer->q16rotscrnang; pPlayer->look_ang = pPlayer->rotscrnang;
} }
// wow, this function sucks // wow, this function sucks
@ -492,20 +492,6 @@ int32_t __fastcall G_GetAngleDelta(int32_t currAngle, int32_t newAngle)
return newAngle-currAngle; return newAngle-currAngle;
} }
fix16_t __fastcall G_GetQ16AngleDelta(fix16_t oldAngle, fix16_t newAngle)
{
if (fix16_abs(fix16_sub(oldAngle, newAngle)) < fix16_from_int(1024))
return fix16_sub(newAngle, oldAngle);
if (newAngle > fix16_from_int(1024))
newAngle = fix16_sub(newAngle, fix16_from_int(2048));
if (oldAngle > fix16_from_int(1024))
oldAngle = fix16_sub(oldAngle, fix16_from_int(2048));
return fix16_sub(newAngle, oldAngle);
}
GAMEEXEC_STATIC void VM_AlterAng(int32_t const moveFlags) GAMEEXEC_STATIC void VM_AlterAng(int32_t const moveFlags)
{ {
int const elapsedTics = (AC_COUNT(vm.pData))&31; int const elapsedTics = (AC_COUNT(vm.pData))&31;
@ -1916,8 +1902,14 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop)
continue; continue;
} }
insptr++; insptr++;
if (!RR || ((g_spriteExtra[vm.spriteNum] < 1 || g_spriteExtra[vm.spriteNum] == 128) && A_CheckSpriteFlags(vm.spriteNum, SFLAG_KILLCOUNT))) if (RR)
{
// This check does not exist in Duke Nukem.
if ((g_spriteExtra[vm.spriteNum] < 1 || g_spriteExtra[vm.spriteNum] == 128)
&& (!RR || A_CheckSpriteFlags(vm.spriteNum, SFLAG_KILLCOUNT)))
P_AddKills(pPlayer, *insptr); P_AddKills(pPlayer, *insptr);
}
else P_AddKills(pPlayer, *insptr);
insptr++; insptr++;
vm.pActor->actorstayput = -1; vm.pActor->actorstayput = -1;
continue; continue;

View file

@ -74,7 +74,6 @@ void A_Fall(int spriteNum);
int32_t A_GetFurthestAngle(int spriteNum, int angDiv); int32_t A_GetFurthestAngle(int spriteNum, int angDiv);
void A_GetZLimits(int spriteNum); void A_GetZLimits(int spriteNum);
int32_t __fastcall G_GetAngleDelta(int32_t currAngle, int32_t newAngle); int32_t __fastcall G_GetAngleDelta(int32_t currAngle, int32_t newAngle);
fix16_t __fastcall G_GetQ16AngleDelta(fix16_t oldAngle, fix16_t newAngle);
//void G_RestoreMapState(); //void G_RestoreMapState();
//void G_SaveMapState(); //void G_SaveMapState();

View file

@ -22,7 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "duke3d_ed.h" #include "duke3d.h"
#include "menus.h" #include "menus.h"
#include "savegame.h" #include "savegame.h"
#include "namesdyn.h" #include "namesdyn.h"
@ -654,18 +654,32 @@ static int32_t G_StaticToDynamicSound(int32_t const sound)
} }
} }
// Initialize WEAPONx_* gamevars. In C-CON, a new CON variable is defined together with // Initialize WEAPONx_* gamevars. Since for Lunatic, they reside on the C side,
// they're set directly. In C-CON, a new CON variable is defined together with
// its initial value. // its initial value.
#ifdef LUNATIC
# define ADDWEAPONVAR(Weapidx, Membname) do { \
int32_t j; \
for (j=0; j<MAXPLAYERS; j++) \
g_playerWeapon[j][Weapidx].Membname = weapondefaults[Weapidx].Membname; \
} while (0)
#else
# define ADDWEAPONVAR(Weapidx, Membname) do { \ # define ADDWEAPONVAR(Weapidx, Membname) do { \
FStringf aszBuf("WEAPON%d_" #Membname, Weapidx); \ FStringf aszBuf("WEAPON%d_" #Membname, Weapidx); \
aszBuf.ToUpper(); \ aszBuf.ToUpper(); \
Gv_NewVar(aszBuf, weapondefaults[Weapidx].Membname, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); \ Gv_NewVar(aszBuf, weapondefaults[Weapidx].Membname, GAMEVAR_PERPLAYER | GAMEVAR_SYSTEM); \
} while (0) } while (0)
#endif
// After CON translation, get not-overridden members from weapondefaults[] back // After CON translation, get not-overridden members from weapondefaults[] back
// into the live arrays! // into the live arrays! (That is, g_playerWeapon[][] for Lunatic, WEAPONx_*
// gamevars on the CON side in C-CON.)
#ifdef LUNATIC
# define POSTADDWEAPONVAR(Weapidx, Membname) ADDWEAPONVAR(Weapidx, Membname)
#else
// NYI // NYI
# define POSTADDWEAPONVAR(Weapidx, Membname) do {} while (0) # define POSTADDWEAPONVAR(Weapidx, Membname) do {} while (0)
#endif
// Finish a default weapon member after CON translation. If it was not // Finish a default weapon member after CON translation. If it was not
// overridden from CON itself (see example at g_weaponOverridden[]), we set // overridden from CON itself (see example at g_weaponOverridden[]), we set
@ -700,7 +714,9 @@ void Gv_FinalizeWeaponDefaults(void)
#undef FINISH_WEAPON_DEFAULT_X #undef FINISH_WEAPON_DEFAULT_X
#undef POSTADDWEAPONVAR #undef POSTADDWEAPONVAR
#if !defined LUNATIC
static int32_t lastvisinc; static int32_t lastvisinc;
#endif
static void Gv_AddSystemVars(void) static void Gv_AddSystemVars(void)
{ {
@ -754,15 +770,26 @@ static void Gv_AddSystemVars(void)
void Gv_Init(void) void Gv_Init(void)
{ {
#if !defined LUNATIC
// already initialized // already initialized
if (aGameVars[0].flags) if (aGameVars[0].flags)
return; return;
#else
static int32_t inited=0;
if (inited)
return;
inited = 1;
#endif
// Set up weapon defaults, g_playerWeapon[][]. // Set up weapon defaults, g_playerWeapon[][].
Gv_AddSystemVars(); Gv_AddSystemVars();
#if !defined LUNATIC
Gv_InitWeaponPointers(); Gv_InitWeaponPointers();
#endif
Gv_ResetSystemDefaults();
} }
#if !defined LUNATIC
void Gv_InitWeaponPointers(void) void Gv_InitWeaponPointers(void)
{ {
char aszBuf[64]; char aszBuf[64];
@ -826,5 +853,6 @@ void Gv_RefreshPointers(void)
aGameVars[Gv_GetVarIndex("RESPAWN_MONSTERS")].global = (intptr_t)&ud.respawn_monsters; aGameVars[Gv_GetVarIndex("RESPAWN_MONSTERS")].global = (intptr_t)&ud.respawn_monsters;
aGameVars[Gv_GetVarIndex("VOLUME")].global = (intptr_t)&ud.volume_number; aGameVars[Gv_GetVarIndex("VOLUME")].global = (intptr_t)&ud.volume_number;
} }
#endif
END_DUKE_NS END_DUKE_NS

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define global_c_ #define global_c_
#include "global.h" #include "global.h"
#include "duke3d_ed.h" #include "duke3d.h"
BEGIN_DUKE_NS BEGIN_DUKE_NS

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "build.h" #include "build.h"
#include "compat.h" #include "compat.h"
#include "duke3d_ed.h" #include "duke3d.h"
#include "mmulti.h" #include "mmulti.h"
#include "quotes.h" #include "quotes.h"
#include "sector.h" #include "sector.h"
@ -46,6 +46,7 @@ BEGIN_DUKE_NS
#endif #endif
#define MAXINTERPOLATIONS MAXSPRITES #define MAXINTERPOLATIONS MAXSPRITES
// KEEPINSYNC lunatic/con_lang.lua
// duke3d global soup :( // duke3d global soup :(
@ -66,7 +67,6 @@ enum DUKE3D_GLOBALFLAGS {
DUKE3D_NO_PALETTE_CHANGES = 1<<2, DUKE3D_NO_PALETTE_CHANGES = 1<<2,
}; };
G_EXTERN DukeStatus_t sbar;
G_EXTERN actor_t actor[MAXSPRITES]; G_EXTERN actor_t actor[MAXSPRITES];
// g_tile: tile-specific data THAT DOES NOT CHANGE during the course of a game // g_tile: tile-specific data THAT DOES NOT CHANGE during the course of a game
G_EXTERN tiledata_t g_tile[MAXTILES]; G_EXTERN tiledata_t g_tile[MAXTILES];

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "enet.h" #include "enet.h"
#endif #endif
#include "duke3d_ed.h" #include "duke3d.h"
#include "game.h" #include "game.h"
#include "gamedef.h" #include "gamedef.h"
#include "net.h" #include "net.h"

View file

@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "cheats.h" #include "cheats.h"
#include "cmdline.h" #include "cmdline.h"
#include "demo.h" // g_firstDemoFile[] #include "demo.h" // g_firstDemoFile[]
#include "duke3d_ed.h" #include "duke3d.h"
#include "menus.h" #include "menus.h"
#include "osdcmds.h" #include "osdcmds.h"
#include "savegame.h" #include "savegame.h"

File diff suppressed because it is too large Load diff

View file

@ -132,6 +132,7 @@ typedef struct {
// * char --> int8_t // * char --> int8_t
// Need to carefully think about implications! // Need to carefully think about implications!
// TODO: rearrange this if the opportunity arises! // TODO: rearrange this if the opportunity arises!
// KEEPINSYNC lunatic/_defs_game.lua
typedef struct { typedef struct {
vec3_t pos, opos, vel, npos; vec3_t pos, opos, vel, npos;
vec2_t bobpos, fric; vec2_t bobpos, fric;
@ -151,10 +152,9 @@ typedef struct {
int16_t loogiex[64], loogiey[64], sbs, sound_pitch; int16_t loogiex[64], loogiey[64], sbs, sound_pitch;
int16_t cursectnum, last_extra, subweapon; int16_t cursectnum, look_ang, last_extra, subweapon;
int16_t max_ammo_amount[MAX_WEAPONS], ammo_amount[MAX_WEAPONS], inv_amount[GET_MAX]; int16_t max_ammo_amount[MAX_WEAPONS], ammo_amount[MAX_WEAPONS], inv_amount[GET_MAX];
int16_t wackedbyactor, pyoff, opyoff; int16_t wackedbyactor, pyoff, opyoff;
fix16_t q16look_ang;
int16_t newowner, jumping_counter, airleft; int16_t newowner, jumping_counter, airleft;
int16_t fta, ftq, access_wallnum, access_spritenum; int16_t fta, ftq, access_wallnum, access_spritenum;
@ -163,12 +163,10 @@ typedef struct {
int16_t random_club_frame, one_eighty_count; int16_t random_club_frame, one_eighty_count;
int16_t dummyplayersprite, extra_extra8; int16_t dummyplayersprite, extra_extra8;
int16_t actorsqu, timebeforeexit, customexitsound, last_pissed_time; int16_t actorsqu, timebeforeexit, customexitsound, last_pissed_time;
fix16_t one_eighty_target;
int16_t weaprecs[MAX_WEAPON_RECS], weapon_sway, crack_time, bobcounter; int16_t weaprecs[MAX_WEAPON_RECS], weapon_sway, crack_time, bobcounter;
int16_t dead_flag; int16_t orotscrnang, rotscrnang, dead_flag; // JBF 20031220: added orotscrnang
fix16_t oq16rotscrnang, q16rotscrnang; // JBF 20031220: added orotscrnang
int16_t holoduke_on, pycount; int16_t holoduke_on, pycount;
int16_t transporter_hold/*, clipdist*/; int16_t transporter_hold/*, clipdist*/;
@ -212,7 +210,7 @@ typedef struct {
int16_t drink_amt, eat_amt, drink_ang, eat_ang; int16_t drink_amt, eat_amt, drink_ang, eat_ang;
int32_t drink_timer, eat_timer; int32_t drink_timer, eat_timer;
int16_t level_end_timer; int16_t level_end_timer;
int16_t moto_speed, moto_drink; int16_t moto_speed, tilt_status, moto_drink;
uint8_t on_motorcycle, on_boat, moto_underwater, not_on_water, moto_on_ground; uint8_t on_motorcycle, on_boat, moto_underwater, not_on_water, moto_on_ground;
uint8_t moto_do_bump, moto_bump_fast, moto_on_oil, moto_on_mud; uint8_t moto_do_bump, moto_bump_fast, moto_on_oil, moto_on_mud;
int16_t moto_bump, moto_bump_target, moto_turb; int16_t moto_bump, moto_bump_target, moto_turb;
@ -222,7 +220,6 @@ typedef struct {
int32_t drug_timer; int32_t drug_timer;
int32_t sea_sick; int32_t sea_sick;
uint8_t hurt_delay2, nocheat; uint8_t hurt_delay2, nocheat;
double tilt_status;
int32_t dhat60f, dhat613, dhat617, dhat61b, dhat61f; int32_t dhat60f, dhat613, dhat617, dhat61b, dhat61f;
@ -230,6 +227,7 @@ typedef struct {
int8_t padding_[3]; int8_t padding_[3];
} DukePlayer_t; } DukePlayer_t;
// KEEPINSYNC lunatic/_defs_game.lua
typedef struct typedef struct
{ {
DukePlayer_t *ps; DukePlayer_t *ps;
@ -237,10 +235,7 @@ typedef struct
bool horizRecenter; bool horizRecenter;
float horizAngleAdjust; float horizAngleAdjust;
int8_t horizSkew; fix16_t horizSkew;
bool lookLeft;
bool lookRight;
double lastInputTicks;
int32_t movefifoend, syncvalhead, myminlag; int32_t movefifoend, syncvalhead, myminlag;
int32_t pcolor, pteam; int32_t pcolor, pteam;
@ -253,6 +248,7 @@ typedef struct
} playerdata_t; } playerdata_t;
#pragma pack(pop) #pragma pack(pop)
// KEEPINSYNC lunatic/con_lang.lua
typedef struct typedef struct
{ {
// NOTE: the member names must be identical to aplWeapon* suffixes. // NOTE: the member names must be identical to aplWeapon* suffixes.
@ -274,6 +270,10 @@ typedef struct
int32_t FlashColor; // Muzzle flash color int32_t FlashColor; // Muzzle flash color
} weapondata_t; } weapondata_t;
#ifdef LUNATIC
# define PWEAPON(Player, Weapon, Wmember) (g_playerWeapon[Player][Weapon].Wmember)
extern weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS];
#else
# define PWEAPON(Player, Weapon, Wmember) (aplWeapon ## Wmember [Weapon][Player]) # define PWEAPON(Player, Weapon, Wmember) (aplWeapon ## Wmember [Weapon][Player])
extern intptr_t *aplWeaponClip[MAX_WEAPONS]; // number of items in clip extern intptr_t *aplWeaponClip[MAX_WEAPONS]; // number of items in clip
extern intptr_t *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire) extern intptr_t *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire)
@ -291,7 +291,9 @@ extern intptr_t *aplWeaponFireSound[MAX_WEAPONS]; // Sound made wh
extern intptr_t *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time extern intptr_t *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time
extern intptr_t *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID extern intptr_t *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID
extern intptr_t *aplWeaponFlashColor[MAX_WEAPONS]; // Color for polymer muzzle flash extern intptr_t *aplWeaponFlashColor[MAX_WEAPONS]; // Color for polymer muzzle flash
#endif
// KEEPINSYNC lunatic/_defs_game.lua
typedef struct { typedef struct {
int32_t cur, count; // "cur" is the only member that is *used* int32_t cur, count; // "cur" is the only member that is *used*
int32_t gunposx, lookhalfang; // weapon_xoffset, ps->look_ang>>1 int32_t gunposx, lookhalfang; // weapon_xoffset, ps->look_ang>>1

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "duke3d_ed.h" #include "duke3d.h"
#include "anim.h" #include "anim.h"
#include "menus.h" #include "menus.h"
#include "demo.h" #include "demo.h"
@ -812,7 +812,7 @@ void P_ResetPlayer(int playerNum)
pPlayer->fta = 0; pPlayer->fta = 0;
pPlayer->ftq = 0; pPlayer->ftq = 0;
pPlayer->vel.x = pPlayer->vel.y = 0; pPlayer->vel.x = pPlayer->vel.y = 0;
if (!RR) pPlayer->q16rotscrnang = 0; if (!RR) pPlayer->rotscrnang = 0;
pPlayer->runspeed = g_playerFriction; pPlayer->runspeed = g_playerFriction;
pPlayer->falling_counter = 0; pPlayer->falling_counter = 0;
@ -904,9 +904,9 @@ void P_ResetStatus(int playerNum)
pPlayer->heat_on = 0; pPlayer->heat_on = 0;
pPlayer->jetpack_on = 0; pPlayer->jetpack_on = 0;
pPlayer->holoduke_on = -1; pPlayer->holoduke_on = -1;
pPlayer->q16look_ang = fix16_from_int(512 - ((ud.level_number & 1) << 10)); pPlayer->look_ang = 512 - ((ud.level_number & 1) << 10);
pPlayer->q16rotscrnang = 0; pPlayer->rotscrnang = 0;
pPlayer->oq16rotscrnang = fix16_one; // JBF 20031220 pPlayer->orotscrnang = 1; // JBF 20031220
pPlayer->newowner = -1; pPlayer->newowner = -1;
pPlayer->jumping_counter = 0; pPlayer->jumping_counter = 0;
pPlayer->hard_landing = 0; pPlayer->hard_landing = 0;
@ -932,10 +932,6 @@ void P_ResetStatus(int playerNum)
pPlayer->movement_lock = 0; pPlayer->movement_lock = 0;
pPlayer->frag_ps = playerNum; pPlayer->frag_ps = playerNum;
g_player[playerNum].horizRecenter = 0;
g_player[playerNum].horizSkew = 0;
g_player[playerNum].horizAngleAdjust = 0;
P_UpdateScreenPal(pPlayer); P_UpdateScreenPal(pPlayer);
if (RR) if (RR)
@ -1150,7 +1146,7 @@ static void resetprestat(int playerNum, int gameMode)
g_animateCnt = 0; g_animateCnt = 0;
parallaxtype = 0; parallaxtype = 0;
randomseed = 17; randomseed = 17;
paused = 0; ud.pause_on = 0;
ud.camerasprite = -1; ud.camerasprite = -1;
ud.eog = 0; ud.eog = 0;
tempwallptr = 0; tempwallptr = 0;
@ -2289,7 +2285,7 @@ int G_EnterLevel(int gameMode)
//if (g_networkMode != NET_DEDICATED_SERVER) //if (g_networkMode != NET_DEDICATED_SERVER)
{ {
S_ResumeSound(false); S_PauseSounds(false);
FX_StopAllSounds(); FX_StopAllSounds();
S_ClearSoundLocks(); S_ClearSoundLocks();
FX_SetReverb(0); FX_SetReverb(0);
@ -2464,9 +2460,6 @@ int G_EnterLevel(int gameMode)
P_UpdateScreenPal(g_player[myconnectindex].ps); P_UpdateScreenPal(g_player[myconnectindex].ps);
renderFlushPerms(); renderFlushPerms();
// reset lastInputTicks.
g_player[myconnectindex].lastInputTicks = 0;
everyothertime = 0; everyothertime = 0;
g_globalRandom = 0; g_globalRandom = 0;

View file

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h" #include "compat.h"
#include "baselayer.h" #include "baselayer.h"
#include "duke3d_ed.h" #include "duke3d.h"
#include "sounds.h" #include "sounds.h"
#include "i_time.h" #include "i_time.h"
#include "files.h" #include "files.h"

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "duke3d_ed.h" #include "duke3d.h"
#include "premap.h" #include "premap.h"
#include "prlights.h" #include "prlights.h"
#include "savegame.h" #include "savegame.h"
@ -183,7 +183,7 @@ int32_t G_LoadPlayer(const char *path)
// some setup first // some setup first
ud.multimode = h.numplayers; ud.multimode = h.numplayers;
S_PauseSound(true, false); S_PauseSounds(true);
if (numplayers > 1) if (numplayers > 1)
{ {
@ -834,7 +834,7 @@ static const dataspec_t svgm_udnetw[] =
{ DS_NOCHK, &ud.ffire, sizeof(ud.ffire), 1 }, { DS_NOCHK, &ud.ffire, sizeof(ud.ffire), 1 },
{ DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 }, { DS_NOCHK, &ud.noexits, sizeof(ud.noexits), 1 },
{ DS_NOCHK, &ud.playerai, sizeof(ud.playerai), 1 }, { DS_NOCHK, &ud.playerai, sizeof(ud.playerai), 1 },
{ 0, &paused, sizeof(paused), 1 }, { 0, &ud.pause_on, sizeof(ud.pause_on), 1 },
{ 0, connectpoint2, sizeof(connectpoint2), 1 }, { 0, connectpoint2, sizeof(connectpoint2), 1 },
{ 0, &randomseed, sizeof(randomseed), 1 }, { 0, &randomseed, sizeof(randomseed), 1 },
{ 0, &g_globalRandom, sizeof(g_globalRandom), 1 }, { 0, &g_globalRandom, sizeof(g_globalRandom), 1 },

File diff suppressed because it is too large Load diff

View file

@ -30,9 +30,6 @@ static FORCE_INLINE int32_t sbarsc(int32_t sc)
return scale(sc, ud.statusbarscale, 100); return scale(sc, ud.statusbarscale, 100);
} }
int32_t sbarx16(int32_t x);
int32_t sbarxr16(int32_t x);
int32_t sbary16(int32_t y);
void G_DrawInventory(const DukePlayer_t *p); void G_DrawInventory(const DukePlayer_t *p);
void G_DrawStatusBar(int32_t snum); void G_DrawStatusBar(int32_t snum);

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "duke3d_ed.h" #include "duke3d.h"
#include "compat.h" #include "compat.h"
#include "screens.h" #include "screens.h"
@ -765,7 +765,7 @@ void G_DisplayRest(int32_t smoothratio)
if (ud.scrollmode == 0) if (ud.scrollmode == 0)
{ {
if (pp->newowner == -1 && !paused) if (pp->newowner == -1 && !ud.pause_on)
{ {
if (screenpeek == myconnectindex && numplayers > 1) if (screenpeek == myconnectindex && numplayers > 1)
{ {
@ -789,7 +789,7 @@ void G_DisplayRest(int32_t smoothratio)
} }
else else
{ {
if (!paused) if (!ud.pause_on)
{ {
ud.fola += ud.folavel>>3; ud.fola += ud.folavel>>3;
ud.folx += (ud.folfvel*sintable[(512+2048-ud.fola)&2047])>>14; ud.folx += (ud.folfvel*sintable[(512+2048-ud.fola)&2047])>>14;
@ -822,7 +822,6 @@ void G_DisplayRest(int32_t smoothratio)
} }
} }
if (pp->invdisptime > 0) G_DrawInventory(pp);
//if (VM_OnEvent(EVENT_DISPLAYSBAR, g_player[screenpeek].ps->i, screenpeek) == 0) //if (VM_OnEvent(EVENT_DISPLAYSBAR, g_player[screenpeek].ps->i, screenpeek) == 0)
G_DrawStatusBar(screenpeek); G_DrawStatusBar(screenpeek);
@ -844,12 +843,12 @@ void G_DisplayRest(int32_t smoothratio)
if (!DEER && g_player[myconnectindex].ps->newowner == -1 && ud.overhead_on == 0 && cl_crosshair && ud.camerasprite == -1) if (!DEER && g_player[myconnectindex].ps->newowner == -1 && ud.overhead_on == 0 && cl_crosshair && ud.camerasprite == -1)
{ {
int32_t a = CROSSHAIR; int32_t a = CROSSHAIR;
//ud.returnvar[0] = (160<<16) - (fix16_to_int(g_player[myconnectindex].ps->q16look_ang)<<15); //ud.returnvar[0] = (160<<16) - (g_player[myconnectindex].ps->look_ang<<15);
//ud.returnvar[1] = 100<<16; //ud.returnvar[1] = 100<<16;
//int32_t a = VM_OnEventWithReturn(EVENT_DISPLAYCROSSHAIR, g_player[screenpeek].ps->i, screenpeek, CROSSHAIR); //int32_t a = VM_OnEventWithReturn(EVENT_DISPLAYCROSSHAIR, g_player[screenpeek].ps->i, screenpeek, CROSSHAIR);
if ((unsigned) a < MAXTILES) if ((unsigned) a < MAXTILES)
{ {
vec2_t crosshairpos = { (160<<16) - (fix16_to_int(g_player[myconnectindex].ps->q16look_ang)<<15), 100<<16 }; vec2_t crosshairpos = { (160<<16) - (g_player[myconnectindex].ps->look_ang<<15), 100<<16 };
//vec2_t crosshairpos = { ud.returnvar[0], ud.returnvar[1] }; //vec2_t crosshairpos = { ud.returnvar[0], ud.returnvar[1] };
uint32_t crosshair_o = 1|2; uint32_t crosshair_o = 1|2;
uint32_t crosshair_scale = divscale16(cl_crosshairscale, 100); uint32_t crosshair_scale = divscale16(cl_crosshairscale, 100);
@ -869,10 +868,10 @@ void G_DisplayRest(int32_t smoothratio)
} }
*/ */
if (paused==1 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0) if (ud.pause_on==1 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
menutext_center(100, GStrings("Game Paused")); menutext_center(100, GStrings("Game Paused"));
mdpause = (paused || (ud.recstat==2 && (g_demo_paused && g_demo_goalCnt==0)) || (g_player[myconnectindex].ps->gm&MODE_MENU && numplayers < 2)); mdpause = (ud.pause_on || (ud.recstat==2 && (g_demo_paused && g_demo_goalCnt==0)) || (g_player[myconnectindex].ps->gm&MODE_MENU && numplayers < 2));
// JBF 20040124: display level stats in screen corner // JBF 20040124: display level stats in screen corner
if (ud.overhead_on != 2 && hud_stats) // && VM_OnEvent(EVENT_DISPLAYLEVELSTATS, g_player[screenpeek].ps->i, screenpeek) == 0) if (ud.overhead_on != 2 && hud_stats) // && VM_OnEvent(EVENT_DISPLAYLEVELSTATS, g_player[screenpeek].ps->i, screenpeek) == 0)

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define sector_c_ #define sector_c_
#include "duke3d_ed.h" #include "duke3d.h"
#include "secrets.h" #include "secrets.h"
#include "v_video.h" #include "v_video.h"
@ -503,21 +503,26 @@ int SetAnimation(int sectNum, int32_t *animPtr, int goalVal, int animVel)
static void G_SetupCamTile(int spriteNum, int tileNum, int smoothRatio) static void G_SetupCamTile(int spriteNum, int tileNum, int smoothRatio)
{ {
vec3_t const camera = G_GetCameraPosition(spriteNum, smoothRatio); vec3_t const camera = G_GetCameraPosition(spriteNum, smoothRatio);
int const saveMirror = display_mirror; int const saveMirror = display_mirror;
renderSetTarget(tileNum, tilesiz[tileNum].y, tilesiz[tileNum].x); auto canvas = renderSetTarget(tileNum);
if (!canvas) return;
yax_preparedrawrooms(); screen->RenderTextureView(canvas, [=](IntRect& rect)
drawrooms(camera.x, camera.y, camera.z, SA(spriteNum), 100 + sprite[spriteNum].shade, SECT(spriteNum)); {
yax_drawrooms(G_DoSpriteAnimations, SECT(spriteNum), 0, smoothRatio); yax_preparedrawrooms();
drawrooms(camera.x, camera.y, camera.z, SA(spriteNum), 100 + sprite[spriteNum].shade, SECT(spriteNum));
yax_drawrooms(G_DoSpriteAnimations, SECT(spriteNum), 0, smoothRatio);
display_mirror = 3; display_mirror = 3;
G_DoSpriteAnimations(camera.x, camera.y, camera.z, SA(spriteNum), smoothRatio); G_DoSpriteAnimations(camera.x, camera.y, camera.z, SA(spriteNum), smoothRatio);
display_mirror = saveMirror; display_mirror = saveMirror;
renderDrawMasks(); renderDrawMasks();
});
renderRestoreTarget(); renderRestoreTarget();
} }
void G_AnimateCamSprite(int smoothRatio) void G_AnimateCamSprite(int smoothRatio)
@ -3647,7 +3652,29 @@ void P_HandleSharedKeys(int playerNum)
{ {
pPlayer->interface_toggle_flag = 1; pPlayer->interface_toggle_flag = 1;
if (paused) return; if (TEST_SYNC_KEY(playerBits, SK_PAUSE))
{
inputState.ClearKeyStatus(sc_Pause);
if (ud.pause_on)
ud.pause_on = 0;
else ud.pause_on = 1+SHIFTS_IS_PRESSED;
if (ud.pause_on)
{
Mus_SetPaused(true);
S_PauseSounds(true);
}
else
{
Mus_SetPaused(false);
S_PauseSounds(false);
pub = NUMPAGES;
pus = NUMPAGES;
}
}
if (ud.pause_on) return;
if (sprite[pPlayer->i].extra <= 0) return; // if dead... if (sprite[pPlayer->i].extra <= 0) return; // if dead...
@ -4225,10 +4252,7 @@ rrtripbomb_case:
if (TEST_SYNC_KEY(playerBits, SK_TURNAROUND) && pPlayer->one_eighty_count == 0) if (TEST_SYNC_KEY(playerBits, SK_TURNAROUND) && pPlayer->one_eighty_count == 0)
if (VM_OnEvent(EVENT_TURNAROUND,pPlayer->i,playerNum) == 0) if (VM_OnEvent(EVENT_TURNAROUND,pPlayer->i,playerNum) == 0)
{ pPlayer->one_eighty_count = -1024;
pPlayer->one_eighty_count = -1024;
pPlayer->one_eighty_target = fix16_sadd(pPlayer->q16ang, -fix16_from_int(pPlayer->one_eighty_count)) & 0x7FFFFFF;
}
} }
} }

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h" #include "compat.h"
#include "duke3d_ed.h" #include "duke3d.h"
#include "raze_music.h" #include "raze_music.h"
#include "mapinfo.h" #include "mapinfo.h"
#include "raze_sound.h" #include "raze_sound.h"
@ -79,6 +79,17 @@ TArray<uint8_t> DukeSoundEngine::ReadSound(int lumpnum)
// //
//========================================================================== //==========================================================================
void S_PauseSounds(bool paused)
{
soundEngine->SetPaused(paused);
}
//==========================================================================
//
//
//
//==========================================================================
void cacheAllSounds(void) void cacheAllSounds(void)
{ {
auto& sfx = soundEngine->GetSounds(); auto& sfx = soundEngine->GetSounds();
@ -86,6 +97,8 @@ void cacheAllSounds(void)
for(auto &snd : sfx) for(auto &snd : sfx)
{ {
soundEngine->CacheSound(&snd); soundEngine->CacheSound(&snd);
if (((++i)&31) == 0)
G_HandleAsync();
} }
} }

View file

@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_DUKE_NS BEGIN_DUKE_NS
// KEEPINSYNC lunatic/con_lang.lua
#define MAXSOUNDS 4096 #define MAXSOUNDS 4096
#define LOUDESTVOLUME 111 #define LOUDESTVOLUME 111
@ -56,6 +57,8 @@ inline int S_CheckSoundPlaying(int sprnum, int soundNum) { return S_CheckSoundPl
inline void S_ClearSoundLocks(void) {} inline void S_ClearSoundLocks(void) {}
void cacheAllSounds(void); void cacheAllSounds(void);
void S_MenuSound(void); void S_MenuSound(void);
void S_PauseMusic(bool paused);
void S_PauseSounds(bool paused);
void S_PlayLevelMusicOrNothing(unsigned int); void S_PlayLevelMusicOrNothing(unsigned int);
int S_TryPlaySpecialMusic(unsigned int); int S_TryPlaySpecialMusic(unsigned int);
void S_PlaySpecialMusicOrNothing(unsigned int); void S_PlaySpecialMusicOrNothing(unsigned int);

View file

@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "ns.h" // Must come before everything else! #include "ns.h" // Must come before everything else!
#include "duke3d_ed.h" #include "duke3d.h"
#include "compat.h" #include "compat.h"
#include "sbar.h" #include "sbar.h"
#include "menus.h" #include "menus.h"
@ -112,6 +112,23 @@ vec2_t mpgametextsize(const char *t, int32_t f)
return G_ScreenTextSize(MF_Bluefont.tilenum, 0, 0, textsc(MF_Bluefont.zoom), 0, t, 2|8|16|ROTATESPRITE_FULL16, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f, 0, 0, xdim-1, ydim-1); return G_ScreenTextSize(MF_Bluefont.tilenum, 0, 0, textsc(MF_Bluefont.zoom), 0, t, 2|8|16|ROTATESPRITE_FULL16, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f, 0, 0, xdim-1, ydim-1);
} }
static int32_t sbarx16(int32_t x)
{
if (ud.screen_size == 4) return sbarsc(x);
return (((320 << 16) - sbarsc(320 << 16)) >> 1) + sbarsc(x);
}
static int32_t sbarxr16(int32_t x)
{
if (ud.screen_size == 4) return (320 << 16) - sbarsc(x);
return (((320 << 16) - sbarsc(320 << 16)) >> 1) + sbarsc(x);
}
static int32_t sbary16(int32_t y)
{
return (100 << 16) - sbarsc(200 << 16) + sbarsc(y);
}
// minitext_yofs: in hud_scale-independent, (<<16)-scaled, 0-200-normalized y coords, // minitext_yofs: in hud_scale-independent, (<<16)-scaled, 0-200-normalized y coords,
// (sb&ROTATESPRITE_MAX) only. // (sb&ROTATESPRITE_MAX) only.
int32_t minitext_yofs = 0; int32_t minitext_yofs = 0;

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B