Browse Source

la grande stringening 14: explicit strent literals

tags/1.6.1
Alison Watson 3 years ago
parent
commit
5609c120e4
92 changed files with 410 additions and 247 deletions
  1. +10
    -9
      source/Headers/lith_common.h
  2. +12
    -12
      source/Headers/lith_drawing.h
  3. +2
    -2
      source/Headers/lith_file.h
  4. +6
    -7
      source/Headers/lith_memory.h
  5. +1
    -0
      source/Headers/lith_player.h
  6. +1
    -1
      source/Headers/lith_upgrades.h
  7. +2
    -0
      source/Main/g_auto.c
  8. +2
    -0
      source/Main/g_button.c
  9. +2
    -0
      source/Main/g_checkbox.c
  10. +144
    -142
      source/Main/g_preset.c
  11. +2
    -0
      source/Main/g_scrollbar.c
  12. +2
    -0
      source/Main/g_slider.c
  13. +2
    -0
      source/Main/g_textbox.c
  14. +2
    -0
      source/Main/m_common.c
  15. +2
    -0
      source/Main/m_cps.c
  16. +11
    -10
      source/Main/m_file.c
  17. +2
    -0
      source/Main/m_list.c
  18. +2
    -0
      source/Main/m_math.c
  19. +4
    -5
      source/Main/m_namegen.c
  20. +5
    -3
      source/Main/m_print.c
  21. +5
    -3
      source/Main/m_str.c
  22. +2
    -0
      source/Main/p_bip.c
  23. +5
    -8
      source/Main/p_cbigui.c
  24. +20
    -17
      source/Main/p_data.c
  25. +2
    -0
      source/Main/p_dialogue.c
  26. +2
    -0
      source/Main/p_gui_bip.c
  27. +2
    -0
      source/Main/p_gui_cbi.c
  28. +2
    -0
      source/Main/p_gui_upgrades.c
  29. +2
    -0
      source/Main/p_hud.c
  30. +2
    -0
      source/Main/p_items.c
  31. +2
    -0
      source/Main/p_log.c
  32. +2
    -0
      source/Main/p_magic.c
  33. +2
    -0
      source/Main/p_misc.c
  34. +2
    -0
      source/Main/p_notes.c
  35. +2
    -0
      source/Main/p_obituary.c
  36. +2
    -0
      source/Main/p_payout.c
  37. +2
    -0
      source/Main/p_pickups.c
  38. +2
    -0
      source/Main/p_player.c
  39. +2
    -0
      source/Main/p_render.c
  40. +2
    -0
      source/Main/p_save.c
  41. +2
    -0
      source/Main/p_savedata.c
  42. +2
    -0
      source/Main/p_settings.c
  43. +2
    -0
      source/Main/p_shop.c
  44. +2
    -0
      source/Main/p_shopdef.c
  45. +2
    -0
      source/Main/p_statistics.c
  46. +2
    -0
      source/Main/p_status.c
  47. +6
    -4
      source/Main/p_upgrades.c
  48. +2
    -0
      source/Main/p_upgrinfo.c
  49. +2
    -0
      source/Main/p_weaponinfo.c
  50. +2
    -0
      source/Main/p_weapons.c
  51. +2
    -0
      source/Main/u_7777777.c
  52. +2
    -0
      source/Main/u_adrenaline.c
  53. +2
    -0
      source/Main/u_autoreload.c
  54. +2
    -0
      source/Main/u_cyberlegs.c
  55. +2
    -0
      source/Main/u_defensenuke.c
  56. +2
    -0
      source/Main/u_goldeneye.c
  57. +2
    -0
      source/Main/u_headsupdis2.c
  58. +2
    -0
      source/Main/u_headsupdis3.c
  59. +2
    -0
      source/Main/u_headsupdisp.c
  60. +2
    -0
      source/Main/u_homingrpg.c
  61. +2
    -0
      source/Main/u_implying.c
  62. +2
    -0
      source/Main/u_instadeath.c
  63. +2
    -0
      source/Main/u_jetbooster.c
  64. +2
    -0
      source/Main/u_lolsords.c
  65. +15
    -14
      source/Main/u_magic.c
  66. +2
    -0
      source/Main/u_punctcannon.c
  67. +2
    -0
      source/Main/u_reactarmor.c
  68. +2
    -0
      source/Main/u_reflexwetw.c
  69. +2
    -0
      source/Main/u_riflemodes.c
  70. +2
    -0
      source/Main/u_stealthsys.c
  71. +2
    -0
      source/Main/u_subweapons.c
  72. +2
    -0
      source/Main/u_unceunce.c
  73. +2
    -0
      source/Main/u_vitalscan.c
  74. +2
    -0
      source/Main/u_zoom.c
  75. +2
    -0
      source/Main/w_boss.c
  76. +2
    -0
      source/Main/w_cbi.c
  77. +5
    -3
      source/Main/w_cyberspace.c
  78. +2
    -0
      source/Main/w_data.c
  79. +8
    -7
      source/Main/w_dialogue.c
  80. +2
    -0
      source/Main/w_dmon.c
  81. +2
    -0
      source/Main/w_font.c
  82. +2
    -0
      source/Main/w_misc.c
  83. +2
    -0
      source/Main/w_monster.c
  84. +2
    -0
      source/Main/w_payout.c
  85. +2
    -0
      source/Main/w_powerup.c
  86. +2
    -0
      source/Main/w_rain.c
  87. +2
    -0
      source/Main/w_spawn.c
  88. +2
    -0
      source/Main/w_time.c
  89. +2
    -0
      source/Main/w_title.c
  90. +2
    -0
      source/Main/w_world.c
  91. +2
    -0
      tools/upgc.rb
  92. +2
    -0
      tools/wepc.rb

+ 10
- 9
source/Headers/lith_common.h View File

@@ -4,7 +4,6 @@

// unfortunate early project decisions.
#pragma GDCC FIXED_LITERAL ON
#pragma GDCC STRENT_LITERAL ON

#include <ACS_ZDoom.h>
#include <stdlib.h>
@@ -59,15 +58,15 @@
#define GetZ ACS_GetActorZ

#if LITHIUM
#define Lith_IsPaused ServCallI("GetPaused")
#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 CVAR "lith_"
#define DCVAR "__lith_"
#define OBJ "Lith_"
#define CVAR s"lith_"
#define DCVAR s"__lith_"
#define OBJ s"Lith_"
#define LANG "LITH_"
#else
#define Lith_IsPaused false
@@ -76,9 +75,9 @@
#define ServName OBJ "Server"
#define DrawName OBJ "Render"

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

@@ -96,12 +95,14 @@
#define DebugNote(...) \
(world.dbgLevel & log_devh ? Lith_DebugNote(__VA_ARGS__) : (void)0)

// Convenience names
#define InvNum ACS_CheckInventory
#define InvMax(arg) ACS_GetMaxInventory(0, arg)
#define InvTake ACS_TakeInventory
#define InvGive ACS_GiveInventory

#define StrEntON _Pragma("GDCC STRENT_LITERAL ON")
#define StrEntOFF _Pragma("GDCC STRENT_LITERAL OFF")

// Types ---------------------------------------------------------------------|

enum {


+ 12
- 12
source/Headers/lith_drawing.h View File

@@ -5,43 +5,43 @@
#define TS TICSECOND

#define PrintSprite(name, x, xa, y, ya) \
DrawCallI("LS", name, (int)(x), (int)(y), (int)(xa), (int)(ya))
DrawCallI(s"LS", name, (int)(x), (int)(y), (int)(xa), (int)(ya))

#define PrintSpriteA(name, x, xa, y, ya, a) \
DrawCallI("LS", name, (int)(x), (int)(y), (int)(xa), (int)(ya), (fixed)(a))
DrawCallI(s"LS", name, (int)(x), (int)(y), (int)(xa), (int)(ya), (fixed)(a))

#define PrintSpriteF(name, x, xa, y, ya, n) \
DrawCallI("LS", name, (int)(x), (int)(y), (int)(xa), (int)(ya), (fixed)(-(n) - 2))
DrawCallI(s"LS", name, (int)(x), (int)(y), (int)(xa), (int)(ya), (fixed)(-(n) - 2))

#define PrintTextFmt(...) StrParamBegin(__VA_ARGS__)
#define PrintTextStr(s) (ACS_BeginPrint(), ACS_PrintString(s))

#define PrintText(font, cr, x, xa, y, ya) \
DrawCallI("LT", ACS_EndStrParam(), font, cr, (int)(x), (int)(y), (int)(xa), (int)(ya))
DrawCallI(s"LT", ACS_EndStrParam(), font, cr, (int)(x), (int)(y), (int)(xa), (int)(ya))

#define PrintTextA(font, cr, x, xa, y, ya, a) \
DrawCallI("LT", ACS_EndStrParam(), font, cr, (int)(x), (int)(y), (int)(xa), (int)(ya), (fixed)(a))
DrawCallI(s"LT", ACS_EndStrParam(), font, cr, (int)(x), (int)(y), (int)(xa), (int)(ya), (fixed)(a))

#define PrintTextF(font, cr, x, xa, y, ya, n) \
DrawCallI("LT", ACS_EndStrParam(), font, cr, (int)(x), (int)(y), (int)(xa), (int)(ya), (fixed)(-(n) - 2))
DrawCallI(s"LT", ACS_EndStrParam(), font, cr, (int)(x), (int)(y), (int)(xa), (int)(ya), (fixed)(-(n) - 2))

#define SetClip(x, y, w, h) \
DrawCallI("LC", (int)(x), (int)(y), (int)(w), (int)(h), 0)
DrawCallI(s"LC", (int)(x), (int)(y), (int)(w), (int)(h), 0)

#define SetClipW(x, y, w, h, ww) \
DrawCallI("LC", (int)(x), (int)(y), (int)(w), (int)(h), (int)(ww))
DrawCallI(s"LC", (int)(x), (int)(y), (int)(w), (int)(h), (int)(ww))

#define ClearClip() \
DrawCallI("LC", 0, 0, 0, 0, 0)
DrawCallI(s"LC", 0, 0, 0, 0, 0)

#define SetSize(w, h) \
DrawCallI("LZ", (int)(w), (int)(h))
DrawCallI(s"LZ", (int)(w), (int)(h))

#define SetFade(n, time, fade) \
DrawCallI("LF", (int)(n), (int)(time), (fixed)(fade))
DrawCallI(s"LF", (int)(n), (int)(time), (fixed)(fade))

#define CheckFade(n) \
DrawCallI("LX", n)
DrawCallI(s"LX", n)

#define HudMessageLog(...) \
( \


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

@@ -4,8 +4,8 @@

#include <stdio.h>

#define W_Find(name) ServCallI("FindLump", name)
#define W_Read(lmp) ServCallS("ReadLump", lmp)
#define W_Find(name) ServCallI(s"FindLump", name)
#define W_Read(lmp) ServCallS(s"ReadLump", lmp)

#define FEOF(fp) ((fp)->_flag & _FILEFLAG_EOF)



+ 6
- 7
source/Headers/lith_memory.h View File

@@ -11,13 +11,12 @@

#if LITH_MEMORY_DEBUG
#include <stdio.h>
#pragma GDCC STRENT_LITERAL ON
#define Calloc(n, s) (printf(c"%S:%i: Calloc\n", __FILE__, __LINE__), Calloc_real(n, s))
#define Dalloc(p) (printf(c"%S:%i: Dalloc\n", __FILE__, __LINE__), Dalloc_real(p))
#define Nalloc(s) (printf(c"%S:%i: Nalloc\n", __FILE__, __LINE__), Nalloc_real(s))
#define Malloc(s) (printf(c"%S:%i: Malloc\n", __FILE__, __LINE__), Malloc_real(s))
#define Ralloc(p, s) (printf(c"%S:%i: Ralloc\n", __FILE__, __LINE__), Ralloc_real(p, s))
#define Salloc(t) (printf(c"%S:%i: Salloc\n", __FILE__, __LINE__), Salloc_real(t))
#define Calloc(n, s) (printf("%S:%i: Calloc\n", __FILE__, __LINE__), Calloc_real(n, s))
#define Dalloc(p) (printf("%S:%i: Dalloc\n", __FILE__, __LINE__), Dalloc_real(p))
#define Nalloc(s) (printf("%S:%i: Nalloc\n", __FILE__, __LINE__), Nalloc_real(s))
#define Malloc(s) (printf("%S:%i: Malloc\n", __FILE__, __LINE__), Malloc_real(s))
#define Ralloc(p, s) (printf("%S:%i: Ralloc\n", __FILE__, __LINE__), Ralloc_real(p, s))
#define Salloc(t) (printf("%S:%i: Salloc\n", __FILE__, __LINE__), Salloc_real(t))
#else
#define Calloc(n, s) Calloc_real(n, s)
#define Dalloc(p) Dalloc_real(p)


+ 1
- 0
source/Headers/lith_player.h View File

@@ -161,6 +161,7 @@ struct player *Lith_GetPlayer(int tid, int ptr);
// edit 31/8/2017: m e r g e
struct player
{
StrEntON
// state
__prop reset {call: Lith_ResetPlayer(this)}
__prop loadData {call: Lith_PlayerLoadData(this)}


+ 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), LANG "UPGRADE_TITLE_%S", __VA_ARGS__)
p->buy(&(upgr)->info->shopdef, (upgr), s"" LANG "UPGRADE_TITLE_%S", __VA_ARGS__)

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


+ 2
- 0
source/Main/g_auto.c View File

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

StrEntON

// Extern Functions ----------------------------------------------------------|

stkcall


+ 2
- 0
source/Main/g_button.c View File

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntON

bool Lith_GUI_Button_Impl(gui_state_t *g, id_t id, gui_button_args_t const *a)
{
gui_button_preset_t const *pre = a->preset ? a->preset : &guipre.btndef;


+ 2
- 0
source/Main/g_checkbox.c View File

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntON

bool Lith_GUI_Checkbox_Impl(gui_state_t *g, id_t id, gui_checkb_args_t const *a)
{
gui_checkb_preset_t const *pre = a->preset ? a->preset : &guipre.cbxdef;


+ 144
- 142
source/Main/g_preset.c View File

@@ -2,16 +2,18 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntOFF

struct gui_presets const guipre = {
.btndef = {
.gfx = c"Button",
.hot = c"ButtonHot",
.snd = c"player/cbi/buttonpress",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"m",
.font = c"cbifont",
.gfx = "Button",
.hot = "ButtonHot",
.snd = "player/cbi/buttonpress",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "m",
.font = "cbifont",
.external = false,
.w = 48,
.h = 16,
@@ -19,14 +21,14 @@ struct gui_presets const guipre = {
},

.btntab = {
.gfx = c"Tab",
.hot = c"TabHot",
.snd = c"player/cbi/tabswitch",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"i",
.font = c"cbifont",
.gfx = "Tab",
.hot = "TabHot",
.snd = "player/cbi/tabswitch",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "i",
.font = "cbifont",
.external = false,
.w = 46,
.h = 11,
@@ -34,8 +36,8 @@ struct gui_presets const guipre = {
},

.btnexit = {
.gfx = c"ExitButton",
.hot = c"ExitButtonHot",
.gfx = "ExitButton",
.hot = "ExitButtonHot",
.external = false,
.w = 11,
.h = 11,
@@ -43,14 +45,14 @@ struct gui_presets const guipre = {
},

.btnnext = {
.gfx = c"BtnNext",
.hot = c"BtnNextHot",
.snd = c"player/cbi/right",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"i",
.font = c"cbifont",
.gfx = "BtnNext",
.hot = "BtnNextHot",
.snd = "player/cbi/right",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "i",
.font = "cbifont",
.external = false,
.w = 8,
.h = 11,
@@ -58,14 +60,14 @@ struct gui_presets const guipre = {
},

.btnprev = {
.gfx = c"BtnPrev",
.hot = c"BtnPrevHot",
.snd = c"player/cbi/left",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"i",
.font = c"cbifont",
.gfx = "BtnPrev",
.hot = "BtnPrevHot",
.snd = "player/cbi/left",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "i",
.font = "cbifont",
.external = false,
.w = 8,
.h = 11,
@@ -73,14 +75,14 @@ struct gui_presets const guipre = {
},

.btnnexts = {
.gfx = c"BtnNextSmall",
.hot = c"BtnNextSmallHot",
.snd = c"player/cbi/buttoncurs",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"i",
.font = c"cbifont",
.gfx = "BtnNextSmall",
.hot = "BtnNextSmallHot",
.snd = "player/cbi/buttoncurs",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "i",
.font = "cbifont",
.external = false,
.w = 6,
.h = 9,
@@ -88,14 +90,14 @@ struct gui_presets const guipre = {
},

.btnprevs = {
.gfx = c"BtnPrevSmall",
.hot = c"BtnPrevSmallHot",
.snd = c"player/cbi/buttoncurs",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"i",
.font = c"cbifont",
.gfx = "BtnPrevSmall",
.hot = "BtnPrevSmallHot",
.snd = "player/cbi/buttoncurs",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "i",
.font = "cbifont",
.external = false,
.w = 6,
.h = 9,
@@ -103,14 +105,14 @@ struct gui_presets const guipre = {
},

.btnlist = {
.gfx = c"ListButton",
.hot = c"ListButtonHot",
.snd = c"player/cbi/clicklst",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"u",
.font = c"cbifont",
.gfx = "ListButton",
.hot = "ListButtonHot",
.snd = "player/cbi/clicklst",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "u",
.font = "cbifont",
.external = false,
.w = 80,
.h = 9,
@@ -118,14 +120,14 @@ struct gui_presets const guipre = {
},

.btnlistsel = {
.gfx = c"ListButton",
.hot = c"ListButtonHot",
.snd = c"player/cbi/clicklst",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"i",
.font = c"cbifont",
.gfx = "ListButton",
.hot = "ListButtonHot",
.snd = "player/cbi/clicklst",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "i",
.font = "cbifont",
.external = false,
.w = 80,
.h = 9,
@@ -133,14 +135,14 @@ struct gui_presets const guipre = {
},

.btnlistactive = {
.gfx = c"ListButtonActive",
.hot = c"ListButtonActiveHot",
.snd = c"player/cbi/clicklst",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"i",
.font = c"cbifont",
.gfx = "ListButtonActive",
.hot = "ListButtonActiveHot",
.snd = "player/cbi/clicklst",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "i",
.font = "cbifont",
.external = false,
.w = 80,
.h = 9,
@@ -148,14 +150,14 @@ struct gui_presets const guipre = {
},

.btnlistactivated = {
.gfx = c"ListButtonActivated",
.hot = c"ListButtonActiveHot",
.snd = c"player/cbi/clicklst",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"i",
.font = c"cbifont",
.gfx = "ListButtonActivated",
.hot = "ListButtonActiveHot",
.snd = "player/cbi/clicklst",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "i",
.font = "cbifont",
.external = false,
.w = 80,
.h = 9,
@@ -165,12 +167,12 @@ struct gui_presets const guipre = {
.btnbipmain = {
.gfx = null,
.hot = null,
.snd = c"player/cbi/buttonpress",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"-",
.font = c"cbifont",
.snd = "player/cbi/buttonpress",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "-",
.font = "cbifont",
.external = false,
.w = 180,
.h = 9,
@@ -180,12 +182,12 @@ struct gui_presets const guipre = {
.btnbipback = {
.gfx = null,
.hot = null,
.snd = c"player/cbi/buttonpress",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"n",
.font = c"cbifont",
.snd = "player/cbi/buttonpress",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "n",
.font = "cbifont",
.external = false,
.w = 48,
.h = 9,
@@ -193,14 +195,14 @@ struct gui_presets const guipre = {
},

.btndlgsel = {
.gfx = c":Dialogue:SelectBack",
.hot = c":Dialogue:SelectBackHot",
.snd = c"player/cbi/dlgclick",
.cdef = c"j",
.cact = c"g",
.chot = c"d",
.cdis = c"i",
.font = c"cbifont",
.gfx = ":Dialogue:SelectBack",
.hot = ":Dialogue:SelectBackHot",
.snd = "player/cbi/dlgclick",
.cdef = "j",
.cact = "g",
.chot = "d",
.cdis = "i",
.font = "cbifont",
.external = true,
.w = 240,
.h = 14,
@@ -210,12 +212,12 @@ struct gui_presets const guipre = {
.btnclear = {
.gfx = null,
.hot = null,
.snd = c"player/cbi/buttonpress",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"n",
.font = c"cbifont",
.snd = "player/cbi/buttonpress",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "n",
.font = "cbifont",
.external = false,
.w = 20,
.h = 8,
@@ -225,12 +227,12 @@ struct gui_presets const guipre = {
.btnnote = {
.gfx = null,
.hot = null,
.snd = c"player/cbi/buttoncurs",
.cdef = c"j",
.cact = c"g",
.chot = c"k",
.cdis = c"-",
.font = c"cbifont",
.snd = "player/cbi/buttoncurs",
.cdef = "j",
.cact = "g",
.chot = "k",
.cdis = "-",
.font = "cbifont",
.external = false,
.w = 200,
.h = 30,
@@ -238,52 +240,52 @@ struct gui_presets const guipre = {
},

.cbxdef = {
.gfx = "Checkbox",
.hot = "CheckboxHot",
.dis = "CheckboxDisabled",
.sndup = "player/cbi/clickon",
.snddn = "player/cbi/clickoff",
.chkgfx = "CheckboxX",
.chkhot = "CheckboxXHot",
.chkact = "CheckboxXActive",
.chkdis = "CheckboxXDisabled",
.gfx = s"Checkbox",
.hot = s"CheckboxHot",
.dis = s"CheckboxDisabled",
.sndup = s"player/cbi/clickon",
.snddn = s"player/cbi/clickoff",
.chkgfx = s"CheckboxX",
.chkhot = s"CheckboxXHot",
.chkact = s"CheckboxXActive",
.chkdis = s"CheckboxXDisabled",
.external = false,
.w = 10,
.h = 10
},

.cbxsmall = {
.gfx = "CheckboxSmall",
.hot = "CheckboxSmallHot",
.dis = "CheckboxSmallDisabled",
.sndup = "player/cbi/clickon",
.snddn = "player/cbi/clickoff",
.chkgfx = "CheckboxX",
.chkhot = "CheckboxXHot",
.chkact = "CheckboxXActive",
.chkdis = "CheckboxXDisabled",
.gfx = s"CheckboxSmall",
.hot = s"CheckboxSmallHot",
.dis = s"CheckboxSmallDisabled",
.sndup = s"player/cbi/clickon",
.snddn = s"player/cbi/clickoff",
.chkgfx = s"CheckboxX",
.chkhot = s"CheckboxXHot",
.chkact = s"CheckboxXActive",
.chkdis = s"CheckboxXDisabled",
.external = false,
.w = 10,
.h = 10
},

.scrdef = {
.capS = "ListCapTop",
.capE = "ListCapBottom",
.scrl = "ListScrollbar",
.notchgfx = "ListScrollNotch",
.notchhot = "ListScrollNotchHot",
.capS = s"ListCapTop",
.capE = s"ListCapBottom",
.scrl = s"ListScrollbar",
.notchgfx = s"ListScrollNotch",
.notchhot = s"ListScrollNotchHot",
.external = false,
.scrlw = 8,
.scrlh = 8
},

.slddef = {
.gfx = "Slider",
.snd = "player/cbi/slidertick",
.notch = "SliderNotch",
.notchhot = "SliderNotchHot",
.font = "cbifont",
.gfx = s"Slider",
.snd = s"player/cbi/slidertick",
.notch = s"SliderNotch",
.notchhot = s"SliderNotchHot",
.font = s"cbifont",
.external = false,
.pad = 2,
.w = 80,


+ 2
- 0
source/Main/g_scrollbar.c View File

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntON

// This function is excessively commented in case I need to change it.
// Reading this function will cause a 5x1d20 hit to your SAN stat. Beware!
void Lith_GUI_ScrollBegin_Impl(gui_state_t *g, id_t id, gui_scroll_args_t const *a)


+ 2
- 0
source/Main/g_slider.c View File

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntON

fixed64 Lith_GUI_Slider_Impl(gui_state_t *g, id_t id, gui_slider_args_t const *a)
{
gui_slider_preset_t const *pre = a->preset ? a->preset : &guipre.slddef;


+ 2
- 0
source/Main/g_textbox.c View File

@@ -4,6 +4,8 @@
#include "lith_world.h"
#include "lith_cps.h"

StrEntON

gui_txtbox_state_t *Lith_GUI_TextBox_Impl(gui_state_t *g, id_t id, gui_txtbox_args_t const *a)
{
gui_txtbox_state_t *st = a->st;


+ 2
- 0
source/Main/m_common.c View File

@@ -6,6 +6,8 @@
#include <stdio.h>
#include <GDCC.h>

StrEntOFF

// Extern Objects ------------------------------------------------------------|

__str dbgstat[64], dbgnote[64];


+ 2
- 0
source/Main/m_cps.c View File

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_cps.h"

StrEntOFF

// Extern Functions ----------------------------------------------------------|

char const *Lith_CPS_Print(u32 *cps, int l)


+ 11
- 10
source/Main/m_file.c View File

@@ -7,6 +7,8 @@

#include "lith_base64.h"

StrEntOFF

#define SAVE_BLOCK_SIZE 230

// Type Definitions ----------------------------------------------------------|
@@ -37,8 +39,8 @@ static int NetClose(void *nfdata)
// If debugging, print out information about the buffer being written.
if(world.dbgSave)
{
printf(c"NetClose: Writing netfile \"%S\" (%zub)\n", nf->pcvar, nf->pos);
printf(c"Data follows\n");
printf("NetClose: Writing netfile \"%S\" (%zub)\n", nf->pcvar, nf->pos);
printf("Data follows\n");
Lith_PrintMem(nf->mem, nf->pos);
}

@@ -59,13 +61,13 @@ static int NetClose(void *nfdata)
else
itrsize = SAVE_BLOCK_SIZE;

ACS_SetUserCVarString(nf->pnum, StrParam("%S_%i", nf->pcvar, cvarnum), l_strndup(itr, itrsize));
ACS_SetUserCVarString(nf->pnum, StrParam(s"%S_%i", nf->pcvar, cvarnum), l_strndup(itr, itrsize));

itr += itrsize;
outsize -= itrsize;
}

ACS_SetUserCVarString(nf->pnum, StrParam("%S_%i", nf->pcvar, cvarnum), "");
ACS_SetUserCVarString(nf->pnum, StrParam(s"%S_%i", nf->pcvar, cvarnum), s"");

Dalloc(coded);
}
@@ -165,7 +167,7 @@ FILE *Lith_NFOpen(int pnum, __str pcvar, char rw)
nf->pcvar = pcvar;
nf->pnum = pnum;

fp = fopencookie(nf, c"w", (cookie_io_functions_t){
fp = fopencookie(nf, "w", (cookie_io_functions_t){
.write = MemWrite,
.close = NetClose
});
@@ -178,7 +180,7 @@ FILE *Lith_NFOpen(int pnum, __str pcvar, char rw)

for(int cvarnum;; cvarnum++)
{
__str cvar = ACS_GetUserCVarString(pnum, StrParam("%S_%i", pcvar, cvarnum));
__str cvar = ACS_GetUserCVarString(pnum, StrParam(s"%S_%i", pcvar, cvarnum));
size_t inlen = ACS_StrLen(cvar);

if(inlen)
@@ -203,8 +205,8 @@ FILE *Lith_NFOpen(int pnum, __str pcvar, char rw)
// If debugging, print out information about the buffer being read.
if(world.dbgSave)
{
printf(c"Lith_NFOpen: Opening memfile \"%S\" (%zub)\n", pcvar, size);
printf(c"Data follows\n");
printf("Lith_NFOpen: Opening memfile \"%S\" (%zub)\n", pcvar, size);
printf("Data follows\n");
Lith_PrintMem(data, size);
}

@@ -215,7 +217,7 @@ FILE *Lith_NFOpen(int pnum, __str pcvar, char rw)
mem->mem = data;
mem->len = size;

fp = fopencookie(mem, c"r", (cookie_io_functions_t){
fp = fopencookie(mem, "r", (cookie_io_functions_t){
.read = MemRead,
.seek = MemSeek,
.close = MemClose,
@@ -290,4 +292,3 @@ size_t Lith_FRead32(void *restrict buf, size_t count, size_t bytes, FILE *restri
}

// EOF


+ 2
- 0
source/Main/m_list.c View File

@@ -4,6 +4,8 @@
#include <string.h>
#include <stdio.h>

StrEntOFF

// Extern Functions ----------------------------------------------------------|

void Lith_LinkDefault(list_t *list, void *object)


+ 2
- 0
source/Main/m_math.c View File

@@ -3,6 +3,8 @@

#include <math.h>

StrEntOFF

#define BezierImpl(type, ret, func) \
type xa = func(x1, x2, t); \
type ya = func(y1, y2, t); \


+ 4
- 5
source/Main/m_namegen.c View File

@@ -5,11 +5,12 @@
#include "lith_world.h"
#include <ctype.h>

StrEntOFF

// Extern Functions ----------------------------------------------------------|

__str Lith_RandomName(int id)
{
#pragma GDCC STRENT_LITERAL OFF
static char const *syll[] = {
"ka","k'","khi","kaz","kr",
"ga","go","gor","got","gn","gl",
@@ -176,12 +177,11 @@ __str Lith_RandomName(int id)
"Dogma of Evil",
"Alpha and Omega",
};
#pragma GDCC STRENT_LITERAL ON

srand(id ? world.mapseed + id : ACS_Random(0, 0x7FFFFFFF));

ACS_BeginPrint();
ACS_PrintString("\Cg");
ACS_PrintString(s"\Cg");

char const *n = name[rand() % countof(name)];

@@ -201,7 +201,7 @@ __str Lith_RandomName(int id)
if(id)
{
char const *s = suff[rand() % countof(suff)];
ACS_PrintString(", the ");
ACS_PrintString(s", the ");
PrintChars(s, strlen(s));
}

@@ -209,4 +209,3 @@ __str Lith_RandomName(int id)
}

// EOF


+ 5
- 3
source/Main/m_print.c View File

@@ -3,6 +3,8 @@

#include <stdio.h>

StrEntOFF

#define DrawSpriteBegin(name) \
do { \
while(name[0] == ':') \
@@ -109,16 +111,16 @@ void Lith_PrintMem(void const *data, size_t size)
{
if(pos + 3 > 79)
{
puts(c"");
puts("");
pos = 0;
}

printf(IsPrint(d[i]) ? c"%c " : c"%.2X ", d[i]);
printf(IsPrint(d[i]) ? "%c " : c"%.2X ", d[i]);

pos += 3;
}

puts(c"\nEOF\n\n");
puts("\nEOF\n\n");
}

// EOF

+ 5
- 3
source/Main/m_str.c View File

@@ -4,6 +4,8 @@
#include <stdio.h>
#include <ctype.h>

StrEntOFF

#define StrHashImpl() \
u32 ret = 0; \
for(; *s; s++) ret = *s + 101 * ret; \
@@ -51,7 +53,7 @@ __str scoresep(i96 num)
{
static char out[48];

if(!num) return "0";
if(!num) return s"0";

char *outp = out + countof(out) - 1;
int cnum = 0;
@@ -99,9 +101,9 @@ char *LanguageVC(char *out, char const *name)
noinit static char sbuf[8192];
if(!out) out = sbuf;

sprintf(out, c"%LS", l_strdup(name));
sprintf(out, "%LS", l_strdup(name));

while(out[0] == '$') sprintf(out, c"%LS", l_strdup(&out[1]));
while(out[0] == '$') sprintf(out, "%LS", l_strdup(&out[1]));

return out;
}


+ 2
- 0
source/Main/p_bip.c View File

@@ -7,6 +7,8 @@
#include "lith_file.h"
#include "lith_tokbuf.h"

StrEntON

// Types ---------------------------------------------------------------------|

struct page_init


+ 5
- 8
source/Main/p_cbigui.c View File

@@ -5,6 +5,8 @@
#include "lith_list.h"
#include "lith_world.h"

StrEntOFF

#define TABCHARS 20

#define Themes(X) \
@@ -20,8 +22,6 @@

// Static Functions ----------------------------------------------------------|

#pragma GDCC STRENT_LITERAL OFF

static void Lith_CBITab_Arsenal(gui_state_t *g, struct player *p)
{
extern void Lith_CBITab_Upgrades(gui_state_t *g, struct player *p);
@@ -76,12 +76,11 @@ static void Lith_CBITab_Info(gui_state_t *g, struct player *p)
}
}

#pragma GDCC STRENT_LITERAL ON

// Extern Functions ----------------------------------------------------------|

__str Lith_ThemeName(uint num)
{
StrEntON
#define X(n) n,
static __str const themes[cbi_theme_max] = {Themes(X)};
#undef X
@@ -98,7 +97,7 @@ void Lith_PlayerUpdateCBIGUI(struct player *p)

if(p->cbi.theme != p->cbi.oldtheme)
{
#define X(n) ":UI_" n ":",
#define X(n) s":UI_" n ":",
static __str const names[] = {Themes(X)};
#undef X

@@ -112,12 +111,11 @@ void Lith_PlayerUpdateCBIGUI(struct player *p)
if(!p->indialogue)
Lith_GUI_UpdateState(g, p);

PrintSpriteA(StrParam("%SBackground", g->gfxprefix), 0,1, 0,1, 0.7);
PrintSpriteA(StrParam(s"%SBackground", g->gfxprefix), 0,1, 0,1, 0.7);

if(Lith_GUI_Button(g, .x = 296, 13, Pre(btnexit)))
p->useGUI(GUI_CBI);

#pragma GDCC STRENT_LITERAL OFF
char tn[5][TABCHARS];
LanguageCV(tn[0], LANG "TAB_ARSENAL_%s", p->discrim);
LanguageVC(tn[1], LANG "TAB_STATUS");
@@ -125,7 +123,6 @@ void Lith_PlayerUpdateCBIGUI(struct player *p)
LanguageVC(tn[3], LANG "TAB_INFO");
LanguageVC(tn[4], LANG "TAB_SETTINGS");
Lith_GUI_Tabs(g, &CBIState(g)->maintab, tn, 13, 13, 0);
#pragma GDCC STRENT_LITERAL ON

extern void Lith_CBITab_Items (gui_state_t *g, struct player *p);
extern void Lith_CBITab_Settings(gui_state_t *g, struct player *p);


+ 20
- 17
source/Main/p_data.c View File

@@ -5,33 +5,36 @@
#include "lith_world.h"
#include "lith_monster.h"

StrEntON

// Static Functions ----------------------------------------------------------|

static void SetupAttributes(struct player *p)
{
p->attr.names[at_acc] = c"ACC";
p->attr.names[at_def] = c"DEF";
p->attr.names[at_str] = c"STR";
p->attr.names[at_vit] = c"VIT";
p->attr.names[at_stm] = c"STM";
p->attr.names[at_luk] = c"LUK";
StrEntOFF
p->attr.names[at_acc] = "ACC";
p->attr.names[at_def] = "DEF";
p->attr.names[at_str] = "STR";
p->attr.names[at_vit] = "VIT";
p->attr.names[at_stm] = "STM";
p->attr.names[at_luk] = "LUK";

switch(p->pclass) {
case pcl_marine: p->attr.names[at_spc] = c"RGE"; break;
case pcl_cybermage: p->attr.names[at_spc] = c"CON"; break;
case pcl_informant: p->attr.names[at_spc] = c"ADR"; break;
case pcl_wanderer: p->attr.names[at_spc] = c"AGI"; break;
case pcl_assassin: p->attr.names[at_spc] = c"RSH"; break;
case pcl_darklord: p->attr.names[at_spc] = c"REF"; break;
case pcl_thoth: p->attr.names[at_spc] = c"???"; break;
case pcl_marine: p->attr.names[at_spc] = "RGE"; break;
case pcl_cybermage: p->attr.names[at_spc] = "CON"; break;
case pcl_informant: p->attr.names[at_spc] = "ADR"; break;
case pcl_wanderer: p->attr.names[at_spc] = "AGI"; break;
case pcl_assassin: p->attr.names[at_spc] = "RSH"; break;
case pcl_darklord: p->attr.names[at_spc] = "REF"; break;
case pcl_thoth: p->attr.names[at_spc] = "???"; break;
}

if(p->pclass & pcl_robot) {
p->attr.names[at_vit] = c"POT";
p->attr.names[at_stm] = c"REP";
p->attr.names[at_vit] = "POT";
p->attr.names[at_stm] = "REP";
} else if(p->pclass & pcl_nonhuman) {
p->attr.names[at_vit] = c"POT";
p->attr.names[at_stm] = c"REG";
p->attr.names[at_vit] = "POT";
p->attr.names[at_stm] = "REG";
}

p->attr.expnext = 500;


+ 2
- 0
source/Main/p_dialogue.c View File

@@ -5,6 +5,8 @@
#include "lith_hudid.h"
#include "lith_dialogue.h"

StrEntON

#define IMM *++vm.pc
#define STR &def->stabV[IMM]
#define JCC goto *cases[*vm.pc]


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

@@ -4,6 +4,8 @@
#include "lith_bip.h"
#include "lith_list.h"

StrEntON

static void SetCurPage(gui_state_t *g, struct bip *bip, struct page *page, __str body)
{
bip->curpage = page;


+ 2
- 0
source/Main/p_gui_cbi.c View File

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

StrEntON

#define Upgr(name) if(world.cbiupgr[cupg_##name])

#define InfoStart int y = 70


+ 2
- 0
source/Main/p_gui_upgrades.c View File

@@ -2,6 +2,8 @@
#include "lith_upgrades_common.h"
#include "lith_world.h"

StrEntON

static __str const upgrcateg[UC_MAX] = {
[UC_Body] = LANG "CAT_BODY",
[UC_Weap] = LANG "CAT_WEAP",


+ 2
- 0
source/Main/p_hud.c View File

@@ -3,6 +3,8 @@
#include "lith_hud.h"
#include "lith_hudid.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

void Lith_HUD_WeaponSlots_Impl(struct player *p, struct hud_wsl const *a)


+ 2
- 0
source/Main/p_items.c View File

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

StrEntON

// Static Functions ----------------------------------------------------------|

script


+ 2
- 0
source/Main/p_log.c View File

@@ -6,6 +6,8 @@
#include "lith_hudid.h"
#include "lith_world.h"

StrEntON

// Static Functions ----------------------------------------------------------|

static __str LogV(int levl, __str fmt, va_list vl)


+ 2
- 0
source/Main/p_magic.c View File

@@ -3,6 +3,8 @@
#include "lith_hudid.h"
#include "lith_world.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

script ext("ACS")


+ 2
- 0
source/Main/p_misc.c View File

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntON

script ext("ACS")
void Lith_GiveMeAllOfTheScore(void)
{


+ 2
- 0
source/Main/p_notes.c View File

@@ -4,6 +4,8 @@
#include "lith_world.h"
#include "lith_gui.h"

StrEntON

void Lith_CBITab_Notes(gui_state_t *g, struct player *p)
{
gui_txtbox_state_t *st = Lith_GUI_TextBox(g, &CBIState(g)->notebox, 48, 40, p);


+ 2
- 0
source/Main/p_obituary.c View File

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntON

script ext("ACS")
void Lith_Obituary(void)
{


+ 2
- 0
source/Main/p_payout.c View File

@@ -4,6 +4,8 @@
#include "lith_world.h"
#include "lith_hudid.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

script


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

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntON

#define name(n) LANG "PK_" #n

#define StupidName(w) \


+ 2
- 0
source/Main/p_player.c View File

@@ -7,6 +7,8 @@

#include <limits.h>

StrEntON

// Extern Objects ------------------------------------------------------------|

noinit struct player players[MAX_PLAYERS];


+ 2
- 0
source/Main/p_render.c View File

@@ -6,6 +6,8 @@

#include <math.h>

StrEntON

// Static Functions ----------------------------------------------------------|

static void HUD_StringStack(struct player *p);


+ 2
- 0
source/Main/p_save.c View File

@@ -4,6 +4,8 @@
#include "lith_savedata.h"
#include "lith_file.h"

StrEntOFF

// Chunk "note" --------------------------------------------------------------|

#define note_Len(s) __with(int len = s ? strlen(s) : 0; len = min(len, 255);)


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

@@ -5,6 +5,8 @@
#include "lith_savedata.h"
#include "lith_world.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

void Lith_SaveWriteChunk(savefile_t *save, ident_t iden, uint32_t vers, size_t size)


+ 2
- 0
source/Main/p_settings.c View File

@@ -117,6 +117,8 @@ if(p->num == 0) {
#include "lith_player.h"
#include "lith_world.h"

StrEntON

// Static Functions ----------------------------------------------------------|

static __str LvSysName(int num)


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

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntON

// Types ---------------------------------------------------------------------|

enum {


+ 2
- 0
source/Main/p_shopdef.c View File

@@ -4,6 +4,8 @@
#include "lith_player.h"
#include "lith_world.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

i96 Lith_ShopGetCost(struct player *p, shopdef_t const *def)


+ 2
- 0
source/Main/p_statistics.c View File

@@ -4,6 +4,8 @@
#include "lith_world.h"
#include "lith_gui.h"

StrEntON

void Lith_CBITab_Statistics(gui_state_t *g, struct player *p)
{
int n = 0;


+ 2
- 0
source/Main/p_status.c View File

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

StrEntON

// Static Functions ----------------------------------------------------------|

static void AttrBar(gui_state_t *g, int x, int y, int w, __str gfx)


+ 6
- 4
source/Main/p_upgrades.c View File

@@ -2,6 +2,8 @@
#include "lith_upgrades_common.h"
#include "lith_world.h"

StrEntOFF

// Static Objects ------------------------------------------------------------|

static upgradeinfo_t g_upgrinfoex[UPGR_EXTRA_NUM];
@@ -25,13 +27,13 @@ static bool Lith_UpgrGive(struct player *, shopdef_t const *, void *upgr_, int t
{
upgrade_t const *upgr = upgr_;

SetMembI(tid, "user_upgradeid", upgr->info->key);
SetMembI(tid, s"user_upgradeid", upgr->info->key);

switch(upgr->info->category)
{
case UC_Body: SetMembI(tid, "user_upgradebody", true); break;
case UC_Weap: SetMembI(tid, "user_upgradeweap", true); break;
default: SetMembI(tid, "user_upgradeextr", true); break;
case UC_Body: SetMembI(tid, s"user_upgradebody", true); break;
case UC_Weap: SetMembI(tid, s"user_upgradeweap", true); break;
default: SetMembI(tid, s"user_upgradeextr", true); break;
}

return true;


+ 2
- 0
source/Main/p_upgrinfo.c View File

@@ -2,6 +2,8 @@
// Edit only if you aren't going to recompile.
#include "lith_upgrades_common.h"

StrEntON

// Extern Objects ------------------------------------------------------------|

upgradeinfo_t const upgrinfobase[UPGR_BASE_MAX] = {


+ 2
- 0
source/Main/p_weaponinfo.c View File

@@ -3,6 +3,8 @@
#include "lith_common.h"
#include "lith_player.h"

StrEntON

// Extern Objects ------------------------------------------------------------|

#define Placeholder1 "MMMMHMHMMMHMMM"


+ 2
- 0
source/Main/p_weapons.c View File

@@ -4,6 +4,8 @@
#include "lith_world.h"
#include "lith_hudid.h"

StrEntON

// Static Functions ----------------------------------------------------------|

static void GiveWeaponItem(int parm, int slot)


+ 2
- 0
source/Main/u_7777777.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntOFF

// Extern Functions ----------------------------------------------------------|

stkcall


+ 2
- 0
source/Main/u_adrenaline.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

#define UData UData_Adrenaline(upgr)
#define CHARGE_MAX (30 * 35)



+ 2
- 0
source/Main/u_autoreload.c View File

@@ -1,6 +1,8 @@
// Copyright © 2018 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntOFF

// Extern Functions ----------------------------------------------------------|

stkcall


+ 2
- 0
source/Main/u_cyberlegs.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

stkcall


+ 2
- 0
source/Main/u_defensenuke.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

stkcall


+ 2
- 0
source/Main/u_goldeneye.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

script


+ 2
- 0
source/Main/u_headsupdis2.c View File

@@ -2,6 +2,8 @@
#include "lith_upgrades_common.h"
#include "lith_hud.h"

StrEntON

// Static Functions ----------------------------------------------------------|

static void HUD_Ammo(struct player *p)


+ 2
- 0
source/Main/u_headsupdis3.c View File

@@ -2,6 +2,8 @@
#include "lith_upgrades_common.h"
#include "lith_hud.h"

StrEntON

// Static Functions ----------------------------------------------------------|

static void HUD_Ammo(struct player *p)


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

@@ -2,6 +2,8 @@
#include "lith_upgrades_common.h"
#include "lith_hud.h"

StrEntON

#define UData UData_HeadsUpDisp(upgr)

// Static Functions ----------------------------------------------------------|


+ 2
- 0
source/Main/u_homingrpg.c View File

@@ -2,6 +2,8 @@
#include "lith_upgrades_common.h"
#include "lith_world.h"

StrEntON

#define UData UData_HomingRPG(upgr)

// Static Functions ----------------------------------------------------------|


+ 2
- 0
source/Main/u_implying.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

script


+ 2
- 0
source/Main/u_instadeath.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

script


+ 2
- 0
source/Main/u_jetbooster.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

#define UData UData_JetBooster(upgr)

#define CHARGE_MAX (35 * 7)


+ 2
- 0
source/Main/u_lolsords.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

#define UData UData_lolsords(upgr)

// Extern Functions ----------------------------------------------------------|


+ 15
- 14
source/Main/u_magic.c View File

@@ -2,6 +2,8 @@
#include "lith_upgrades_common.h"
#include "lith_world.h"

StrEntOFF

#define UData UData_Magic(upgr)

// Types ---------------------------------------------------------------------|
@@ -14,24 +16,23 @@ struct magic_info {

// Static Objects ------------------------------------------------------------|

#pragma GDCC STRENT_LITERAL OFF
static struct magic_info const minf[] = {
{-1, 130, 180, "Blade", OBJ "Blade" },
{-1, 60, 140, "Delear", OBJ "Delear" },
{cupg_c_slot3spell, 60, 60, "Feuer", OBJ "Feuer" },
{cupg_c_slot4spell, 130, 10, "Rend", OBJ "Rend" },
{cupg_c_slot5spell, 205, 60, "Hulgyon", OBJ "Hulgyon" },
{cupg_c_slot6spell, 205, 140, "StarShot", OBJ "StarShot"},
{cupg_c_slot7spell, 130, 100, "Cercle", OBJ "Cercle" },
{-1, 130, 180, "Blade" },
{-1, 60, 140, "Delear" },
{cupg_c_slot3spell, 60, 60, "Feuer" },
{cupg_c_slot4spell, 130, 10, "Rend" },
{cupg_c_slot5spell, 205, 60, "Hulgyon" },
{cupg_c_slot6spell, 205, 140, "StarShot"},
{cupg_c_slot7spell, 130, 100, "Cercle" },
};
#pragma GDCC STRENT_LITERAL ON

// Static Functions ----------------------------------------------------------|

script
static void GiveMagic(struct magic_info const *m)
{
ACS_SetWeapon(l_strdup(m->classname));
StrEntON
ACS_SetWeapon(StrParam(OBJ "%S", m->name));
}

script
@@ -42,7 +43,7 @@ static void UpdateMagicUI(struct player *p, upgrade_t *upgr)
Lith_GUI_Begin(g, 320, 240);
Lith_GUI_UpdateState(g, p);

PrintSprite(":UI:MagicSelectBack", 0,1, 0,1);
PrintSprite(s":UI:MagicSelectBack", 0,1, 0,1);

bool any = false;

@@ -52,7 +53,6 @@ static void UpdateMagicUI(struct player *p, upgrade_t *upgr)

if(m->st != -1 && !world.cbiupgr[m->st]) continue;

#pragma GDCC STRENT_LITERAL OFF
char gfx[18]; sprintf(gfx, ":UI:%s", m->name);
char hot[18]; sprintf(hot, ":UI:%sSel", m->name);

@@ -71,7 +71,6 @@ static void UpdateMagicUI(struct player *p, upgrade_t *upgr)
};

char name[24]; sprintf(name, LANG "INFO_SHORT_%s", m->name);
#pragma GDCC STRENT_LITERAL ON

if(Lith_GUI_Button_FId(g, i + 1, name, m->x, m->y, .preset = &pre))
GiveMagic(m);
@@ -105,7 +104,7 @@ void Lith_SetMagicUI(bool on)
UData.ui = true;
p->semifrozen++;

UData.gst.gfxprefix = ":UI:";
UData.gst.gfxprefix = s":UI:";
UData.gst.cx = 320/2;
UData.gst.cy = 240/2;

@@ -126,6 +125,7 @@ void Lith_SetMagicUI(bool on)
script
void Upgr_Magic_Update(struct player *p, upgrade_t *upgr)
{
StrEntON
fixed manaperc = p->mana / (fixed)p->manamax;

if(UData.manaperc < 1 && manaperc == 1)
@@ -162,6 +162,7 @@ void Upgr_Magic_Update(struct player *p, upgrade_t *upgr)
stkcall
void Upgr_Magic_Render(struct player *p, upgrade_t *upgr)
{
StrEntON
if(!p->hudenabled || p->indialogue) return;

int hprc = ceilk(min(UData.manaperc, 0.5) * 2 * 62);


+ 2
- 0
source/Main/u_punctcannon.c View File

@@ -3,6 +3,8 @@

#include <math.h>

StrEntON

// Extern Functions ----------------------------------------------------------|

script ext("ACS")


+ 2
- 0
source/Main/u_reactarmor.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

#define UData UData_ReactArmor(upgr)

// Static Objects ------------------------------------------------------------|


+ 2
- 0
source/Main/u_reflexwetw.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

#define UData UData_ReflexWetw(upgr)

#define CHARGE_MAX (35 * 0.8)


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

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

script ext("ACS")


+ 2
- 0
source/Main/u_stealthsys.c View File

@@ -1,6 +1,8 @@
// Copyright © 2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

#define UData UData_StealthSys(upgr)

// Extern Functions ----------------------------------------------------------|


+ 2
- 0
source/Main/u_subweapons.c View File

@@ -1,6 +1,8 @@
// Copyright © 2018 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

script


+ 2
- 0
source/Main/u_unceunce.c View File

@@ -1,6 +1,8 @@
// Copyright © 2016-2017 Alison Sanderson, all rights reserved.
#include "lith_upgrades_common.h"

StrEntON

// Extern Functions ----------------------------------------------------------|

stkcall


+ 2
- 0
source/Main/u_vitalscan.c View File

@@ -5,6 +5,8 @@

#include <math.h>

StrEntON

#define UData UData_VitalScan(upgr)

// Extern Functions ----------------------------------------------------------|


+ 2
- 0
source/Main/u_zoom.c View File

@@ -3,6 +3,8 @@

#include <math.h>

StrEntON

#define UData UData_Zoom(upgr)

#define IsKindaSmallNumber(x) ((x) > -0.5 && (x) < 0.5)


+ 2
- 0
source/Main/w_boss.c View File

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

StrEntON

// Types ---------------------------------------------------------------------|

struct boss


+ 2
- 0
source/Main/w_cbi.c View File

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

StrEntON

static int lmvar cbispawn[cupg_max];
static int lmvar cbispawniter;



+ 5
- 3
source/Main/w_cyberspace.c View File

@@ -4,18 +4,20 @@
#include "lith_token.h"
#include "lith_tokbuf.h"

StrEntOFF

script ext("ACS")
void Lith_CSLoadMap(void)
{
FILE *fp = W_Open("lfiles/Cyberspace.txt", c"r");
FILE *fp = W_Open(s"lfiles/Cyberspace.txt", "r");
int w, h, *map;

__fscanf_str(fp, "%i %i", &w, &h);
fscanf(fp, "%i %i", &w, &h);

map = Malloc(sizeof *map * w * h);

for(int y = 0; y < h; y++) for(int x = 0; x < w; x++)
__fscanf_str(fp, "%i ", &map[x + y * w]);
fscanf(fp, "%i ", &map[x + y * w]);

fclose(fp);
Dalloc(map);


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

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

StrEntON

extern bool dorain;

script ext("ACS")


+ 8
- 7
source/Main/w_dialogue.c View File

@@ -6,6 +6,8 @@
#include "lith_file.h"
#include "lith_tokbuf.h"

StrEntON

#define LogTok(tok, s) \
Log("(%i:%i) " s " (%i:\"%s\")", tok->orig.line, tok->orig.colu, tok->type, \
tok->textV ? tok->textV : c"<no string>")
@@ -468,7 +470,7 @@ static void GetDecl_TrmPage(struct pstate *d, int num)
// prototypes into the global ftbl.
void Lith_GSInit_Dialogue(void)
{
#pragma GDCC STRENT_LITERAL OFF
StrEntOFF

static struct dlgfunc funcs[] = {
{"nop", "L", DCD_NOP},
@@ -593,23 +595,22 @@ done:

if(world.dbgLevel & log_dlg)
{
#pragma GDCC STRENT_LITERAL OFF
StrEntOFF
static char const *dcdnames[] = {
#define DCD(name) #name,
#include "lith_dialogue.h"
};
#pragma GDCC STRENT_LITERAL ON

for(struct dlgdef *def = dlgdefs; def; def = def->next) {
Log("Dumping code for script %i...", def->num);
Log(s"Dumping code for script %i...", def->num);
for(int i = 0; i < def->codeC; i++)
Log("%10i %s", def->codeV[i], def->codeV[i] < countof(dcdnames)
Log(s"%10i %s", def->codeV[i], def->codeV[i] < countof(dcdnames)
? dcdnames[def->codeV[i]] : c"");
Log("Dumping string table for script %i...\n%s");
Log(s"Dumping string table for script %i...\n%s");
Lith_PrintMem(def->stabV, def->stabC);
}

Log("Done.");
Log(s"Done.");
}
}



+ 2
- 0
source/Main/w_dmon.c View File

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

StrEntON

#define DMON_MAX 0x7FFF

// Static Objects ------------------------------------------------------------|


+ 2
- 0
source/Main/w_font.c View File

@@ -2,6 +2,8 @@
#include "lith_common.h"
#include "lith_file.h"

StrEntO