Browse Source

la grande stringening 17: improved prefixes

tags/1.6.1
Alison Watson 2 years ago
parent
commit
7e84b21151
30 changed files with 119 additions and 132 deletions
  1. +22
    -12
      source/Headers/lith_common.h
  2. +2
    -2
      source/Headers/lith_player.h
  3. +1
    -1
      source/Headers/lith_upgrades.h
  4. +2
    -2
      source/Headers/lith_world.h
  5. +3
    -3
      source/Main/g_auto.c
  6. +3
    -3
      source/Main/p_cbigui.c
  7. +2
    -2
      source/Main/p_data.c
  8. +2
    -4
      source/Main/p_gui_bip.c
  9. +3
    -9
      source/Main/p_gui_upgrades.c
  10. +5
    -5
      source/Main/p_hud.c
  11. +4
    -4
      source/Main/p_log.c
  12. +1
    -1
      source/Main/p_magic.c
  13. +4
    -8
      source/Main/p_notes.c
  14. +1
    -1
      source/Main/p_payout.c
  15. +2
    -2
      source/Main/p_pickups.c
  16. +6
    -6
      source/Main/p_render.c
  17. +2
    -2
      source/Main/p_savedata.c
  18. +2
    -5
      source/Main/p_shop.c
  19. +1
    -1
      source/Main/p_shopdef.c
  20. +2
    -2
      source/Main/u_headsupdisp.c
  21. +4
    -4
      source/Main/u_magic.c
  22. +1
    -1
      source/Main/u_reactarmor.c
  23. +2
    -2
      source/Main/u_riflemodes.c
  24. +7
    -7
      source/Main/u_vitalscan.c
  25. +4
    -9
      source/Main/u_zoom.c
  26. +2
    -2
      source/Main/w_data.c
  27. +1
    -2
      source/Main/w_dialogue.c
  28. +2
    -2
      source/Main/w_time.c
  29. +1
    -3
      source/Main/w_title.c
  30. +25
    -25
      source/Main/w_world.c

+ 22
- 12
source/Headers/lith_common.h View File

@@ -61,26 +61,36 @@
#define Lith_IsPaused ServCallI(s"GetPaused")
#define Lith_PausableTick() do ACS_Delay(1); while(Lith_IsPaused)

#define ServName OBJ "HERMES"
#define DrawName OBJ "URANUS"
#define ServName sOBJ "HERMES"
#define DrawName sOBJ "URANUS"

#define CVAR s"lith_"
#define DCVAR s"__lith_"
#define OBJ s"Lith_"
#define LANG "LITH_"
#define CVAR "lith_"
#define DCVAR "__lith_"
#define LANG "LITH_"
#define OBJ "Lith_"
#else
#define Lith_IsPaused false
#define Lith_PausableTick()

#define ServName OBJ "Server"
#define DrawName OBJ "Render"
#define ServName sOBJ "Server"
#define DrawName sOBJ "Render"

#define CVAR s"dtap_"
#define DCVAR s"__dtap_"
#define OBJ s"Dt"
#define LANG "DTAP_"
#define OBJ "Dt"
#define CVAR "dtap_"
#define DCVAR "__dtap_"
#define LANG "DTAP_"
#endif

#define cCVAR c"" CVAR
#define cDCVAR c"" DCVAR
#define cLANG c"" LANG
#define cOBJ c"" OBJ

#define sCVAR s"" CVAR
#define sDCVAR s"" DCVAR
#define sLANG s"" LANG
#define sOBJ s"" OBJ

#define ServCallI(...) SCallI(ServName, __VA_ARGS__)
#define ServCallK(...) SCallK(ServName, __VA_ARGS__)
#define ServCallS(...) SCallS(ServName, __VA_ARGS__)


+ 2
- 2
source/Headers/lith_player.h View File

@@ -170,8 +170,8 @@ struct player
__prop weapontype {get: Lith_PlayerCurWeaponType(this)}
__prop buttonPressed {call: Lith_ButtonPressed(this)}
__prop setVel {call: Lith_SetPlayerVelocity(this)}
__prop mana {get: Lith_CheckActorInventory(->tid, OBJ "MagicAmmo")}
__prop manamax {get: ACS_GetMaxInventory(->tid, OBJ "MagicAmmo")}
__prop mana {get: Lith_CheckActorInventory(->tid, sOBJ "MagicAmmo")}
__prop manamax {get: ACS_GetMaxInventory(->tid, sOBJ "MagicAmmo")}
__prop validateTID {call: Lith_ValidatePlayerTID(this)}
__prop health {get: GetPropI(->tid, APROP_Health),
set: SetPropI(->tid, APROP_Health)}


+ 1
- 1
source/Headers/lith_upgrades.h View File

@@ -9,7 +9,7 @@
#include "lith_list.h"

#define Lith_UpgrBuy(p, upgr, ...) \
p->buy(&(upgr)->info->shopdef, (upgr), s"" LANG "UPGRADE_TITLE_%S", __VA_ARGS__)
p->buy(&(upgr)->info->shopdef, (upgr), sLANG "UPGRADE_TITLE_%S", __VA_ARGS__)

#define ForUpgrade(name) \
for(int _i = 0; _i < p->upgrmax; _i++) \


+ 2
- 2
source/Headers/lith_world.h View File

@@ -72,11 +72,11 @@ typedef struct worldinfo_s
__prop canontime {get: Lith_CanonTime(CANONTIME_FULL)}
__prop canontimeshort {get: Lith_CanonTime(CANONTIME_SHORT)}
__prop canondate {get: Lith_CanonTime(CANONTIME_DATE)}
__prop difficulty {get: ACS_GetCVar(CVAR "sv_difficulty")}
__prop difficulty {get: ACS_GetCVar(sCVAR "sv_difficulty")}
__prop begAngles {call: Lith_BeginAngles()}
__prop addAngles {call: Lith_AddAngle()}
__prop freeze {call: Lith_FreezeTime()}
__prop autosave {get: ACS_GetCVar(CVAR "sv_autosave")}
__prop autosave {get: ACS_GetCVar(sCVAR "sv_autosave")}

bool gsinit;
bool singleplayer;


+ 3
- 3
source/Main/g_auto.c View File

@@ -41,7 +41,7 @@ void Lith_GUI_Init(gui_state_t *g, void *state)
stkcall
void Lith_GUI_UpdateState(gui_state_t *g, struct player *p)
{
bool inverted = p->getCVarI(CVAR "player_invertmouse");
bool inverted = p->getCVarI(sCVAR "player_invertmouse");

// Due to ZDoom being ZDoom, GetUserCVar with invertmouse does nothing.
// This breaks network sync so we can only do it in singleplayer.
@@ -50,8 +50,8 @@ void Lith_GUI_UpdateState(gui_state_t *g, struct player *p)

g->old = g->cur;

fixed xmul = p->getCVarK(CVAR "gui_xmul");
fixed ymul = p->getCVarK(CVAR "gui_ymul");
fixed xmul = p->getCVarK(sCVAR "gui_xmul");
fixed ymul = p->getCVarK(sCVAR "gui_ymul");

g->cx -= p->yawv * (800.0lk * xmul);
if(inverted) g->cy += p->pitchv * (800.0lk * ymul);


+ 3
- 3
source/Main/p_cbigui.c View File

@@ -1,4 +1,4 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
// Copyright © 2016-2018 Alison Sanderson, all rights reserved.
#include "lith_common.h"
#include "lith_player.h"
#include "lith_hudid.h"
@@ -96,7 +96,7 @@ void Lith_PlayerUpdateCBIGUI(struct player *p)

gui_state_t *g = &p->cbi.guistate;

p->cbi.theme = p->getCVarI(CVAR "gui_theme");
p->cbi.theme = p->getCVarI(sCVAR "gui_theme");

if(p->cbi.theme != p->cbi.oldtheme)
{
@@ -135,7 +135,7 @@ void Lith_PlayerUpdateCBIGUI(struct player *p)
case cbi_tab_settings: Lith_CBITab_Settings(g, p); break;
}

Lith_GUI_End(g, p->getCVarI(CVAR "gui_cursor"));
Lith_GUI_End(g, p->getCVarI(sCVAR "gui_cursor"));
}

void Lith_PlayerResetCBIGUI(struct player *p)


+ 2
- 2
source/Main/p_data.c View File

@@ -204,7 +204,7 @@ void Lith_GiveEXP(struct player *p, u64 amt)
a->level++;
a->expnext = 500 + (a->level * powlk(1.385, a->level * 0.2) * 340);

__with(int pts = 7;) switch(p->getCVarI(CVAR "player_lvsys"))
__with(int pts = 7;) switch(p->getCVarI(sCVAR "player_lvsys"))
{
case atsys_manual: a->points += 7; break;
case atsys_hybrid:
@@ -328,7 +328,7 @@ void Lith_ResetPlayer(struct player *p)
PrintDmonAllocSize(p);
#endif
} else {
p->logH(1, L(LANG "LOG_StartGame"), CVAR "k_opencbi");
p->logH(1, L(LANG "LOG_StartGame"), sCVAR "k_opencbi");
}

p->deliverMail("Intro");


+ 2
- 4
source/Main/p_gui_bip.c View File

@@ -48,19 +48,17 @@ void Lith_CBITab_BIP(gui_state_t *g, struct player *p)
PrintTextA("cbifont", CR_WHITE, 105,1, 85+n + i*10,1, 0.7);
}

#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, LC(LANG "BIP_NAME_Search"), 45, 85 + n, Pre(btnbipmain)))
if(Lith_GUI_Button(g, LC(cLANG "BIP_NAME_Search"), 45, 85 + n, Pre(btnbipmain)))
bip->curcategory = BIPC_SEARCH;
n += 10;
#define LITH_X(name, capt) \
if(Lith_GUI_Button_Id(g, BIPC_##name, LC(LANG "BIP_NAME_" capt), 45, 85 + n, Pre(btnbipmain))) \
if(Lith_GUI_Button_Id(g, BIPC_##name, LC(cLANG "BIP_NAME_" capt), 45, 85 + n, Pre(btnbipmain))) \
{ \
bip->curcategory = BIPC_##name; \
bip->curpage = null; \
} \
n += 10;
#include "lith_bip.h"
#pragma GDCC STRENT_LITERAL ON

avail = bip->pageavail;
max = bip->pagemax;


+ 3
- 9
source/Main/p_gui_upgrades.c View File

@@ -75,9 +75,7 @@ static void GUIUpgradesList(gui_state_t *g, struct player *p)
else if(upgr->owned) preset = &guipre.btnlistactive;
else preset = &guipre.btnlistsel;

#pragma GDCC STRENT_LITERAL OFF
char *name = LanguageC(LANG "UPGRADE_TITLE_%S", upgr->info->name);
#pragma GDCC STRENT_LITERAL ON
char *name = LanguageC(cLANG "UPGRADE_TITLE_%S", upgr->info->name);

int *upgrsel = &CBIState(g)->upgrsel;
if(Lith_GUI_Button_Id(g, i, name, 0, y, i == *upgrsel, .color = color, .preset = preset))
@@ -180,15 +178,11 @@ static void GUIUpgradeDescription(gui_state_t *g, struct player *p, upgrade_t *u

static void GUIUpgradeButtons(gui_state_t *g, struct player *p, upgrade_t *upgr)
{
#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, LC(LANG "BUY"), 111, 205, !p->canBuy(&upgr->info->shopdef, upgr)))
#pragma GDCC STRENT_LITERAL ON
if(Lith_GUI_Button(g, LC(cLANG "BUY"), 111, 205, !p->canBuy(&upgr->info->shopdef, upgr)))
Lith_UpgrBuy(p, upgr, false);

#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, upgr->active ? LC(LANG "DEACTIVATE") : LC(LANG "ACTIVATE"), 111 + guipre.btndef.w + 2, 205, !upgr->canUse(p)))
if(Lith_GUI_Button(g, upgr->active ? LC(cLANG "DEACTIVATE") : LC(cLANG "ACTIVATE"), 111 + guipre.btndef.w + 2, 205, !upgr->canUse(p)))
upgr->toggle(p);
#pragma GDCC STRENT_LITERAL ON
}

void Lith_CBITab_Upgrades(gui_state_t *g, struct player *p)


+ 5
- 5
source/Main/p_hud.c View File

@@ -9,7 +9,7 @@ StrEntON

void Lith_HUD_WeaponSlots_Impl(struct player *p, struct hud_wsl const *a)
{
if(p->getCVarI(CVAR "hud_showweapons"))
if(p->getCVarI(sCVAR "hud_showweapons"))
for(int i = 1; i < SLOT_MAX; i++)
ifauto(int, slot, p->weapon.slot[i])
{
@@ -32,7 +32,7 @@ void Lith_HUD_WeaponSlots_Impl(struct player *p, struct hud_wsl const *a)

void Lith_HUD_Score(struct player *p, __str fmt, i96 scrn, __str font, __str cr, int x, int xa, int y, int ya)
{
if(p->getCVarI(CVAR "hud_showscore"))
if(p->getCVarI(sCVAR "hud_showscore"))
{
__str scr = StrParam(fmt, scoresep(scrn));

@@ -52,12 +52,12 @@ void Lith_HUD_Score(struct player *p, __str fmt, i96 scrn, __str font, __str cr,

if(CheckFade(fid_schit1))
{
PrintTextFmt("%S", scr);
PrintTextStr(scr);
PrintTextFX(font, CR_ORANGE, x,xa, y,ya, fid_schit1);
}
else if(CheckFade(fid_schit2))
{
PrintTextFmt("%S", scr);
PrintTextStr(scr);
PrintTextFX(font, CR_PURPLE, x,xa, y,ya, fid_schit2);
}

@@ -68,7 +68,7 @@ void Lith_HUD_Score(struct player *p, __str fmt, i96 scrn, __str font, __str cr,
}
}

if(p->getCVarI(CVAR "hud_showlvl"))
if(p->getCVarI(sCVAR "hud_showlvl"))
{
PrintTextFmt("\C%SLv.%u", cr, p->attr.level);
if(p->attr.points) __nprintf_str(" (%u pts)", p->attr.points);


+ 4
- 4
source/Main/p_log.c View File

@@ -118,7 +118,7 @@ void Lith_LogS(int levl, int type)
if(name[0] == '_') name = Language(LANG "LOG%S", name);

withplayer(LocalPlayer) switch(type) {
case msg_ammo: if(p->getCVarI(CVAR "player_ammolog"))
case msg_ammo: if(p->getCVarI(sCVAR "player_ammolog"))
case msg_huds: p->logH(levl, "%S", name); break;
case msg_full: p->logF( "%S", name); break;
case msg_both: p->logB(levl, "%S", name); break;
@@ -177,11 +177,11 @@ void Lith_CBITab_Log(gui_state_t *g, struct player *p)
script
void Lith_HUD_Log(struct player *p, int cr, int x, int yy)
{
if(p->getCVarI(CVAR "hud_showlog"))
if(p->getCVarI(sCVAR "hud_showlog"))
{
int yo;

if(p->getCVarI(CVAR "hud_logbig")) {yo = 200; SetSize(320, 240);}
if(p->getCVarI(sCVAR "hud_logbig")) {yo = 200; SetSize(320, 240);}
else {yo = 255; SetSize(480, 300);}

int i = 0;
@@ -192,7 +192,7 @@ void Lith_HUD_Log(struct player *p, int cr, int x, int yy)
int y = 10 * i;
int ya;

if(p->getCVarI(CVAR "hud_logfromtop"))
if(p->getCVarI(sCVAR "hud_logfromtop"))
{ya = 1; y = 20 + y;}
else
{ya = 2; y = (yo - y) + yy;}


+ 1
- 1
source/Main/p_magic.c View File

@@ -166,7 +166,7 @@ void Lith_MagicSelect(int num)
{
withplayer(LocalPlayer)
{
if(!p->getCVarI(CVAR "weapons_magicselanims")) return;
if(!p->getCVarI(sCVAR "weapons_magicselanims")) return;

switch(num)
{


+ 4
- 8
source/Main/p_notes.c View File

@@ -14,10 +14,8 @@ void Lith_CBITab_Notes(gui_state_t *g, struct player *p)
PrintText("cbifont", CR_WHITE, 32,2, 40,0);
Lith_GUI_BasicCheckbox(g, &CBIState(g)->noteedit, 39, 40);

#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, LC(LANG "CLEAR"), 16, 48, Pre(btnclear)))
if(Lith_GUI_Button(g, LC(cLANG "CLEAR"), 16, 48, Pre(btnclear)))
Lith_GUI_TextBox_Reset(st);
#pragma GDCC STRENT_LITERAL ON

Lith_GUI_ScrollBegin(g, &CBIState(g)->notescr, 15, 63, 280, 160, 30 * countof(p->notes), 240);

@@ -27,12 +25,10 @@ void Lith_CBITab_Notes(gui_state_t *g, struct player *p)
continue;

PrintTextFmt(L(LANG "NOTE_FMT"), i + 1);
PrintText("cbifont", CR_WHITE, 32+g->ox,2, i * 30 + g->oy,1);
PrintText("cbifont", CR_WHITE, g->ox+2,1, i * 30 + g->oy,1);

#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button_Id(g, i, p->notes[i] ? p->notes[i] : LC(LANG "EMPTY"),
37, i * 30, .disabled = !CBIState(g)->noteedit, Pre(btnnote)))
#pragma GDCC STRENT_LITERAL ON
if(Lith_GUI_Button_Id(g, i, p->notes[i] ? p->notes[i] : LC(cLANG "EMPTY"),
44, i * 30, .disabled = !CBIState(g)->noteedit, Pre(btnnote)))
{
int l = CBIState(g)->notebox.tbptr;
char const *s = Lith_CPS_Print(CBIState(g)->notebox.txtbuf, l);


+ 1
- 1
source/Main/p_payout.c View File

@@ -81,7 +81,7 @@ void Lith_PlayerPayout(struct player *p)
Left("Primary Account"); Right("%STRANSACTION CLOSED", (i % 6) == 0 ? "\Cn" : "");
}

if(p->getCVarI(CVAR "player_resultssound"))
if(p->getCVarI(sCVAR "player_resultssound"))
{
if(counting) {
if(i < 35) ACS_LocalAmbientSound("player/counter", 80);


+ 2
- 2
source/Main/p_pickups.c View File

@@ -61,7 +61,7 @@ static void Lith_StupidPickup(struct player *p, int weapon)

void Lith_PickupMessage(struct player *p, weaponinfo_t const *info)
{
if(p->getCVarI(CVAR "player_stupidpickups"))
if(p->getCVarI(sCVAR "player_stupidpickups"))
Lith_StupidPickup(p, info->type);
else if(info->name)
p->logB(1, L(LANG "PK_GET_000"), Language(LANG "INFO_SHORT_%S", info->name));
@@ -76,7 +76,7 @@ void Lith_SellMessage(struct player *p, weaponinfo_t const *info, i96 score)

__str nam;

if(p->getCVarI(CVAR "player_stupidpickups"))
if(p->getCVarI(sCVAR "player_stupidpickups"))
nam = StupidName(weapon);
else
nam = Language(LANG "INFO_SHORT_%S", info->name);


+ 6
- 6
source/Main/p_render.c View File

@@ -65,7 +65,7 @@ void Lith_PlayerFootstep(struct player *p)
if(p->nextstep) {p->nextstep--; return;}

fixed dstmul = absk(p->getVel()) / 24.0;
fixed vol = p->getCVarK(CVAR "player_footstepvol") * min(dstmul, 1);
fixed vol = p->getCVarK(sCVAR "player_footstepvol") * min(dstmul, 1);

__str floor = ACS_GetActorFloorTexture(0);
__str snd = p->stepnoise;
@@ -129,9 +129,9 @@ void Lith_PlayerView(struct player *p)

fixed64 addp = 0, addy = 0;

if(p->getCVarI(CVAR "player_damagebob"))
if(p->getCVarI(sCVAR "player_damagebob"))
{
fixed64 bobmul = p->getCVarK(CVAR "player_damagebobmul");
fixed64 bobmul = p->getCVarK(sCVAR "player_damagebobmul");
addp += p->bobpitch * bobmul;
addy += p->bobyaw * bobmul;
}
@@ -142,7 +142,7 @@ void Lith_PlayerView(struct player *p)
p->addpitch = addp + p->extrpitch;
p->addyaw = addy + p->extryaw;

ifauto(fixed, mul, p->getCVarK(CVAR "player_viewtilt") * 0.2)
ifauto(fixed, mul, p->getCVarK(sCVAR "player_viewtilt") * 0.2)
{
if(p->sidev ) p->addroll = lerplk(p->addroll, -p->sidev * mul, 0.10);
else if(p->addroll) p->addroll = lerplk(p->addroll, 0, 0.14);
@@ -162,10 +162,10 @@ void Lith_PlayerStyle(struct player *p)
{
if(p->scopetoken) {
SetPropI(0, APROP_RenderStyle, STYLE_Subtract);
SetPropK(0, APROP_Alpha, p->getCVarK(CVAR "weapons_scopealpha") * p->alpha);
SetPropK(0, APROP_Alpha, p->getCVarK(sCVAR "weapons_scopealpha") * p->alpha);
} else {
SetPropI(0, APROP_RenderStyle, STYLE_Translucent);
SetPropK(0, APROP_Alpha, p->getCVarK(CVAR "weapons_alpha") * p->alpha);
SetPropK(0, APROP_Alpha, p->getCVarK(sCVAR "weapons_alpha") * p->alpha);
}
}



+ 2
- 2
source/Main/p_savedata.c View File

@@ -23,7 +23,7 @@ savefile_t *Lith_SaveBegin(struct player *p)
{
savefile_t *save = Salloc(savefile_t);

if((save->fp = Lith_NFOpen(p->num, CVAR "psave", 'w')))
if((save->fp = Lith_NFOpen(p->num, sCVAR "psave", 'w')))
{
save->p = p;
Lith_SaveWriteChunk(save, Ident_Lith, SaveV_Lith, 0);
@@ -81,7 +81,7 @@ savefile_t *Lith_LoadBegin(struct player *p)
{
savefile_t *save = Salloc(savefile_t);

if((save->fp = Lith_NFOpen(p->num, CVAR "psave", 'r')))
if((save->fp = Lith_NFOpen(p->num, sCVAR "psave", 'r')))
{
save->p = p;



+ 2
- 5
source/Main/p_shop.c View File

@@ -97,8 +97,7 @@ void Lith_CBITab_Shop(gui_state_t *g, struct player *p)
if(Lith_GUI_ScrollOcclude(g, &CBIState(g)->shopscr, y, guipre.btnlistsel.h) || !(shopitems[i].pclass & p->pclass))
continue;

StrEntOFF
char const *name = LanguageC(LANG "SHOP_TITLE_%S", shopitems[i].name);
char const *name = LanguageC(cLANG "SHOP_TITLE_%S", shopitems[i].name);

int *shopsel = &CBIState(g)->shopsel;
if(Lith_GUI_Button_Id(g, i, name, 0, y, i == *shopsel, Pre(btnlistsel)))
@@ -121,9 +120,7 @@ void Lith_CBITab_Shop(gui_state_t *g, struct player *p)

ClearClip();

#pragma GDCC STRENT_LITERAL OFF
if(Lith_GUI_Button(g, LC(LANG "BUY"), 259, 170, !p->canBuy(&item->shopdef, item)))
#pragma GDCC STRENT_LITERAL ON
if(Lith_GUI_Button(g, LC(cLANG "BUY"), 259, 170, !p->canBuy(&item->shopdef, item)))
p->buy(&item->shopdef, item, LANG "SHOP_TITLE_%S", false);
}
#endif


+ 1
- 1
source/Main/p_shopdef.c View File

@@ -37,7 +37,7 @@ bool Lith_ShopBuy(struct player *p, shopdef_t const *def, void *obj, __str namef

bool delivered = false;

if(!nodelivery && p->getCVarI(CVAR "player_teleshop"))
if(!nodelivery && p->getCVarI(sCVAR "player_teleshop"))
{
int pufftid;
int tid;


+ 2
- 2
source/Main/u_headsupdisp.c View File

@@ -16,8 +16,8 @@ static void HUD_Ammo(struct player *p)
__str typebg;
int y;

if(p->getCVarI(CVAR "hud_showweapons")) {y = 14; typebg = ":HUD:SplitRight";}
else {y = 0; typebg = ":HUD:SplitFront";}
if(p->getCVarI(sCVAR "hud_showweapons")) {y = 14; typebg = ":HUD:SplitRight";}
else {y = 0; typebg = ":HUD:SplitFront";}

if(wep->ammotype & AT_NMag || wep->ammotype & AT_Ammo)
{


+ 4
- 4
source/Main/u_magic.c View File

@@ -11,7 +11,7 @@ StrEntOFF
struct magic_info {
int st;
int x, y;
char const *name, *classname;
char const *name;
};

// Static Objects ------------------------------------------------------------|
@@ -81,10 +81,10 @@ static void UpdateMagicUI(struct player *p, upgrade_t *upgr)
}

script
static void GivePlayerZ(int tid, struct player *p, __str name)
static void GivePlayerZ(int tid, struct player *p)
{
while(ACS_ThingCount(T_NONE, tid)) {
SetMembI(tid, name, p->z);
SetMembI(tid, s"user_z", p->z);
ACS_Delay(1);
}
}
@@ -156,7 +156,7 @@ void Upgr_Magic_Update(struct player *p, upgrade_t *upgr)
SetMembI(tid, "user_y", y);
SetPropK(tid, APROP_Alpha, manaperc / 2);
Lith_SetPointer(tid, AAPTR_DEFAULT, AAPTR_MASTER, p->tid);
GivePlayerZ(tid, p, "user_z");
GivePlayerZ(tid, p);
}
}



+ 1
- 1
source/Main/u_reactarmor.c View File

@@ -81,7 +81,7 @@ void Upgr_ReactArmor_Deactivate(struct player *p, upgrade_t *upgr)
stkcall
void Upgr_ReactArmor_Render(struct player *p, upgrade_t *upgr)
{
if(UData.activearmor && p->getCVarI(CVAR "hud_showarmorind"))
if(UData.activearmor && p->getCVarI(sCVAR "hud_showarmorind"))
{
PrintSprite(":HUD:SplitLeft", 12,1, 225,2);



+ 2
- 2
source/Main/u_riflemodes.c View File

@@ -19,7 +19,7 @@ script ext("ACS")
void Lith_ResetRifleMode()
{
withplayer(LocalPlayer)
if(p->getCVarI(CVAR "weapons_riflemodeclear"))
if(p->getCVarI(sCVAR "weapons_riflemodeclear"))
p->riflefiremode = 0;
}

@@ -34,7 +34,7 @@ void Upgr_RifleModes_Render(struct player *p, upgrade_t *upgr)
{
if(p->weapontype != weapon_rifle) return;

if(p->getCVarI(CVAR "weapons_riflescope") &&
if(p->getCVarI(sCVAR "weapons_riflescope") &&
p->riflefiremode == rifle_firemode_burst)
{
SetClip(40, 108, 240, 40);


+ 7
- 7
source/Main/u_vitalscan.c View File

@@ -63,7 +63,7 @@ void Upgr_VitalScan_Update(struct player *p, upgrade_t *upgr)

UData.tagstr = Lith_RandomName(freak ? 0 : id);

if(p->getCVarI(CVAR "scanner_bar"))
if(p->getCVarI(sCVAR "scanner_bar"))
{
UData.oldhealth = UData.health = ACS_Random(0, 666666);
UData.maxhealth = ACS_Random(0, 666666);
@@ -72,7 +72,7 @@ void Upgr_VitalScan_Update(struct player *p, upgrade_t *upgr)
}
else
{
char color = p->getCVarI(CVAR "scanner_color") & 0x7F;
char color = p->getCVarI(sCVAR "scanner_color") & 0x7F;

if(six) UData.tagstr = "\Cg6";
else if(henshin) UData.tagstr = StrParam("\CgLegendary\C%c %tS", color, 0);
@@ -132,10 +132,10 @@ void Upgr_VitalScan_Render(struct player *p, upgrade_t *upgr)

if(UData.hdtime == 30) SetFade(fid_vscan, 10, 0.1);

int ox = p->getCVarI(CVAR "scanner_xoffs");
int oy = p->getCVarI(CVAR "scanner_yoffs");
int ox = p->getCVarI(sCVAR "scanner_xoffs");
int oy = p->getCVarI(sCVAR "scanner_yoffs");

if(p->getCVarI(CVAR "scanner_slide"))
if(p->getCVarI(sCVAR "scanner_slide"))
{
fixed64 diff = p->yawf - (fixed64)UData.cangle;
fixed ds = ACS_Sin(diff / tau) * tau;
@@ -155,7 +155,7 @@ void Upgr_VitalScan_Render(struct player *p, upgrade_t *upgr)
}

// Tag and health
bool afnt = p->getCVarI(CVAR "scanner_altfont");
bool afnt = p->getCVarI(sCVAR "scanner_altfont");
__str font = afnt ? "chfont" : "cbifont";

PrintTextStr(UData.tagstr);
@@ -166,7 +166,7 @@ void Upgr_VitalScan_Render(struct player *p, upgrade_t *upgr)
PrintTextX(UData.freak ? "alienfont" : font, CR_WHITE, 160+ox,4, 225+oy,2);

// Health bar
if(p->getCVarI(CVAR "scanner_bar"))
if(p->getCVarI(sCVAR "scanner_bar"))
{
int y = afnt ? 201 : 205;
SetClip(120 + ox, y + oy, 80 * UData.splitfrac, 2);


+ 4
- 9
source/Main/u_zoom.c View File

@@ -7,9 +7,6 @@ StrEntON

#define UData UData_Zoom(upgr)

#define IsKindaSmallNumber(x) ((x) > -0.5 && (x) < 0.5)
#define KindaCloseEnough(x, y) (IsKindaSmallNumber(x - y))

// Scripts -------------------------------------------------------------------|

script ext("ACS") type("net")
@@ -46,12 +43,11 @@ void Upgr_Zoom_Update(struct player *p, upgrade_t *upgr)
else
UData.vzoom = lerplk(UData.vzoom, UData.zoom, 0.2);

if(!KindaCloseEnough(UData.vzoom, UData.zoom))
fixed diff = UData.vzoom - UData.zoom;
if(diff > 0.5 || diff < -0.5)
{
if(UData.vzoom < UData.zoom)
ACS_LocalAmbientSound("player/zoomin", 30);
else
ACS_LocalAmbientSound("player/zoomout", 30);
if(UData.vzoom < UData.zoom) ACS_LocalAmbientSound("player/zoomin", 30);
else ACS_LocalAmbientSound("player/zoomout", 30);
}
else
UData.vzoom = UData.zoom;
@@ -85,4 +81,3 @@ void Upgr_Zoom_Render(struct player *p, upgrade_t *upgr)
}

// EOF


+ 2
- 2
source/Main/w_data.c View File

@@ -20,8 +20,8 @@ int LPData(int info, int permutation, bool target)
case pdata_upgrade: return p->getUpgrActive(permutation);
case pdata_riflemode: return p->riflefiremode;
case pdata_hassigil: return p->sgacquired;
case pdata_weaponzoom: return u.k = p->getCVarK(CVAR "weapons_zoomfactor"), u.i;
case pdata_slot3ammo: return p->getCVarI(CVAR "weapons_slot3ammo");
case pdata_weaponzoom: return u.k = p->getCVarK(sCVAR "weapons_zoomfactor"), u.i;
case pdata_slot3ammo: return p->getCVarI(sCVAR "weapons_slot3ammo");
case pdata_pclass: return p->pclass;
case pdata_semifrozen: return p->semifrozen > 0;
case pdata_addp: return u.k = p->addpitch, u.i;


+ 1
- 2
source/Main/w_dialogue.c View File

@@ -208,12 +208,11 @@ static void GetCode_Cond(struct pstate *d)

if(code == DCD_JNCLASS)
{
#pragma GDCC STRENT_LITERAL OFF
StrEntOFF
#define LITH_X(l, r) \
if(strcmp(tok->textV, #l) == 0 || strcmp(tok->textV, #r) == 0) \
{*d->nextCode() = r; goto ok;}
#include "lith_player.h"
#pragma GDCC STRENT_LITERAL ON

LogOri(tok, "GetCode_Cond: invalid playerclass type");
return;


+ 2
- 2
source/Main/w_time.c View File

@@ -3,7 +3,7 @@
#include "lith_player.h"
#include "lith_world.h"

StrEntON
StrEntOFF

script ext("ACS")
int Lith_Timer(void)
@@ -13,7 +13,6 @@ int Lith_Timer(void)

char const *Lith_CanonTime(int type)
{
StrEntOFF
noinit static char ft[64], st[64], dt[64];

int s = 53 + (world.ticks / 35);
@@ -43,6 +42,7 @@ char const *Lith_CanonTime(int type)
stkcall
void Lith_FreezeTime(bool on)
{
StrEntON
static int lmvar frozen;

if(on)


+ 1
- 3
source/Main/w_title.c View File

@@ -41,10 +41,8 @@ void Lith_Title(void)
SetSize(320, 240);
SetClipW(0, 0, 320, 240, 310);

#pragma GDCC STRENT_LITERAL OFF
char const *txt = LC(LANG "OPENER");
char const *txt = LC(cLANG "OPENER");
int len = strlen(txt);
#pragma GDCC STRENT_LITERAL ON

for(int t = 0, pos = 0;;)
{


+ 25
- 25
source/Main/w_world.c View File

@@ -106,21 +106,21 @@ static void CheckModCompat(void)
static void UpdateGame(void)
{
#define Update(n) \
if(ACS_GetCVarFixed(DCVAR "version") < n) \
__with(ACS_SetCVarFixed(DCVAR "version", n);)
if(ACS_GetCVarFixed(sDCVAR "version") < n) \
__with(ACS_SetCVarFixed(sDCVAR "version", n);)

Update(Lith_v1_5_1)
ACS_SetCVarFixed(CVAR "sv_scoremul", 1.25); // 2.0 => 1.25
ACS_SetCVarFixed(sCVAR "sv_scoremul", 1.25); // 2.0 => 1.25

Update(Lith_v1_5_2)
ACS_SetCVar(CVAR "sv_difficulty", 10); // 1 => 10
ACS_SetCVar(sCVAR "sv_difficulty", 10); // 1 => 10

Update(Lith_v1_6_0)
{
Lith_ForPlayer()
{
p->setCVarK(CVAR "player_footstepvol", 0.2); // 1.0 => 0.2
p->setCVarI(CVAR "player_ammolog", true); // false => true
p->setCVarK(sCVAR "player_footstepvol", 0.2); // 1.0 => 0.2
p->setCVarI(sCVAR "player_ammolog", true); // false => true
}
}

@@ -128,7 +128,7 @@ static void UpdateGame(void)
{
Lith_ForPlayer()
{
p->setCVarK(CVAR "weapons_zoomfactor", 1.5); // 3.0 => 1.5
p->setCVarK(sCVAR "weapons_zoomfactor", 1.5); // 3.0 => 1.5
}
}
#undef Update
@@ -137,15 +137,15 @@ static void UpdateGame(void)

static void GetDebugInfo(void)
{
bool all = ACS_GetCVar(DCVAR "debug_all");
world.dbgLevel = ACS_GetCVar(DCVAR "debug_level");
world.dbgItems = all || ACS_GetCVar(DCVAR "debug_items");
world.dbgBIP = all || ACS_GetCVar(DCVAR "debug_bip");
world.dbgScore = all || ACS_GetCVar(DCVAR "debug_score");
world.dbgUpgr = all || ACS_GetCVar(DCVAR "debug_upgrades");
world.dbgSave = all || ACS_GetCVar(DCVAR "debug_save");
world.dbgNoMon = ACS_GetCVar(DCVAR "debug_nomonsters");
bool all = ACS_GetCVar(sDCVAR "debug_all");
world.dbgLevel = ACS_GetCVar(sDCVAR "debug_level");
world.dbgItems = all || ACS_GetCVar(sDCVAR "debug_items");
world.dbgBIP = all || ACS_GetCVar(sDCVAR "debug_bip");
world.dbgScore = all || ACS_GetCVar(sDCVAR "debug_score");
world.dbgUpgr = all || ACS_GetCVar(sDCVAR "debug_upgrades");
world.dbgSave = all || ACS_GetCVar(sDCVAR "debug_save");
world.dbgNoMon = ACS_GetCVar(sDCVAR "debug_nomonsters");
}

static void GSInit(void)
@@ -177,7 +177,7 @@ static void GSInit(void)
CheckEnemyCompat();
#endif

world.game = ACS_GetCVar(DCVAR "game");
world.game = ACS_GetCVar(sDCVAR "game");
world.singleplayer = ACS_GameType() == GAME_SINGLE_PLAYER;

world.cbiperf = 10;
@@ -198,7 +198,7 @@ static void MInit(void)

world.islithmap = (world.mapnum & 0xFFFFFC00) == 0x01202000;

world.pauseinmenus = world.singleplayer && ACS_GetCVar(CVAR "sv_pauseinmenus");
world.pauseinmenus = world.singleplayer && ACS_GetCVar(sCVAR "sv_pauseinmenus");

world.soulsfreed = 0;
#endif
@@ -207,7 +207,7 @@ static void MInit(void)
world.mapseed = ACS_Random(0, 0x7FFFFFFF);

// Init global score multiplier per-map.
world.scoremul = roundlk(ACS_GetCVarFixed(CVAR "sv_scoremul") * 10, 10) / 10;
world.scoremul = roundlk(ACS_GetCVarFixed(sCVAR "sv_scoremul") * 10, 10) / 10;

// Give players some extra score if they're playing on extra hard or above.
if(ACS_GameSkill() >= skill_extrahard)
@@ -231,7 +231,7 @@ static void MSInit(void)
// Line 1888300 is used as a control line for mod features.
// Check for if rain should be used.
if(!ACS_GetLineUDMFInt(1888300, "user_lith_norain") &&
(ACS_GetCVar(CVAR "sv_rain") || ACS_GetLineUDMFInt(1888300, "user_lith_userain")) &&
(ACS_GetCVar(sCVAR "sv_rain") || ACS_GetLineUDMFInt(1888300, "user_lith_userain")) &&
ACS_PlayerCount() <= 1)
{
dorain = true;
@@ -253,7 +253,7 @@ static void WSInit(void)
DmonInit();
world.bossspawned = false;

if(ACS_GetCVar(CVAR "sv_sky") && !world.islithmap)
if(ACS_GetCVar(sCVAR "sv_sky") && !world.islithmap)
{
if(InHell)
{
@@ -275,7 +275,7 @@ static void WInit(void)
LogDebug(log_dev, "WINIT RUNNING");

#if LITHIUM
if(!ACS_GetCVar(CVAR "sv_nobosses"))
if(!ACS_GetCVar(sCVAR "sv_nobosses"))
SpawnBoss();

// Payout, which is not done on the first map.
@@ -303,7 +303,7 @@ static void WInit(void)
}

#if LITHIUM
if(ACS_GetCVar(CVAR "sv_nobosses") || world.dbgItems)
if(ACS_GetCVar(sCVAR "sv_nobosses") || world.dbgItems)
for(int i = 0; i < cupg_max; i++)
Lith_InstallCBIItem(i);
#endif
@@ -333,7 +333,7 @@ begin:

LogDebug(log_dev, "LITH OPEN");

if(ACS_GetCVar(CVAR "sv_failtime") == 0) for(;;)
if(ACS_GetCVar(sCVAR "sv_failtime") == 0) for(;;)
{
Log("\n=======\n"
"The configuration for this mod has been wiped, or you accidentally "
@@ -405,7 +405,7 @@ begin:
}

#if LITHIUM
if(world.ticks > ACS_GetCVar(CVAR "sv_failtime") * 35 * 60 * 60 && !world.islithmap)
if(world.ticks > ACS_GetCVar(sCVAR "sv_failtime") * 35 * 60 * 60 && !world.islithmap)
{
ServCallI("SetEnding", "TimeOut");
ACS_ChangeLevel("LITHEND", 0, CHANGELEVEL_NOINTERMISSION, -1);


Loading…
Cancel
Save