marrub
/
Lithia
Archived
1
0
Fork 0

Add property macros

master
an 2018-08-10 00:27:27 -04:00
parent 8146ec2d45
commit 0728881821
62 changed files with 301 additions and 483 deletions

View File

@ -31,9 +31,8 @@ struct player_attributes
u32 level; u32 level;
__str names[at_max]; __str names[at_max];
[[__anonymous]] anonymous struct player_attr_theta cur;
struct player_attr_theta cur; struct player_attr_theta sup;
struct player_attr_theta sup;
}; };
#endif #endif

View File

@ -15,11 +15,11 @@ LITH_X(MAIL, "Mail")
// Extern Functions ----------------------------------------------------------| // Extern Functions ----------------------------------------------------------|
[[__call("ScriptS")]] void Lith_PlayerInitBIP(struct player *p); script void Lith_PlayerInitBIP(struct player *p);
struct bippage_s *Lith_FindBIPPage(struct bip_s *bip, __str name); struct bippage_s *Lith_FindBIPPage(struct bip_s *bip, __str name);
[[__optional_args(1)]] struct bippage_s *Lith_UnlockBIPPage(struct bip_s *bip, __str name, int pclass); optargs(1) struct bippage_s *Lith_UnlockBIPPage(struct bip_s *bip, __str name, int pclass);
[[__call("ScriptS")]] void Lith_DeallocateBIP(struct bip_s *bip); script void Lith_DeallocateBIP(struct bip_s *bip);
[[__call("ScriptS"), __optional_args(1)]] void Lith_DeliverMail(struct player *p, __str title, int flags); script optargs(1) void Lith_DeliverMail(struct player *p, __str title, int flags);
// Types ---------------------------------------------------------------------| // Types ---------------------------------------------------------------------|

View File

@ -6,7 +6,7 @@
#pragma GDCC FIXED_LITERAL ON #pragma GDCC FIXED_LITERAL ON
#pragma GDCC STRENT_LITERAL ON #pragma GDCC STRENT_LITERAL ON
#include <ACS_ZDoom.h> #include <ACS_Zandronum.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -73,15 +73,15 @@ enum {
void Log(__str fmt, ...); void Log(__str fmt, ...);
[[__call("StkCall")]] void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds); stkcall void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds);
[[__call("ScriptS"), __optional_args(1)]] int Lith_GetTID(int tid, int ptr); script optargs(1) int Lith_GetTID(int tid, int ptr);
[[__call("ScriptS"), __optional_args(1)]] int Lith_GetPlayerNumber(int tid, int ptr); script optargs(1) int Lith_GetPlayerNumber(int tid, int ptr);
[[__call("ScriptS"), __optional_args(1)]] bool Lith_ValidPointer(int tid, int ptr); script optargs(1) bool Lith_ValidPointer(int tid, int ptr);
[[__call("ScriptS"), __optional_args(2)]] bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags); script optargs(2) bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags);
[[__call("StkCall")]] int Lith_CheckActorInventory(int tid, __str item); stkcall int Lith_CheckActorInventory(int tid, __str item);
[[__call("StkCall")]] void Lith_GiveActorInventory(int tid, __str item, int amount); stkcall void Lith_GiveActorInventory(int tid, __str item, int amount);
[[__call("StkCall")]] void Lith_TakeActorInventory(int tid, __str item, int amount); stkcall void Lith_TakeActorInventory(int tid, __str item, int amount);
[[__call("StkCall")]] void Lith_SetActorInventory (int tid, __str item, int amount); stkcall void Lith_SetActorInventory (int tid, __str item, int amount);
void Lith_DebugStat(__str fmt, ...); void Lith_DebugStat(__str fmt, ...);
void Lith_DebugNote(__str fmt, ...); void Lith_DebugNote(__str fmt, ...);

View File

@ -39,13 +39,13 @@
HudMessageParams(HUDMSG_ALPHA, id, CR_UNTRANSLATED, x, y, hold, alpha) \ HudMessageParams(HUDMSG_ALPHA, id, CR_UNTRANSLATED, x, y, hold, alpha) \
) )
[[__call("StkCall")]] void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold); stkcall void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold);
[[__call("StkCall")]] void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1); stkcall void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1);
[[__call("StkCall")]] void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2); stkcall void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2);
[[__call("StkCall")]] void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2, fixed a3); stkcall void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2, fixed a3);
[[__call("StkCall")]] void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold); stkcall void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold);
[[__call("StkCall")]] void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alpha); stkcall void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alpha);
[[__call("StkCall")]] void DrawSpriteFade(__str name, int id, fixed x, fixed y, fixed hold, fixed fadetime); stkcall void DrawSpriteFade(__str name, int id, fixed x, fixed y, fixed hold, fixed fadetime);
void HudMessage(__str fmt, ...); void HudMessage(__str fmt, ...);
// EOF // EOF

View File

@ -98,8 +98,8 @@ typedef struct gui_delta_s
typedef struct gui_state_s typedef struct gui_state_s
{ {
[[__anonymous]] gui_delta_t cur; anonymous gui_delta_t cur;
gui_delta_t old; gui_delta_t old;
int ox, oy; int ox, oy;
int w, h; int w, h;
@ -265,20 +265,12 @@ struct gui_presets const *Lith_GUIPreExtern(void);
// Extern Functions ----------------------------------------------------------| // Extern Functions ----------------------------------------------------------|
[[__optional_args(1)]] optargs(1) void Lith_GUI_Auto(gui_state_t *g, id_t id, int x, int y, int w, int h, bool slide);
void Lith_GUI_Auto(gui_state_t *g, id_t id, int x, int y, int w, int h, bool slide); optargs(1) void Lith_GUI_Init(gui_state_t *g, void *state);
[[__optional_args(1)]]
void Lith_GUI_Init(gui_state_t *g, void *state);
void Lith_GUI_UpdateState(gui_state_t *g, struct player *p); void Lith_GUI_UpdateState(gui_state_t *g, struct player *p);
optargs(2) void Lith_GUI_Begin(gui_state_t *g, int basehid, int w, int h);
[[__optional_args(2)]]
void Lith_GUI_Begin(gui_state_t *g, int basehid, int w, int h);
void Lith_GUI_End(gui_state_t *g, enum cursor curs); void Lith_GUI_End(gui_state_t *g, enum cursor curs);
optargs(1) void Lith_GUI_Clip(gui_state_t *g, int x, int y, int w, int h, int ww);
[[__optional_args(1)]]
void Lith_GUI_Clip(gui_state_t *g, int x, int y, int w, int h, int ww);
void Lith_GUI_ClipRelease(gui_state_t *g); void Lith_GUI_ClipRelease(gui_state_t *g);
__str Lith_RemoveTextColors(__str str, int size); __str Lith_RemoveTextColors(__str str, int size);
@ -287,13 +279,12 @@ void Lith_GUI_TypeOn(gui_state_t *g, gui_typeon_state_t *typeon, __str text);
gui_typeon_state_t const *Lith_GUI_TypeOnUpdate(gui_state_t *g, gui_typeon_state_t *typeon); gui_typeon_state_t const *Lith_GUI_TypeOnUpdate(gui_state_t *g, gui_typeon_state_t *typeon);
void Lith_GUI_ScrollEnd(gui_state_t *g, gui_scroll_state_t *scr); void Lith_GUI_ScrollEnd(gui_state_t *g, gui_scroll_state_t *scr);
[[__optional_args(1)]] optargs(1) bool Lith_GUI_ScrollOcclude(gui_state_t *g, gui_scroll_state_t const *scr, int y, int h);
bool Lith_GUI_ScrollOcclude(gui_state_t *g, gui_scroll_state_t const *scr, int y, int h);
bool Lith_GUI_Button_Impl (gui_state_t *g, id_t id, gui_button_args_t const *a); bool Lith_GUI_Button_Impl (gui_state_t *g, id_t id, gui_button_args_t const *a);
bool Lith_GUI_Checkbox_Impl (gui_state_t *g, id_t id, gui_checkb_args_t const *a); bool Lith_GUI_Checkbox_Impl (gui_state_t *g, id_t id, gui_checkb_args_t const *a);
void Lith_GUI_ScrollBegin_Impl(gui_state_t *g, id_t id, gui_scroll_args_t const *a); void Lith_GUI_ScrollBegin_Impl(gui_state_t *g, id_t id, gui_scroll_args_t const *a);
double Lith_GUI_Slider_Impl (gui_state_t *g, id_t id, gui_slider_args_t const *a); double Lith_GUI_Slider_Impl (gui_state_t *g, id_t id, gui_slider_args_t const *a);
#endif #endif

View File

@ -16,11 +16,11 @@
// Extern Functions ----------------------------------------------------------| // Extern Functions ----------------------------------------------------------|
[[__optional_args(1)]] void Lith_LinkDefault(struct list_s *list, void *object); optargs(1) void Lith_LinkDefault(struct list_s *list, void *object);
void Lith_ListLink(struct list_s *head, struct list_s *list); void Lith_ListLink(struct list_s *head, struct list_s *list);
void *Lith_ListUnlink(struct list_s *list); void *Lith_ListUnlink(struct list_s *list);
size_t Lith_ListSize(struct list_s *head); size_t Lith_ListSize(struct list_s *head);
[[__optional_args(1)]] void Lith_ListFree(struct list_s *head, bool dofree); optargs(1) void Lith_ListFree(struct list_s *head, bool dofree);
// Type Definitions ----------------------------------------------------------| // Type Definitions ----------------------------------------------------------|

View File

@ -40,7 +40,7 @@ void Lith_LogH(struct player *p, __str fmt, ...); // log to hud only
logdata_t *Lith_LogV(struct player *p, __str fmt, va_list vl); // vararg logdata_t *Lith_LogV(struct player *p, __str fmt, va_list vl); // vararg
void Lith_PlayerLogEntry(struct player *p); void Lith_PlayerLogEntry(struct player *p);
[[__call("ScriptS")]] void Lith_HUD_Log(struct player *p); script void Lith_HUD_Log(struct player *p);
#endif #endif

View File

@ -13,20 +13,20 @@
#define pi4 (pi / 4.0f) #define pi4 (pi / 4.0f)
#define tau (pi * 2.0f) #define tau (pi * 2.0f)
[[__optional_args(1)]] u64 Lith_CRC64(void const *data, size_t len, u64 result); optargs(1) u64 Lith_CRC64(void const *data, size_t len, u64 result);
[[__optional_args(1)]] u64 Lith_CRC64_str(void __str_ars const *data, size_t len, u64 result); optargs(1) u64 Lith_CRC64_str(void __str_ars const *data, size_t len, u64 result);
[[__optional_args(1)]] float RandomFloat(float max, float min); optargs(1) float RandomFloat(float max, float min);
float mag2f(float x, float y); float mag2f(float x, float y);
[[__call("StkCall")]] fixed mag2k(fixed x, fixed y); stkcall fixed mag2k(fixed x, fixed y);
[[__call("StkCall")]] int mag2i(int x, int y); stkcall int mag2i(int x, int y);
fixed lerpk(fixed a, fixed b, fixed t); fixed lerpk(fixed a, fixed b, fixed t);
fixed64 lerplk(fixed64 a, fixed64 b, fixed64 t); fixed64 lerplk(fixed64 a, fixed64 b, fixed64 t);
float lerpf(float a, float b, float t); float lerpf(float a, float b, float t);
double lerp(double a, double b, double t); double lerp(double a, double b, double t);
[[__call("StkCall")]] bool aabb(int x, int y, int z, int w, int x2, int y2); stkcall bool aabb(int x, int y, int z, int w, int x2, int y2);
[[__call("StkCall")]] int ceilk(fixed n); stkcall int ceilk(fixed n);
[[__call("StkCall")]] float bzpolyf(float a, float b, float t); stkcall float bzpolyf(float a, float b, float t);
[[__call("StkCall")]] int bzpolyi(int a, int b, float t); stkcall int bzpolyi(int a, int b, float t);
struct vec2i qbezieri(int x1, int y1, int x2, int y2, int x3, int y3, float t); struct vec2i qbezieri(int x1, int y1, int x2, int y2, int x3, int y3, float t);
struct vec2f qbezierf(float x1, float y1, float x2, float y2, float x3, float y3, float t); struct vec2f qbezierf(float x1, float y1, float x2, float y2, float x3, float y3, float t);
struct polar ctopol(fixed x, fixed y); struct polar ctopol(fixed x, fixed y);

View File

@ -63,7 +63,7 @@ typedef struct dmon dmonarr dmon_t;
extern int dmonarr dmonid; extern int dmonarr dmonid;
#endif #endif
[[__call("ScriptS"), __optional_args(2)]] dmon_t *DmonPtr(int tid, int ptr); script optargs(2) dmon_t *DmonPtr(int tid, int ptr);
dmon_t *Dmon(int id); dmon_t *Dmon(int id);
dmon_t *AllocDmon(void); dmon_t *AllocDmon(void);

View File

@ -121,34 +121,34 @@ struct player_delta
// Extern Functions ----------------------------------------------------------| // Extern Functions ----------------------------------------------------------|
// state // state
[[__call("ScriptS")]] void Lith_ResetPlayer(struct player *p); script void Lith_ResetPlayer(struct player *p);
[[__call("ScriptS")]] void Lith_PlayerLoadData(struct player *p); script void Lith_PlayerLoadData(struct player *p);
[[__call("ScriptS")]] void Lith_PlayerSaveData(struct player *p); script void Lith_PlayerSaveData(struct player *p);
[[__call("StkCall")]] int Lith_PlayerCurWeaponType(struct player *p); stkcall int Lith_PlayerCurWeaponType(struct player *p);
[[__call("StkCall")]] bool Lith_ButtonPressed(struct player *p, int bt); stkcall bool Lith_ButtonPressed(struct player *p, int bt);
[[__call("StkCall"), __optional_args(1)]] bool Lith_SetPlayerVelocity(struct player *p, fixed velx, fixed vely, fixed velz, bool add); stkcall optargs(1) bool Lith_SetPlayerVelocity(struct player *p, fixed velx, fixed vely, fixed velz, bool add);
void Lith_ValidatePlayerTID(struct player *p); void Lith_ValidatePlayerTID(struct player *p);
// gui // gui
[[__call("StkCall")]] void Lith_PlayerCloseGUI(struct player *p); stkcall void Lith_PlayerCloseGUI(struct player *p);
[[__call("StkCall")]] void Lith_PlayerUseGUI(struct player *p, int type); stkcall void Lith_PlayerUseGUI(struct player *p, int type);
// score // score
[[__optional_args(1)]] i96 Lith_GiveScore(struct player *p, i96 score, bool nomul); optargs(1) i96 Lith_GiveScore(struct player *p, i96 score, bool nomul);
[[__call("StkCall")]] void Lith_TakeScore(struct player *p, i96 score); stkcall void Lith_TakeScore(struct player *p, i96 score);
// attributes // attributes
[[__call("StkCall")]] void Lith_GiveEXP(struct player *p, u64 amt); stkcall void Lith_GiveEXP(struct player *p, u64 amt);
// misc // misc
upgrade_t *Lith_PlayerGetNamedUpgrade(struct player *p, int name); upgrade_t *Lith_PlayerGetNamedUpgrade(struct player *p, int name);
bool Lith_PlayerGetUpgradeActive(struct player *p, int name); bool Lith_PlayerGetUpgradeActive(struct player *p, int name);
[[__call("StkCall")]] void Lith_ClearTextBuf(struct player *p); stkcall void Lith_ClearTextBuf(struct player *p);
[[__call("StkCall")]] __str Lith_PlayerDiscriminator(int pclass); stkcall __str Lith_PlayerDiscriminator(int pclass);
[[__call("ScriptS")]] void Lith_PlayerUpdateData(struct player *p); script void Lith_PlayerUpdateData(struct player *p);
[[__call("StkCall")]] void Lith_PlayerUpdateStats(struct player *p); stkcall void Lith_PlayerUpdateStats(struct player *p);
void Lith_HUD_DrawWeaponSlots(struct player *p, int const *ncol, int ncols, void Lith_HUD_DrawWeaponSlots(struct player *p, int const *ncol, int ncols,
char scol, int bx, int by); char scol, int bx, int by);
@ -248,9 +248,8 @@ struct player
int dlgnum; int dlgnum;
// Deltas // Deltas
[[__anonymous]] anonymous struct player_delta cur;
struct player_delta cur; struct player_delta old;
struct player_delta old;
int oldhealth; int oldhealth;
// BIP // BIP

View File

@ -45,16 +45,15 @@ typedef struct savefile_s
struct player *p; struct player *p;
} savefile_t; } savefile_t;
[[__call("ScriptS")]] typedef void (*loadchunker_t)(savefile_t *save, savechunk_t *chunk); script typedef void (*loadchunker_t)(savefile_t *save, savechunk_t *chunk);
// Extern Functions ----------------------------------------------------------| // Extern Functions ----------------------------------------------------------|
void Lith_SaveWriteChunk(savefile_t *save, ident_t iden, uint32_t vers, size_t size); void Lith_SaveWriteChunk(savefile_t *save, ident_t iden, uint32_t vers, size_t size);
savefile_t *Lith_SaveBegin(struct player *p); savefile_t *Lith_SaveBegin(struct player *p);
[[__call("ScriptS")]] void Lith_SaveEnd(savefile_t *save); script void Lith_SaveEnd(savefile_t *save);
[[__optional_args(1)]] optargs(1) int Lith_LoadChunk(savefile_t *save, ident_t iden, uint32_t vers, loadchunker_t chunker);
int Lith_LoadChunk(savefile_t *save, ident_t iden, uint32_t vers, loadchunker_t chunker);
savefile_t *Lith_LoadBegin(struct player *p); savefile_t *Lith_LoadBegin(struct player *p);
void Lith_LoadEnd(savefile_t *save); void Lith_LoadEnd(savefile_t *save);

View File

@ -22,7 +22,7 @@ typedef struct shopdef
i96 Lith_ShopGetCost(struct player *p, shopdef_t const *def); i96 Lith_ShopGetCost(struct player *p, shopdef_t const *def);
bool Lith_ShopCanBuy(struct player *p, shopdef_t const *def, void *obj); bool Lith_ShopCanBuy(struct player *p, shopdef_t const *def, void *obj);
[[__optional_args(1)]] bool Lith_ShopBuy(struct player *p, shopdef_t const *def, void *obj, __str namefmt, bool nodelivery, bool nolog); optargs(1) bool Lith_ShopBuy(struct player *p, shopdef_t const *def, void *obj, __str namefmt, bool nodelivery, bool nolog);
#endif #endif

View File

@ -1,11 +1,11 @@
// Copyright © 2018 Graham Sanderson, all rights reserved. // Copyright © 2018 Graham Sanderson, all rights reserved.
__str StrUpper(__str in); __str StrUpper(__str in);
[[__call("StkCall")]] u32 StrHash(char __str_ars const *s); stkcall u32 StrHash(char __str_ars const *s);
[[__call("StkCall")]] u32 CStrHash(char const *s); stkcall u32 CStrHash(char const *s);
char *Lith_strcpy_str(char *dest, char __str_ars const *src); char *Lith_strcpy_str(char *dest, char __str_ars const *src);
int Lith_strcmp_str(char const *s1, char __str_ars const *s2); int Lith_strcmp_str(char const *s1, char __str_ars const *s2);
[[__call("StkCall")]] __str Lith_ScoreSep(i96 num); stkcall __str Lith_ScoreSep(i96 num);
__str Language(__str fmt, ...); __str Language(__str fmt, ...);
__str LanguageNull(__str fmt, ...); __str LanguageNull(__str fmt, ...);
__str StrParam(__str fmt, ...); __str StrParam(__str fmt, ...);

View File

@ -6,6 +6,19 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdfix.h> #include <stdfix.h>
#define stkcall [[__call("StkCall")]]
#define script [[__call("ScriptS")]]
#define scriptn [[__call("ScriptI")]]
#define optargs(x) [[__optional_args(x)]]
#define noinit [[__no_init]]
#define anonymous [[__anonymous]]
#define address(x) [[__address(x)]]
#define acs [[__extern("ACS")]]
#define stksize(x) [[__alloc_Aut(x)]]
#define type(x) [[__script(x)]]
#define net type("net")
#define clientside type("clientside")
typedef int64_t i64; typedef int64_t i64;
typedef int96_t i96; typedef int96_t i96;

View File

@ -55,7 +55,7 @@ enum
typedef bool (*upgr_reinit_cb_t)(struct upgradeinfo *ui); typedef bool (*upgr_reinit_cb_t)(struct upgradeinfo *ui);
typedef void (*upgr_fn_cb_t)(struct player *, struct upgrade *); typedef void (*upgr_fn_cb_t)(struct player *, struct upgrade *);
[[__call("ScriptS")]] typedef void (*upgr_sc_cb_t)(struct player *, struct upgrade *); script typedef void (*upgr_sc_cb_t)(struct player *, struct upgrade *);
struct upgr_data_Adrenaline { struct upgr_data_Adrenaline {
int charge; int charge;
@ -138,7 +138,7 @@ struct upgr_data {
}; };
typedef struct upgradeinfo { typedef struct upgradeinfo {
[[__anonymous]] shopdef_t shopdef; anonymous shopdef_t shopdef;
int pclass; int pclass;
int category; int category;

View File

@ -16,11 +16,11 @@
// These are included here so the compiler may check the function signatures. // These are included here so the compiler may check the function signatures.
#define Fn_F(n, cb) void Upgr_##n##_##cb(struct player *p, upgrade_t *upgr); #define Fn_F(n, cb) void Upgr_##n##_##cb(struct player *p, upgrade_t *upgr);
#define Fn_S(n, cb) [[__call("ScriptS")]] Fn_F(n, cb) #define Fn_S(n, cb) script Fn_F(n, cb)
#include "lith_upgradefuncs.h" #include "lith_upgradefuncs.h"
[[__call("ScriptS")]] void Lith_PlayerInitUpgrades(struct player *p); script void Lith_PlayerInitUpgrades(struct player *p);
void Lith_PlayerDeallocUpgrades(struct player *p); void Lith_PlayerDeallocUpgrades(struct player *p);
void Lith_PlayerDeinitUpgrades(struct player *p); void Lith_PlayerDeinitUpgrades(struct player *p);
void Lith_PlayerReinitUpgrades(struct player *p); void Lith_PlayerReinitUpgrades(struct player *p);

View File

@ -45,10 +45,10 @@ enum game_s
}; };
__str Lith_CanonTime(int type); __str Lith_CanonTime(int type);
[[__optional_args(1)]] int Lith_UniqueID(int tid); optargs(1) int Lith_UniqueID(int tid);
[[__call("StkCall")]] void Lith_BeginAngles(int x, int y); stkcall void Lith_BeginAngles(int x, int y);
[[__call("StkCall")]] fixed Lith_AddAngle(int x, int y); stkcall fixed Lith_AddAngle(int x, int y);
[[__call("StkCall")]] void Lith_FreezeTime(bool on); stkcall void Lith_FreezeTime(bool on);
typedef struct worldinfo_s typedef struct worldinfo_s
{ {

View File

@ -153,8 +153,7 @@ void Lith_GUI_TypeOn(gui_state_t *g, gui_typeon_state_t *typeon, __str text)
// //
__str Lith_RemoveTextColors(__str str, int size) __str Lith_RemoveTextColors(__str str, int size)
{ {
[[__no_init]] noinit static char buf[8192];
static char buf[8192];
int j = 0; int j = 0;
if(size > countof(buf)) return "[programmer error, please report]"; if(size > countof(buf)) return "[programmer error, please report]";

View File

@ -16,8 +16,7 @@ int dbgstatnum, dbgnotenum;
// //
// SetInventory // SetInventory
// //
[[__call("StkCall")]] stkcall static void SetInventory(__str item, int amount)
static void SetInventory(__str item, int amount)
{ {
int s = InvNum(item) - amount; int s = InvNum(item) - amount;
if(s < 0) InvTake(item, -s); if(s < 0) InvTake(item, -s);
@ -27,8 +26,7 @@ static void SetInventory(__str item, int amount)
// //
// SetActorInventory // SetActorInventory
// //
[[__call("StkCall")]] stkcall static void SetActorInventory(int tid, __str item, int amount)
static void SetActorInventory(int tid, __str item, int amount)
{ {
int s = ACS_CheckActorInventory(tid, item) - amount; int s = ACS_CheckActorInventory(tid, item) - amount;
if(s < 0) ACS_TakeActorInventory(tid, item, -s); if(s < 0) ACS_TakeActorInventory(tid, item, -s);
@ -40,8 +38,7 @@ static void SetActorInventory(int tid, __str item, int amount)
// //
// Lith_DumpAlloc // Lith_DumpAlloc
// //
[[__call("ScriptS")]] script void Lith_DumpAlloc(void)
void Lith_DumpAlloc(void)
{ {
__GDCC__alloc_dump(); __GDCC__alloc_dump();
} }
@ -49,8 +46,7 @@ void Lith_DumpAlloc(void)
// //
// Lith_FadeFlash // Lith_FadeFlash
// //
[[__call("StkCall")]] stkcall void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds)
void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds)
{ {
ACS_FadeTo(r, g, b, amount, 0.0); ACS_FadeTo(r, g, b, amount, 0.0);
ACS_FadeTo(r, g, b, 0.0, seconds); ACS_FadeTo(r, g, b, 0.0, seconds);
@ -59,8 +55,7 @@ void Lith_FadeFlash(int r, int g, int b, fixed amount, fixed seconds)
// //
// Lith_GetTID // Lith_GetTID
// //
[[__call("ScriptS")]] script int Lith_GetTID(int tid, int ptr)
int Lith_GetTID(int tid, int ptr)
{ {
if(tid || ptr) if(tid || ptr)
ACS_SetActivator(tid, ptr); ACS_SetActivator(tid, ptr);
@ -70,8 +65,7 @@ int Lith_GetTID(int tid, int ptr)
// //
// Lith_GetPlayerNumber // Lith_GetPlayerNumber
// //
[[__call("ScriptS")]] script int Lith_GetPlayerNumber(int tid, int ptr)
int Lith_GetPlayerNumber(int tid, int ptr)
{ {
if(tid || ptr) if(tid || ptr)
ACS_SetActivator(tid, ptr); ACS_SetActivator(tid, ptr);
@ -81,8 +75,7 @@ int Lith_GetPlayerNumber(int tid, int ptr)
// //
// Lith_ValidPointer // Lith_ValidPointer
// //
[[__call("ScriptS")]] script bool Lith_ValidPointer(int tid, int ptr)
bool Lith_ValidPointer(int tid, int ptr)
{ {
if(tid || ptr) if(tid || ptr)
return ACS_SetActivator(tid, ptr); return ACS_SetActivator(tid, ptr);
@ -93,8 +86,7 @@ bool Lith_ValidPointer(int tid, int ptr)
// //
// Lith_SetPointer // Lith_SetPointer
// //
[[__call("ScriptS")]] script bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags)
bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags)
{ {
if(tid || ptr) if(tid || ptr)
ACS_SetActivator(tid, ptr); ACS_SetActivator(tid, ptr);
@ -104,8 +96,7 @@ bool Lith_SetPointer(int tid, int ptr, int assign, int tid2, int ptr2, int flags
// //
// Lith_CheckActorInventory // Lith_CheckActorInventory
// //
[[__call("StkCall")]] stkcall int Lith_CheckActorInventory(int tid, __str item)
int Lith_CheckActorInventory(int tid, __str item)
{ {
if(tid == 0) return InvNum(item); if(tid == 0) return InvNum(item);
else return ACS_CheckActorInventory(tid, item); else return ACS_CheckActorInventory(tid, item);
@ -114,8 +105,7 @@ int Lith_CheckActorInventory(int tid, __str item)
// //
// Lith_GiveActorInventory // Lith_GiveActorInventory
// //
[[__call("StkCall")]] stkcall void Lith_GiveActorInventory(int tid, __str item, int amount)
void Lith_GiveActorInventory(int tid, __str item, int amount)
{ {
if(tid == 0) InvGive(item, amount); if(tid == 0) InvGive(item, amount);
else ACS_GiveActorInventory(tid, item, amount); else ACS_GiveActorInventory(tid, item, amount);
@ -124,8 +114,7 @@ void Lith_GiveActorInventory(int tid, __str item, int amount)
// //
// Lith_TakeActorInventory // Lith_TakeActorInventory
// //
[[__call("StkCall")]] stkcall void Lith_TakeActorInventory(int tid, __str item, int amount)
void Lith_TakeActorInventory(int tid, __str item, int amount)
{ {
if(tid == 0) InvTake(item, amount); if(tid == 0) InvTake(item, amount);
else ACS_TakeActorInventory(tid, item, amount); else ACS_TakeActorInventory(tid, item, amount);
@ -134,8 +123,7 @@ void Lith_TakeActorInventory(int tid, __str item, int amount)
// //
// Lith_SetActorInventory // Lith_SetActorInventory
// //
[[__call("StkCall")]] stkcall void Lith_SetActorInventory(int tid, __str item, int amount)
void Lith_SetActorInventory(int tid, __str item, int amount)
{ {
if(tid == 0) SetInventory(item, amount); if(tid == 0) SetInventory(item, amount);
else SetActorInventory(tid, item, amount); else SetActorInventory(tid, item, amount);

View File

@ -28,10 +28,9 @@ typedef struct memfile_t
// //
typedef struct netfile_s typedef struct netfile_s
{ {
[[__anonymous]] anonymous memfile_t memfile;
memfile_t memfile; __str pcvar;
__str pcvar; int pnum;
int pnum;
} netfile_t; } netfile_t;
// Static Functions ----------------------------------------------------------| // Static Functions ----------------------------------------------------------|

View File

@ -90,8 +90,7 @@ float mag2f(float x, float y)
// //
// mag2k // mag2k
// //
[[__call("StkCall")]] stkcall fixed mag2k(fixed x, fixed y)
fixed mag2k(fixed x, fixed y)
{ {
return ACS_FixedSqrt(x * x + y * y); return ACS_FixedSqrt(x * x + y * y);
} }
@ -99,8 +98,7 @@ fixed mag2k(fixed x, fixed y)
// //
// mag2i // mag2i
// //
[[__call("StkCall")]] stkcall int mag2i(int x, int y)
int mag2i(int x, int y)
{ {
return ACS_Sqrt(x * x + y * y); return ACS_Sqrt(x * x + y * y);
} }
@ -161,8 +159,7 @@ double lerp(double a, double b, double t)
// //
// aabb // aabb
// //
[[__call("StkCall")]] stkcall bool aabb(int x, int y, int z, int w, int x2, int y2)
bool aabb(int x, int y, int z, int w, int x2, int y2)
{ {
return x2 >= x && y2 >= y && x2 < z && y2 < w; return x2 >= x && y2 >= y && x2 < z && y2 < w;
} }
@ -170,8 +167,7 @@ bool aabb(int x, int y, int z, int w, int x2, int y2)
// //
// ceilk // ceilk
// //
[[__call("StkCall")]] stkcall int ceilk(fixed n)
int ceilk(fixed n)
{ {
union {int_k_t i; fixed a;} u = {.a = n}; union {int_k_t i; fixed a;} u = {.a = n};
if(u.i & 0xFFF1) return u.i &= 0xFFFF0000, u.a + 1; if(u.i & 0xFFF1) return u.i &= 0xFFFF0000, u.a + 1;
@ -181,8 +177,7 @@ int ceilk(fixed n)
// //
// bzpolyf // bzpolyf
// //
[[__call("StkCall")]] stkcall float bzpolyf(float a, float b, float t)
float bzpolyf(float a, float b, float t)
{ {
return a + ((b - a) * t); return a + ((b - a) * t);
} }
@ -190,8 +185,7 @@ float bzpolyf(float a, float b, float t)
// //
// bzpolyi // bzpolyi
// //
[[__call("StkCall")]] stkcall int bzpolyi(int a, int b, float t)
int bzpolyi(int a, int b, float t)
{ {
return a + ((b - a) * t); return a + ((b - a) * t);
} }

View File

@ -24,8 +24,7 @@
// //
// DrawSprite // DrawSprite
// //
[[__call("StkCall")]] stkcall void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold)
void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold)
{ {
DrawSpriteBegin(name); DrawSpriteBegin(name);
ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold); ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
@ -35,8 +34,7 @@ void DrawSprite(__str name, int flags, int id, fixed x, fixed y, fixed hold)
// //
// DrawSpriteX // DrawSpriteX
// //
[[__call("StkCall")]] stkcall void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1)
void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1)
{ {
DrawSpriteBegin(name); DrawSpriteBegin(name);
ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold); ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
@ -46,8 +44,7 @@ void DrawSpriteX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fi
// //
// DrawSpriteXX // DrawSpriteXX
// //
[[__call("StkCall")]] stkcall void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2)
void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2)
{ {
DrawSpriteBegin(name); DrawSpriteBegin(name);
ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold); ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
@ -57,8 +54,7 @@ void DrawSpriteXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, f
// //
// DrawSpriteXXX // DrawSpriteXXX
// //
[[__call("StkCall")]] stkcall void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2, fixed a3)
void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold, fixed a1, fixed a2, fixed a3)
{ {
DrawSpriteBegin(name); DrawSpriteBegin(name);
ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold); ACS_OptHudMessage(flags|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
@ -68,8 +64,7 @@ void DrawSpriteXXX(__str name, int flags, int id, fixed x, fixed y, fixed hold,
// //
// DrawSpritePlain // DrawSpritePlain
// //
[[__call("StkCall")]] stkcall void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold)
void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold)
{ {
DrawSpriteBegin(name); DrawSpriteBegin(name);
ACS_OptHudMessage(HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold); ACS_OptHudMessage(HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
@ -79,8 +74,7 @@ void DrawSpritePlain(__str name, int id, fixed x, fixed y, fixed hold)
// //
// DrawSpriteAlpha // DrawSpriteAlpha
// //
[[__call("StkCall")]] stkcall void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alpha)
void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alpha)
{ {
DrawSpriteBegin(name); DrawSpriteBegin(name);
ACS_OptHudMessage(HUDMSG_ALPHA|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold); ACS_OptHudMessage(HUDMSG_ALPHA|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);
@ -90,8 +84,7 @@ void DrawSpriteAlpha(__str name, int id, fixed x, fixed y, fixed hold, fixed alp
// //
// DrawSpriteFade // DrawSpriteFade
// //
[[__call("StkCall")]] stkcall void DrawSpriteFade(__str name, int id, fixed x, fixed y, fixed hold, fixed fadetime)
void DrawSpriteFade(__str name, int id, fixed x, fixed y, fixed hold, fixed fadetime)
{ {
DrawSpriteBegin(name); DrawSpriteBegin(name);
ACS_OptHudMessage(HUDMSG_FADEOUT|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold); ACS_OptHudMessage(HUDMSG_FADEOUT|HUDMSG_NOTWITHFULLMAP, id, CR_UNTRANSLATED, x, y, hold);

View File

@ -26,8 +26,7 @@ __str StrUpper(__str in)
// //
// StrHash // StrHash
// //
[[__call("StkCall")]] stkcall u32 StrHash(char __str_ars const *s)
u32 StrHash(char __str_ars const *s)
{ {
StrHashImpl(); StrHashImpl();
} }
@ -35,8 +34,7 @@ u32 StrHash(char __str_ars const *s)
// //
// CStrHash // CStrHash
// //
[[__call("StkCall")]] stkcall u32 CStrHash(char const *s)
u32 CStrHash(char const *s)
{ {
StrHashImpl(); StrHashImpl();
} }
@ -65,8 +63,7 @@ int Lith_strcmp_str(char const *s1, char __str_ars const *s2)
// //
// Lith_ScoreSep // Lith_ScoreSep
// //
[[__call("StkCall")]] stkcall __str Lith_ScoreSep(i96 num)
__str Lith_ScoreSep(i96 num)
{ {
static char out[48]; static char out[48];

View File

@ -81,8 +81,7 @@ static void UnlockPage(bip_t *bip, bippage_t *page, int pclass)
// //
// AddToBIP // AddToBIP
// //
[[__optional_args(1)]] optargs(1) static void AddToBIP(bip_t *bip, int categ, int pclass, struct page_init const *pinit, bool isfree)
static void AddToBIP(bip_t *bip, int categ, int pclass, struct page_init const *pinit, bool isfree)
{ {
__str image = LanguageNull("LITH_TXT_INFO_IMAGE_%S", pinit->name); __str image = LanguageNull("LITH_TXT_INFO_IMAGE_%S", pinit->name);
int height = strtoi_str(Language("LITH_TXT_INFO_CSIZE_%S", pinit->name), null, 0); int height = strtoi_str(Language("LITH_TXT_INFO_CSIZE_%S", pinit->name), null, 0);
@ -106,8 +105,7 @@ static void AddToBIP(bip_t *bip, int categ, int pclass, struct page_init const *
// //
// CatFromStr // CatFromStr
// //
[[__call("StkCall")]] stkcall static int CatFromStr(__str name)
static int CatFromStr(__str name)
{ {
#define LITH_X(n, _) if(name == #n) return BIPC_##n; #define LITH_X(n, _) if(name == #n) return BIPC_##n;
#include "lith_bip.h" #include "lith_bip.h"
@ -117,8 +115,7 @@ static int CatFromStr(__str name)
// //
// PClFromStr // PClFromStr
// //
[[__call("StkCall")]] stkcall static int PClFromStr(__str name)
static int PClFromStr(__str name)
{ {
#define LITH_X(n, pc) if(name == #n || name == #pc) return pc; #define LITH_X(n, pc) if(name == #n || name == #pc) return pc;
#include "lith_player.h" #include "lith_player.h"
@ -195,8 +192,7 @@ static int LoadBIPInfo(__str fname, bip_t *bip, int pclass)
// //
// Lith_PlayerInitBIP // Lith_PlayerInitBIP
// //
[[__call("ScriptS")]] script void Lith_PlayerInitBIP(struct player *p)
void Lith_PlayerInitBIP(struct player *p)
{ {
bip_t *bip = &p->bip; bip_t *bip = &p->bip;
@ -223,8 +219,7 @@ void Lith_PlayerInitBIP(struct player *p)
// //
// Lith_DeliverMail // Lith_DeliverMail
// //
[[__call("ScriptS")]] script void Lith_DeliverMail(struct player *p, __str title, int flags)
void Lith_DeliverMail(struct player *p, __str title, int flags)
{ {
if(p->pclass & pcl_mods) return; if(p->pclass & pcl_mods) return;
@ -316,8 +311,7 @@ bippage_t *Lith_UnlockBIPPage(bip_t *bip, __str name, int pclass)
// //
// Lith_DeallocateBIP // Lith_DeallocateBIP
// //
[[__call("ScriptS")]] script void Lith_DeallocateBIP(bip_t *bip)
void Lith_DeallocateBIP(bip_t *bip)
{ {
ForCategory() ForCategory()
bip->infogr[categ].free(true); bip->infogr[categ].free(true);
@ -327,8 +321,7 @@ void Lith_DeallocateBIP(bip_t *bip)
// //
// CheckMatch // CheckMatch
// //
[[__call("ScriptS")]] script static bool CheckMatch(struct page_info *pinf, __str query)
static bool CheckMatch(struct page_info *pinf, __str query)
{ {
return strcasestr_str(pinf->shname, query) || return strcasestr_str(pinf->shname, query) ||
strcasestr_str(pinf->flname, query) || strcasestr_str(pinf->flname, query) ||

View File

@ -64,8 +64,7 @@ static void Lith_CBITab_Info(gui_state_t *g, struct player *p)
// //
// Lith_PlayerUpdateCBIGUI // Lith_PlayerUpdateCBIGUI
// //
[[__call("ScriptS")]] script void Lith_PlayerUpdateCBIGUI(struct player *p)
void Lith_PlayerUpdateCBIGUI(struct player *p)
{ {
gui_state_t *g = &p->cbi.guistate; gui_state_t *g = &p->cbi.guistate;
@ -135,8 +134,7 @@ void Lith_PlayerResetCBIGUI(struct player *p)
// //
// Lith_KeyOpenCBI // Lith_KeyOpenCBI
// //
[[__call("ScriptS"), __extern("ACS"), __script("net")]] script acs net void Lith_KeyOpenCBI(void)
void Lith_KeyOpenCBI(void)
{ {
if(ACS_Timer() < 10) return; if(ACS_Timer() < 10) return;

View File

@ -68,8 +68,7 @@ static void SetPClass(struct player *p)
// //
// Lith_PlayerCurWeaponType // Lith_PlayerCurWeaponType
// //
[[__call("StkCall")]] stkcall int Lith_PlayerCurWeaponType(struct player *p)
int Lith_PlayerCurWeaponType(struct player *p)
{ {
return p->weapon.cur->info->type; return p->weapon.cur->info->type;
} }
@ -77,8 +76,7 @@ int Lith_PlayerCurWeaponType(struct player *p)
// //
// Lith_ButtonPressed // Lith_ButtonPressed
// //
[[__call("StkCall")]] stkcall bool Lith_ButtonPressed(struct player *p, int bt)
bool Lith_ButtonPressed(struct player *p, int bt)
{ {
return p->buttons & bt && !(p->old.buttons & bt); return p->buttons & bt && !(p->old.buttons & bt);
} }
@ -86,8 +84,7 @@ bool Lith_ButtonPressed(struct player *p, int bt)
// //
// Lith_SetPlayerVelocity // Lith_SetPlayerVelocity
// //
[[__call("StkCall")]] stkcall bool Lith_SetPlayerVelocity(struct player *p, fixed velx, fixed vely, fixed velz, bool add)
bool Lith_SetPlayerVelocity(struct player *p, fixed velx, fixed vely, fixed velz, bool add)
{ {
if(add) if(add)
p->velx += velx, p->vely += vely, p->velz += velz; p->velx += velx, p->vely += vely, p->velz += velz;
@ -116,8 +113,7 @@ void Lith_ValidatePlayerTID(struct player *p)
// //
// Update all of the player's data. // Update all of the player's data.
// //
[[__call("ScriptS")]] script void Lith_PlayerUpdateData(struct player *p)
void Lith_PlayerUpdateData(struct player *p)
{ {
static int const warpflags = WARPF_NOCHECKPOSITION | WARPF_MOVEPTR | static int const warpflags = WARPF_NOCHECKPOSITION | WARPF_MOVEPTR |
WARPF_WARPINTERPOLATION | WARPF_COPYINTERPOLATION | WARPF_COPYPITCH; WARPF_WARPINTERPOLATION | WARPF_COPYINTERPOLATION | WARPF_COPYPITCH;
@ -175,8 +171,7 @@ void Lith_PlayerUpdateData(struct player *p)
// //
// Lith_GiveMail // Lith_GiveMail
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_GiveMail(int num)
void Lith_GiveMail(int num)
{ {
static __str const names[] = { static __str const names[] = {
"Intro", "Intro",
@ -198,8 +193,7 @@ void Lith_GiveMail(int num)
// //
// Lith_ClearTextBuf // Lith_ClearTextBuf
// //
[[__call("StkCall")]] stkcall void Lith_ClearTextBuf(struct player *p)
void Lith_ClearTextBuf(struct player *p)
{ {
memset(p->txtbuf, 0, sizeof(p->txtbuf)); memset(p->txtbuf, 0, sizeof(p->txtbuf));
p->tbptr = 0; p->tbptr = 0;
@ -208,8 +202,7 @@ void Lith_ClearTextBuf(struct player *p)
// //
// Lith_KeyDown // Lith_KeyDown
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_KeyDown(int pnum, int ch)
void Lith_KeyDown(int pnum, int ch)
{ {
withplayer(&players[pnum]) withplayer(&players[pnum])
if(p->tbptr + 1 < countof(p->txtbuf)) if(p->tbptr + 1 < countof(p->txtbuf))
@ -219,8 +212,7 @@ void Lith_KeyDown(int pnum, int ch)
// //
// Lith_GiveEXP // Lith_GiveEXP
// //
[[__call("StkCall")]] stkcall void Lith_GiveEXP(struct player *p, u64 amt)
void Lith_GiveEXP(struct player *p, u64 amt)
{ {
#pragma GDCC FIXED_LITERAL OFF #pragma GDCC FIXED_LITERAL OFF
struct player_attributes *a = &p->attr; struct player_attributes *a = &p->attr;
@ -240,8 +232,7 @@ void Lith_GiveEXP(struct player *p, u64 amt)
// //
// Reset some things on the player when they spawn. // Reset some things on the player when they spawn.
// //
[[__call("ScriptS")]] script void Lith_ResetPlayer(struct player *p)
void Lith_ResetPlayer(struct player *p)
{ {
// //
// Zero-init // Zero-init
@ -381,8 +372,7 @@ void Lith_ResetPlayer(struct player *p)
// //
// Lith_PlayerUpdateStats // Lith_PlayerUpdateStats
// //
[[__call("StkCall")]] stkcall void Lith_PlayerUpdateStats(struct player *p)
void Lith_PlayerUpdateStats(struct player *p)
{ {
fixed boost = 1 + p->jumpboost; fixed boost = 1 + p->jumpboost;

View File

@ -65,9 +65,8 @@ typedef struct dlgvmstate_s
int optSel; int optSel;
int concat; int concat;
[[__anonymous]] anonymous dlgcurstate_t cur;
dlgcurstate_t cur; dlgcurstate_t next;
dlgcurstate_t next;
} dlgvmstate_t; } dlgvmstate_t;
// Extern Objects ------------------------------------------------------------| // Extern Objects ------------------------------------------------------------|
@ -79,8 +78,7 @@ struct dlgdef *lmvar dlgdefs;
// //
// Lith_TerminalGUI // Lith_TerminalGUI
// //
[[__call("ScriptS")]] script static void Lith_TerminalGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vmstate)
static void Lith_TerminalGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vmstate)
{ {
enum { enum {
// background // background
@ -185,8 +183,7 @@ static void Lith_TerminalGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vms
// //
// Lith_DialogueGUI // Lith_DialogueGUI
// //
[[__call("ScriptS")]] script static void Lith_DialogueGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vmstate)
static void Lith_DialogueGUI(gui_state_t *g, struct player *p, dlgvmstate_t *vmstate)
{ {
enum {left = 37, top = 75}; enum {left = 37, top = 75};
__str icon = StrParam(":Dialogue:Icon%S", vmstate->sreg[DSTR_ICON]); __str icon = StrParam(":Dialogue:Icon%S", vmstate->sreg[DSTR_ICON]);
@ -243,8 +240,7 @@ static __str AddText(dlgvmstate_t *vmstate, __str s, bool local)
// //
// Lith_TeleportOutEffect // Lith_TeleportOutEffect
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_TeleportOutEffect(struct player *p)
void Lith_TeleportOutEffect(struct player *p)
{ {
if(!p) p = LocalPlayer; if(!p) p = LocalPlayer;
@ -270,8 +266,7 @@ void Lith_TeleportOutEffect(struct player *p)
// //
// Main dialogue VM. // Main dialogue VM.
// //
[[__call("ScriptS")]] script void Lith_DialogueVM(struct player *p, int num)
void Lith_DialogueVM(struct player *p, int num)
{ {
if(p->dead || p->indialogue > 1) if(p->dead || p->indialogue > 1)
return; return;
@ -507,8 +502,7 @@ done:
// //
// Lith_RunDialogue // Lith_RunDialogue
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_RunDialogue(int num)
void Lith_RunDialogue(int num)
{ {
withplayer(LocalPlayer) if(!p->indialogue) withplayer(LocalPlayer) if(!p->indialogue)
{ {
@ -522,8 +516,7 @@ void Lith_RunDialogue(int num)
// //
// Runs a numbered terminal. // Runs a numbered terminal.
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_RunTerminal(int num)
void Lith_RunTerminal(int num)
{ {
Lith_RunDialogue(-num); Lith_RunDialogue(-num);
} }
@ -531,8 +524,7 @@ void Lith_RunTerminal(int num)
// //
// Lith_RunDialogueInt // Lith_RunDialogueInt
// //
[[__call("ScriptI"), __address(24244), __extern("ACS")]] scriptn address(24244) acs void Lith_RunDialogueInt(int num)
void Lith_RunDialogueInt(int num)
{ {
Lith_RunDialogue(num); Lith_RunDialogue(num);
} }

View File

@ -13,8 +13,7 @@
// //
// Lith_LogName // Lith_LogName
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_LogName(int name)
void Lith_LogName(int name)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
switch(name) switch(name)
@ -135,8 +134,7 @@ logdata_t *Lith_LogV(struct player *p, __str fmt, va_list vl)
// //
// Lith_PlayerUpdateLog // Lith_PlayerUpdateLog
// //
[[__call("ScriptS")]] script void Lith_PlayerUpdateLog(struct player *p)
void Lith_PlayerUpdateLog(struct player *p)
{ {
forlist(logdata_t *logdata, p->loginfo.hud) forlist(logdata_t *logdata, p->loginfo.hud)
{ {
@ -155,8 +153,7 @@ void Lith_PlayerUpdateLog(struct player *p)
// //
// Lith_HUD_Log // Lith_HUD_Log
// //
[[__call("ScriptS")]] script void Lith_HUD_Log(struct player *p)
void Lith_HUD_Log(struct player *p)
{ {
if(p->getCVarI("lith_hud_showlog")) if(p->getCVarI("lith_hud_showlog"))
{ {

View File

@ -9,8 +9,7 @@
// //
// Lith_Blade // Lith_Blade
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_Blade(bool hit)
void Lith_Blade(bool hit)
{ {
ACS_SetHudSize(800, 600); ACS_SetHudSize(800, 600);
DrawSpriteX(hit ? ":Weapon:BladeHit" : ":Weapon:Blade", HUDMSG_FADEOUT|HUDMSG_ADDBLEND, hid_blade, 0.1, 0.1, TS * 3, 0.15); DrawSpriteX(hit ? ":Weapon:BladeHit" : ":Weapon:Blade", HUDMSG_FADEOUT|HUDMSG_ADDBLEND, hid_blade, 0.1, 0.1, TS * 3, 0.15);
@ -23,8 +22,7 @@ void Lith_Blade(bool hit)
// //
// Lith_Rend // Lith_Rend
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_Rend(bool hit, int set)
void Lith_Rend(bool hit, int set)
{ {
static int num; static int num;
@ -44,8 +42,7 @@ void Lith_Rend(bool hit, int set)
// //
// Lith_Feuer // Lith_Feuer
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_Feuer(bool left, bool fire)
void Lith_Feuer(bool left, bool fire)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {
@ -90,8 +87,7 @@ void Lith_Feuer(bool left, bool fire)
// //
// Lith_Cercle // Lith_Cercle
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_Cercle(void)
void Lith_Cercle(void)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {
@ -176,8 +172,7 @@ void Lith_Cercle(void)
// //
// Lith_MagicSelect // Lith_MagicSelect
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_MagicSelect(int num)
void Lith_MagicSelect(int num)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {

View File

@ -13,8 +13,7 @@ extern payoutinfo_t payout;
// //
// Lith_PlayerPayout // Lith_PlayerPayout
// //
[[__call("ScriptS")]] script void Lith_PlayerPayout(struct player *p)
void Lith_PlayerPayout(struct player *p)
{ {
#define Left(...) \ #define Left(...) \
( \ ( \

View File

@ -9,7 +9,7 @@
// Extern Objects ------------------------------------------------------------| // Extern Objects ------------------------------------------------------------|
[[__no_init]] struct player players[MAX_PLAYERS]; noinit struct player players[MAX_PLAYERS];
// Static Objects ------------------------------------------------------------| // Static Objects ------------------------------------------------------------|
@ -21,15 +21,14 @@ static struct {__str on, off;} Lith_GUISounds[GUI_MAX] = {
// Static Functions ----------------------------------------------------------| // Static Functions ----------------------------------------------------------|
static void Lith_PlayerRunScripts(struct player *p); static void Lith_PlayerRunScripts(struct player *p);
[[__call("ScriptS")]] static void Lith_BossWarning(struct player *p); script static void Lith_BossWarning(struct player *p);
// Scripts -------------------------------------------------------------------| // Scripts -------------------------------------------------------------------|
// //
// Lith_PlayerEntry // Lith_PlayerEntry
// //
[[__call("ScriptS"), __script("enter")]] script type("enter") static void Lith_PlayerEntry(void)
static void Lith_PlayerEntry(void)
{ {
if(ACS_GameType() == GAME_TITLE_MAP) if(ACS_GameType() == GAME_TITLE_MAP)
return; return;
@ -74,7 +73,7 @@ reinit:
if(p->dlgnum) if(p->dlgnum)
{ {
[[__call("ScriptS")]] extern void Lith_DialogueVM(struct player *p, int dlgnum); script extern void Lith_DialogueVM(struct player *p, int dlgnum);
Lith_DialogueVM(p, p->dlgnum); Lith_DialogueVM(p, p->dlgnum);
p->dlgnum = 0; p->dlgnum = 0;
@ -99,8 +98,7 @@ reinit:
// //
// Lith_PlayerDeath // Lith_PlayerDeath
// //
[[__call("ScriptS"), __script("death")]] script type("death") static void Lith_PlayerDeath(void)
static void Lith_PlayerDeath(void)
{ {
struct player *p = LocalPlayer; struct player *p = LocalPlayer;
@ -138,8 +136,7 @@ static void Lith_PlayerDeath(void)
// //
// Lith_PlayerRespawn // Lith_PlayerRespawn
// //
[[__call("ScriptS"), __script("respawn")]] script type("respawn") static void Lith_PlayerRespawn(void)
static void Lith_PlayerRespawn(void)
{ {
LocalPlayer->reinit = true; LocalPlayer->reinit = true;
} }
@ -147,8 +144,7 @@ static void Lith_PlayerRespawn(void)
// //
// Lith_PlayerReturn // Lith_PlayerReturn
// //
[[__call("ScriptS"), __script("return")]] script type("return") static void Lith_PlayerReturn(void)
static void Lith_PlayerReturn(void)
{ {
LocalPlayer->reinit = true; LocalPlayer->reinit = true;
} }
@ -156,8 +152,7 @@ static void Lith_PlayerReturn(void)
// //
// Lith_PlayerDisconnect // Lith_PlayerDisconnect
// //
[[__call("ScriptS"), __script("disconnect")]] script type("disconnect") static void Lith_PlayerDisconnect(void)
static void Lith_PlayerDisconnect(void)
{ {
struct player *p = LocalPlayer; struct player *p = LocalPlayer;
@ -178,8 +173,7 @@ static void Lith_PlayerDisconnect(void)
// //
// Lith_RecoilUp // Lith_RecoilUp
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_RecoilUp(fixed amount)
void Lith_RecoilUp(fixed amount)
{ {
withplayer(LocalPlayer) p->extrpitch += amount / 180; withplayer(LocalPlayer) p->extrpitch += amount / 180;
} }
@ -222,8 +216,7 @@ struct player (*Lith_GetPlayersExtern(void))[MAX_PLAYERS]
// //
// Lith_PlayerDiscriminator // Lith_PlayerDiscriminator
// //
[[__call("StkCall")]] stkcall __str Lith_PlayerDiscriminator(int pclass)
__str Lith_PlayerDiscriminator(int pclass)
{ {
switch(pclass) { switch(pclass) {
case pcl_marine: return "Stan"; case pcl_marine: return "Stan";
@ -240,8 +233,7 @@ __str Lith_PlayerDiscriminator(int pclass)
// //
// Lith_StepSpeed // Lith_StepSpeed
// //
[[__call("ScriptS"), __extern("ACS")]] script acs int Lith_StepSpeed()
int Lith_StepSpeed()
{ {
struct player *p = LocalPlayer; struct player *p = LocalPlayer;
@ -265,8 +257,7 @@ struct player *Lith_GetPlayer(int tid, int ptr)
// //
// Lith_PlayerCloseGUI // Lith_PlayerCloseGUI
// //
[[__call("StkCall")]] stkcall void Lith_PlayerCloseGUI(struct player *p)
void Lith_PlayerCloseGUI(struct player *p)
{ {
if(p->activegui != GUI_NONE) if(p->activegui != GUI_NONE)
{ {
@ -279,8 +270,7 @@ void Lith_PlayerCloseGUI(struct player *p)
// //
// Lith_PlayerUseGUI // Lith_PlayerUseGUI
// //
[[__call("StkCall")]] stkcall void Lith_PlayerUseGUI(struct player *p, int type)
void Lith_PlayerUseGUI(struct player *p, int type)
{ {
if(p->dead) return; if(p->dead) return;
if(p->activegui == GUI_NONE) if(p->activegui == GUI_NONE)
@ -351,8 +341,7 @@ i96 Lith_GiveScore(struct player *p, i96 score, bool nomul)
// //
// Lith_TakeScore // Lith_TakeScore
// //
[[__call("StkCall")]] stkcall void Lith_TakeScore(struct player *p, i96 score)
void Lith_TakeScore(struct player *p, i96 score)
{ {
if(p->score - score >= 0) { if(p->score - score >= 0) {
p->scoreused += score; p->scoreused += score;
@ -369,8 +358,7 @@ void Lith_TakeScore(struct player *p, i96 score)
// //
// Lith_GiveMeAllOfTheScore // Lith_GiveMeAllOfTheScore
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_GiveMeAllOfTheScore(void)
void Lith_GiveMeAllOfTheScore(void)
{ {
withplayer(LocalPlayer) p->giveScore(0x7FFFFFFFFFFFFFFFFFFFFFFFLL, true); withplayer(LocalPlayer) p->giveScore(0x7FFFFFFFFFFFFFFFFFFFFFFFLL, true);
} }
@ -378,8 +366,7 @@ void Lith_GiveMeAllOfTheScore(void)
// //
// Lith_GiveHealthBonus // Lith_GiveHealthBonus
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_GiveHealthBonus(int amount)
void Lith_GiveHealthBonus(int amount)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {
@ -392,8 +379,7 @@ void Lith_GiveHealthBonus(int amount)
// //
// Lith_GiveHealth // Lith_GiveHealth
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_GiveHealth(int amount)
void Lith_GiveHealth(int amount)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {
@ -407,8 +393,7 @@ void Lith_GiveHealth(int amount)
// //
// Lith_CheckHealth // Lith_CheckHealth
// //
[[__call("ScriptS"), __extern("ACS")]] script acs bool Lith_CheckHealth()
bool Lith_CheckHealth()
{ {
withplayer(LocalPlayer) return p->health < p->maxhealth; withplayer(LocalPlayer) return p->health < p->maxhealth;
return 0; return 0;
@ -417,8 +402,7 @@ bool Lith_CheckHealth()
// //
// Lith_Discount // Lith_Discount
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_Discount()
void Lith_Discount()
{ {
withplayer(LocalPlayer) p->discount = 0.9; withplayer(LocalPlayer) p->discount = 0.9;
} }
@ -428,8 +412,7 @@ void Lith_Discount()
// //
// Lith_BossWarning // Lith_BossWarning
// //
[[__call("ScriptS")]] script static void Lith_BossWarning(struct player *p)
static void Lith_BossWarning(struct player *p)
{ {
ACS_Delay(35 * 5); ACS_Delay(35 * 5);
@ -440,29 +423,29 @@ static void Lith_BossWarning(struct player *p)
// //
// Lith_PlayerRunScripts // Lith_PlayerRunScripts
// //
// Run main loop scripts. // Run main loop script.
// //
static void Lith_PlayerRunScripts(struct player *p) static void Lith_PlayerRunScripts(struct player *p)
{ {
[[__call("ScriptS")]] extern void Lith_PlayerPreWeapons(struct player *p); script extern void Lith_PlayerPreWeapons(struct player *p);
[[__call("ScriptS")]] static void Lith_PlayerPreScore(struct player *p); script static void Lith_PlayerPreScore(struct player *p);
[[__call("ScriptS")]] static void Lith_PlayerPreStats(struct player *p); script static void Lith_PlayerPreStats(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerUpdateCBIGUI(struct player *p); script extern void Lith_PlayerUpdateCBIGUI(struct player *p);
[[__call("ScriptS")]] static void Lith_PlayerUpdateAttributes(struct player *p); script static void Lith_PlayerUpdateAttributes(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerUpdateUpgrades(struct player *p); script extern void Lith_PlayerUpdateUpgrades(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerUpdateWeapons(struct player *p); script extern void Lith_PlayerUpdateWeapons(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerUpdateLog(struct player *p); script extern void Lith_PlayerUpdateLog(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerFootstep(struct player *p); script extern void Lith_PlayerFootstep(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerItemFx(struct player *p); script extern void Lith_PlayerItemFx(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerDamageBob(struct player *p); script extern void Lith_PlayerDamageBob(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerView(struct player *p); script extern void Lith_PlayerView(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerRenderUpgrades(struct player *p); script extern void Lith_PlayerRenderUpgrades(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerHUD(struct player *p); script extern void Lith_PlayerHUD(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerStyle(struct player *p); script extern void Lith_PlayerStyle(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerLevelup(struct player *p); script extern void Lith_PlayerLevelup(struct player *p);
[[__call("ScriptS")]] extern void Lith_PlayerDebugStats(struct player *p); script extern void Lith_PlayerDebugStats(struct player *p);
// Pre-logic: Update data from the engine. // Pre-logic: Update data from the engine.
Lith_PlayerPreWeapons(p); // Update weapon info Lith_PlayerPreWeapons(p); // Update weapon info
@ -504,8 +487,7 @@ static void Lith_PlayerRunScripts(struct player *p)
// //
// Lith_PlayerUpdateAttributes // Lith_PlayerUpdateAttributes
// //
[[__call("ScriptS")]] script static void Lith_PlayerUpdateAttributes(struct player *p)
static void Lith_PlayerUpdateAttributes(struct player *p)
{ {
fixed acc = p->attr.attrs[at_acc] / 210.0; fixed acc = p->attr.attrs[at_acc] / 210.0;
fixed def = p->attr.attrs[at_def] / 290.0; fixed def = p->attr.attrs[at_def] / 290.0;
@ -531,8 +513,7 @@ static void Lith_PlayerUpdateAttributes(struct player *p)
// //
// Lith_PlayerPreScore // Lith_PlayerPreScore
// //
[[__call("ScriptS")]] script static void Lith_PlayerPreScore(struct player *p)
static void Lith_PlayerPreScore(struct player *p)
{ {
if(!p->scoreaccumtime || p->score < p->old.score) if(!p->scoreaccumtime || p->score < p->old.score)
{ {
@ -549,8 +530,7 @@ static void Lith_PlayerPreScore(struct player *p)
// //
// Lith_PlayerPreStats // Lith_PlayerPreStats
// //
[[__call("ScriptS")]] script static void Lith_PlayerPreStats(struct player *p)
static void Lith_PlayerPreStats(struct player *p)
{ {
if(p->health < p->oldhealth) if(p->health < p->oldhealth)
p->healthused += p->oldhealth - p->health; p->healthused += p->oldhealth - p->health;

View File

@ -18,8 +18,7 @@ static void HUD_Waves(struct player *p);
// //
// Lith_PlayerDebugStats // Lith_PlayerDebugStats
// //
[[__call("ScriptS")]] script void Lith_PlayerDebugStats(struct player *p)
void Lith_PlayerDebugStats(struct player *p)
{ {
if(!(world.dbgLevel & log_devh)) return; if(!(world.dbgLevel & log_devh)) return;
@ -38,8 +37,7 @@ void Lith_PlayerDebugStats(struct player *p)
// //
// Lith_PlayerFootstep // Lith_PlayerFootstep
// //
[[__call("ScriptS")]] script void Lith_PlayerFootstep(struct player *p)
void Lith_PlayerFootstep(struct player *p)
{ {
fixed vol = p->getCVarK("lith_player_footstepvol"); fixed vol = p->getCVarK("lith_player_footstepvol");
if(!vol || ACS_Timer() % 10 != 0 || p->z - p->floorz > 16) return; if(!vol || ACS_Timer() % 10 != 0 || p->z - p->floorz > 16) return;
@ -78,8 +76,7 @@ void Lith_HUD_DrawWeaponSlots(struct player *p, int const *ncol, int ncols, char
// //
// Lith_PlayerItemFx // Lith_PlayerItemFx
// //
[[__call("ScriptS")]] script void Lith_PlayerItemFx(struct player *p)
void Lith_PlayerItemFx(struct player *p)
{ {
bool hasir = InvNum("PowerLightAmp"); bool hasir = InvNum("PowerLightAmp");
@ -94,8 +91,7 @@ void Lith_PlayerItemFx(struct player *p)
// //
// Update view bobbing when you get damaged. // Update view bobbing when you get damaged.
// //
[[__call("ScriptS")]] script void Lith_PlayerDamageBob(struct player *p)
void Lith_PlayerDamageBob(struct player *p)
{ {
if(!InvNum("PowerStrength") && p->health < p->oldhealth) if(!InvNum("PowerStrength") && p->health < p->oldhealth)
{ {
@ -124,8 +120,7 @@ void Lith_PlayerDamageBob(struct player *p)
// //
// Update additive view. // Update additive view.
// //
[[__call("ScriptS")]] script void Lith_PlayerView(struct player *p)
void Lith_PlayerView(struct player *p)
{ {
float addp = 0, addy = 0; float addp = 0, addy = 0;
@ -151,8 +146,7 @@ void Lith_PlayerView(struct player *p)
// //
// Lith_PlayerStyle // Lith_PlayerStyle
// //
[[__call("ScriptS")]] script void Lith_PlayerStyle(struct player *p)
void Lith_PlayerStyle(struct player *p)
{ {
if(p->scopetoken) { if(p->scopetoken) {
ACS_SetActorProperty(0, APROP_RenderStyle, STYLE_Subtract); ACS_SetActorProperty(0, APROP_RenderStyle, STYLE_Subtract);
@ -166,8 +160,7 @@ void Lith_PlayerStyle(struct player *p)
// //
// Lith_PlayerHUD // Lith_PlayerHUD
// //
[[__call("ScriptS")]] script void Lith_PlayerHUD(struct player *p)
void Lith_PlayerHUD(struct player *p)
{ {
ACS_SetHudSize(320, 200); ACS_SetHudSize(320, 200);
@ -212,8 +205,7 @@ void Lith_PlayerHUD(struct player *p)
// //
// Lith_PlayerLevelup // Lith_PlayerLevelup
// //
[[__call("ScriptS")]] script void Lith_PlayerLevelup(struct player *p)
void Lith_PlayerLevelup(struct player *p)
{ {
if(p->old.attr.level && p->old.attr.level < p->attr.level) { if(p->old.attr.level && p->old.attr.level < p->attr.level) {
ACS_LocalAmbientSound("player/levelup", 127); ACS_LocalAmbientSound("player/levelup", 127);

View File

@ -9,8 +9,7 @@
// //
// Lith_PlayerSaveData // Lith_PlayerSaveData
// //
[[__call("ScriptS")]] script void Lith_PlayerSaveData(struct player *p)
void Lith_PlayerSaveData(struct player *p)
{ {
savefile_t *save; savefile_t *save;
@ -21,8 +20,7 @@ void Lith_PlayerSaveData(struct player *p)
// //
// Lith_PlayerLoadData // Lith_PlayerLoadData
// //
[[__call("ScriptS")]] script void Lith_PlayerLoadData(struct player *p)
void Lith_PlayerLoadData(struct player *p)
{ {
savefile_t *save; savefile_t *save;

View File

@ -38,8 +38,7 @@ savefile_t *Lith_SaveBegin(struct player *p)
// //
// Lith_SaveEnd // Lith_SaveEnd
// //
[[__call("ScriptS")]] script void Lith_SaveEnd(savefile_t *save)
void Lith_SaveEnd(savefile_t *save)
{ {
Lith_SaveWriteChunk(save, Ident_Lend, SaveV_Lend, 0); Lith_SaveWriteChunk(save, Ident_Lend, SaveV_Lend, 0);
fclose(save->fp); fclose(save->fp);

View File

@ -11,7 +11,7 @@ enum {
typedef struct shopitem_s typedef struct shopitem_s
{ {
[[__anonymous]] shopdef_t shopdef; anonymous shopdef_t shopdef;
int pclass; int pclass;
int count; int count;
__str classname; __str classname;

View File

@ -222,8 +222,7 @@ void Lith_UpgrSetOwned(struct player *p, upgrade_t *upgr)
// //
// Lith_PlayerInitUpgrades // Lith_PlayerInitUpgrades
// //
[[__call("ScriptS")]] script void Lith_PlayerInitUpgrades(struct player *p)
void Lith_PlayerInitUpgrades(struct player *p)
{ {
#define CheckPClass() (UpgrInfo[i].pclass & p->pclass) #define CheckPClass() (UpgrInfo[i].pclass & p->pclass)
for(int i = 0; i < UpgrMax; i++) for(int i = 0; i < UpgrMax; i++)
@ -292,8 +291,7 @@ void Lith_PlayerReinitUpgrades(struct player *p)
// //
// Lith_PlayerUpdateUpgrades // Lith_PlayerUpdateUpgrades
// //
[[__call("ScriptS")]] script void Lith_PlayerUpdateUpgrades(struct player *p)
void Lith_PlayerUpdateUpgrades(struct player *p)
{ {
ForUpgrade(upgr) ForUpgrade(upgr)
if(upgr->active && upgr->info->Update) if(upgr->active && upgr->info->Update)
@ -303,8 +301,7 @@ void Lith_PlayerUpdateUpgrades(struct player *p)
// //
// Lith_PlayerRenderUpgrades // Lith_PlayerRenderUpgrades
// //
[[__call("ScriptS")]] script void Lith_PlayerRenderUpgrades(struct player *p)
void Lith_PlayerRenderUpgrades(struct player *p)
{ {
ForUpgrade(upgr) if(upgr->active && upgr->info->Render) ForUpgrade(upgr) if(upgr->active && upgr->info->Render)
{ {

View File

@ -84,8 +84,7 @@ static void Lith_PickupScore(struct player *p, int parm)
// //
// Lith_WeaponPickup // Lith_WeaponPickup
// //
[[__call("ScriptS"), __extern("ACS")]] script acs bool Lith_WeaponPickup(int name)
bool Lith_WeaponPickup(int name)
{ {
extern void Lith_PickupMessage(struct player *p, weaponinfo_t const *info); extern void Lith_PickupMessage(struct player *p, weaponinfo_t const *info);
extern int Lith_WeaponFromName(struct player *p, int name); extern int Lith_WeaponFromName(struct player *p, int name);
@ -132,8 +131,7 @@ bool Lith_WeaponPickup(int name)
// //
// Lith_CircleSpread // Lith_CircleSpread
// //
[[__call("ScriptS"), __extern("ACS")]] script acs fixed Lith_CircleSpread(fixed mdx, fixed mdy, bool getpitch)
fixed Lith_CircleSpread(fixed mdx, fixed mdy, bool getpitch)
{ {
static fixed A; static fixed A;
static fixed P; static fixed P;
@ -156,8 +154,7 @@ fixed Lith_CircleSpread(fixed mdx, fixed mdy, bool getpitch)
// //
// Lith_ChargeFistDamage // Lith_ChargeFistDamage
// //
[[__call("ScriptS"), __extern("ACS")]] script acs int Lith_ChargeFistDamage()
int Lith_ChargeFistDamage()
{ {
int amount = InvNum("Lith_FistCharge"); int amount = InvNum("Lith_FistCharge");
InvTake("Lith_FistCharge", 0x7FFFFFFF); InvTake("Lith_FistCharge", 0x7FFFFFFF);
@ -181,8 +178,7 @@ void Lith_GSInit_Weapon(void)
// //
// Update information on what weapons we have. // Update information on what weapons we have.
// //
[[__call("ScriptS")]] script void Lith_PlayerPreWeapons(struct player *p)
void Lith_PlayerPreWeapons(struct player *p)
{ {
weapondata_t *w = &p->weapon; weapondata_t *w = &p->weapon;
@ -264,8 +260,7 @@ void Lith_PlayerPreWeapons(struct player *p)
// //
// Lith_PlayerUpdateWeapons // Lith_PlayerUpdateWeapons
// //
[[__call("ScriptS")]] script void Lith_PlayerUpdateWeapons(struct player *p)
void Lith_PlayerUpdateWeapons(struct player *p)
{ {
__with(int heat = ACS_CheckInventory("Lith_SMGHeat");) { __with(int heat = ACS_CheckInventory("Lith_SMGHeat");) {
if(heat < 100) ACS_TakeInventory("Lith_SMGHeat", 5); if(heat < 100) ACS_TakeInventory("Lith_SMGHeat", 5);
@ -282,8 +277,7 @@ void Lith_PlayerUpdateWeapons(struct player *p)
// //
// Lith_AmmoRunOut // Lith_AmmoRunOut
// //
[[__call("ScriptS"), __extern("ACS")]] script acs fixed Lith_AmmoRunOut(bool ro, fixed mul)
fixed Lith_AmmoRunOut(bool ro, fixed mul)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {
@ -301,8 +295,7 @@ fixed Lith_AmmoRunOut(bool ro, fixed mul)
// //
// Lith_GetFinalizerMaxHealth // Lith_GetFinalizerMaxHealth
// //
[[__call("ScriptS"), __extern("ACS")]] script acs int Lith_GetFinalizerMaxHealth(void)
int Lith_GetFinalizerMaxHealth(void)
{ {
int sh = ACS_GetActorProperty(0, APROP_SpawnHealth); int sh = ACS_GetActorProperty(0, APROP_SpawnHealth);
@ -315,8 +308,7 @@ int Lith_GetFinalizerMaxHealth(void)
// //
// Lith_SwitchRifleMode // Lith_SwitchRifleMode
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_SwitchRifleFiremode(void)
void Lith_SwitchRifleFiremode(void)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {
@ -333,8 +325,7 @@ void Lith_SwitchRifleFiremode(void)
// //
// Lith_ResetRifleMode // Lith_ResetRifleMode
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_ResetRifleMode()
void Lith_ResetRifleMode()
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
if(p->getCVarI("lith_weapons_riflemodeclear")) if(p->getCVarI("lith_weapons_riflemodeclear"))
@ -344,8 +335,7 @@ void Lith_ResetRifleMode()
// //
// Lith_SurgeOfDestiny // Lith_SurgeOfDestiny
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_SurgeOfDestiny(void)
void Lith_SurgeOfDestiny(void)
{ {
for(int i = 0; i < (35 * 7) / 2; i++) { for(int i = 0; i < (35 * 7) / 2; i++) {
InvGive("Lith_SurgeOfDestiny", 1); InvGive("Lith_SurgeOfDestiny", 1);
@ -356,8 +346,7 @@ void Lith_SurgeOfDestiny(void)
// //
// Lith_GetWRF // Lith_GetWRF
// //
[[__call("ScriptS"), __extern("ACS")]] script acs int Lith_GetWRF(void)
int Lith_GetWRF(void)
{ {
enum enum
{ {

View File

@ -22,8 +22,7 @@ void Upgr_7777777_Deactivate(struct player *p, upgrade_t *upgr)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_7777777_Update(struct player *p, upgrade_t *upgr)
void Upgr_7777777_Update(struct player *p, upgrade_t *upgr)
{ {
fixed vel = -2; fixed vel = -2;
if(p->velz > 0) vel = p->velz; if(p->velz > 0) vel = p->velz;

View File

@ -17,8 +17,7 @@ void Upgr_Adrenaline_Activate(struct player *p, upgrade_t *upgr)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_Adrenaline_Update(struct player *p, upgrade_t *upgr)
void Upgr_Adrenaline_Update(struct player *p, upgrade_t *upgr)
{ {
// Charge // Charge
if(UData.charge < CHARGE_MAX) if(UData.charge < CHARGE_MAX)

View File

@ -24,8 +24,7 @@ void Upgr_CyberLegs_Deactivate(struct player *p, upgrade_t *upgr)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_CyberLegs_Update(struct player *p, upgrade_t *upgr)
void Upgr_CyberLegs_Update(struct player *p, upgrade_t *upgr)
{ {
fixed absvel = absk(p->old.velz) * 10.0k; fixed absvel = absk(p->old.velz) * 10.0k;

View File

@ -6,8 +6,7 @@
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_Goldeneye_Update(struct player *p, upgrade_t *upgr)
void Upgr_Goldeneye_Update(struct player *p, upgrade_t *upgr)
{ {
if(ACS_Random(0, 0x7F) < 0x50) if(ACS_Random(0, 0x7F) < 0x50)
{ {

View File

@ -9,8 +9,7 @@
// //
// CheckTarget // CheckTarget
// //
[[__call("ScriptS")]] script static int CheckTarget(struct player *p)
static int CheckTarget(struct player *p)
{ {
if(ACS_SetActivator(0, AAPTR_PLAYER_GETTARGET)) if(ACS_SetActivator(0, AAPTR_PLAYER_GETTARGET))
return Lith_UniqueID(0); return Lith_UniqueID(0);
@ -23,8 +22,7 @@ static int CheckTarget(struct player *p)
// //
// Lith_HomingMissile // Lith_HomingMissile
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_HomingMissile()
void Lith_HomingMissile()
{ {
struct player *p = Lith_GetPlayer(0, AAPTR_TARGET); struct player *p = Lith_GetPlayer(0, AAPTR_TARGET);
ACS_SetPointer(AAPTR_TRACER, p->tid, AAPTR_TRACER); ACS_SetPointer(AAPTR_TRACER, p->tid, AAPTR_TRACER);
@ -33,8 +31,7 @@ void Lith_HomingMissile()
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_HomingRPG_Update(struct player *p, upgrade_t *upgr)
void Upgr_HomingRPG_Update(struct player *p, upgrade_t *upgr)
{ {
if(p->weapontype == weapon_launcher) if(p->weapontype == weapon_launcher)
{ {

View File

@ -8,8 +8,7 @@
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_Implying_Update(struct player *p, upgrade_t *upgr)
void Upgr_Implying_Update(struct player *p, upgrade_t *upgr)
{ {
static __str strings[] = { static __str strings[] = {
"\Cd>implying", "\Cd>implying",

View File

@ -6,8 +6,7 @@
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_InstaDeath_Update(struct player *p, upgrade_t *upgr)
void Upgr_InstaDeath_Update(struct player *p, upgrade_t *upgr)
{ {
if(p->health < p->oldhealth) if(p->health < p->oldhealth)
InvGive("Lith_Die", 1); InvGive("Lith_Die", 1);

View File

@ -18,8 +18,7 @@ void Upgr_JetBooster_Activate(struct player *p, upgrade_t *upgr)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_JetBooster_Update(struct player *p, upgrade_t *upgr)
void Upgr_JetBooster_Update(struct player *p, upgrade_t *upgr)
{ {
UData.discharged = UData.charge > 60 && UData.charge < CHARGE_MAX; UData.discharged = UData.charge > 60 && UData.charge < CHARGE_MAX;

View File

@ -26,8 +26,7 @@ void Upgr_lolsords_Deactivate(struct player *p, upgrade_t *upgr)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_lolsords_Update(struct player *p, upgrade_t *upgr)
void Upgr_lolsords_Update(struct player *p, upgrade_t *upgr)
{ {
ACS_SetWeapon("Lith_Sword"); ACS_SetWeapon("Lith_Sword");
} }

View File

@ -31,8 +31,7 @@ static struct magic_info const minf[] = {
// //
// GiveMagic // GiveMagic
// //
[[__call("ScriptS")]] script static void GiveMagic(struct magic_info const *m)
static void GiveMagic(struct magic_info const *m)
{ {
InvGive(m->classname, 1); InvGive(m->classname, 1);
ACS_SetWeapon(m->classname); ACS_SetWeapon(m->classname);
@ -41,8 +40,7 @@ static void GiveMagic(struct magic_info const *m)
// //
// UpdateMagicUI // UpdateMagicUI
// //
[[__call("ScriptS")]] script static void UpdateMagicUI(struct player *p, upgrade_t *upgr)
static void UpdateMagicUI(struct player *p, upgrade_t *upgr)
{ {
gui_state_t *g = &UData.gst; gui_state_t *g = &UData.gst;
@ -86,8 +84,7 @@ static void UpdateMagicUI(struct player *p, upgrade_t *upgr)
// //
// GivePlayerZ // GivePlayerZ
// //
[[__call("ScriptS")]] script static void GivePlayerZ(int tid, struct player *p, __str name)
static void GivePlayerZ(int tid, struct player *p, __str name)
{ {
while(ACS_ThingCount(T_NONE, tid)) { while(ACS_ThingCount(T_NONE, tid)) {
ACS_SetUserVariable(tid, name, p->z); ACS_SetUserVariable(tid, name, p->z);
@ -100,8 +97,7 @@ static void GivePlayerZ(int tid, struct player *p, __str name)
// //
// Lith_SetMagicUI // Lith_SetMagicUI
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_SetMagicUI(bool on)
void Lith_SetMagicUI(bool on)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {
@ -135,8 +131,7 @@ void Lith_SetMagicUI(bool on)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_Magic_Update(struct player *p, upgrade_t *upgr)
void Upgr_Magic_Update(struct player *p, upgrade_t *upgr)
{ {
fixed manaperc = p->mana / (fixed)p->manamax; fixed manaperc = p->mana / (fixed)p->manamax;

View File

@ -8,8 +8,7 @@
// //
// Lith_PunctuatorFire // Lith_PunctuatorFire
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_PunctuatorFire(void)
void Lith_PunctuatorFire(void)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {

View File

@ -46,8 +46,7 @@ static void RA_Give(__str name, int n)
// //
// Lith_RA_Give // Lith_RA_Give
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_RA_Give(int num)
void Lith_RA_Give(int num)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {

View File

@ -10,8 +10,7 @@
// //
// Lith_DodgeView // Lith_DodgeView
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_DodgeView()
void Lith_DodgeView()
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
{ {
@ -49,8 +48,7 @@ void Upgr_ReflexWetw_Deactivate(struct player *p, upgrade_t *upgr)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_ReflexWetw_Update(struct player *p, upgrade_t *upgr)
void Upgr_ReflexWetw_Update(struct player *p, upgrade_t *upgr)
{ {
if(UData.charge < CHARGE_MAX) if(UData.charge < CHARGE_MAX)
UData.charge++; UData.charge++;

View File

@ -17,8 +17,7 @@ void Upgr_StealthSys_Deactivate(struct player *p, upgrade_t *upgr)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_StealthSys_Update(struct player *p, upgrade_t *upgr)
void Upgr_StealthSys_Update(struct player *p, upgrade_t *upgr)
{ {
fixed vel = absk(p->getVel()) / 10.0; fixed vel = absk(p->getVel()) / 10.0;
p->alpha = UData.mulvel = lerpk(UData.mulvel, vel, 0.02); p->alpha = UData.mulvel = lerpk(UData.mulvel, vel, 0.02);

View File

@ -23,8 +23,7 @@ void Upgr_UNCEUNCE_Deactivate(struct player *p, upgrade_t *upgr)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_UNCEUNCE_Update(struct player *p, upgrade_t *upgr)
void Upgr_UNCEUNCE_Update(struct player *p, upgrade_t *upgr)
{ {
fixed reeeed = ACS_Sin(p->ticks / 35.0) + 1.0 / 2.0; fixed reeeed = ACS_Sin(p->ticks / 35.0) + 1.0 / 2.0;
fixed greeen = ACS_Cos(p->ticks / 24.0) + 1.0 / 2.0; fixed greeen = ACS_Cos(p->ticks / 24.0) + 1.0 / 2.0;

View File

@ -12,8 +12,7 @@
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_VitalScan_Update(struct player *p, upgrade_t *upgr)
void Upgr_VitalScan_Update(struct player *p, upgrade_t *upgr)
{ {
ACS_SetActivator(0, AAPTR_PLAYER_GETTARGET); ACS_SetActivator(0, AAPTR_PLAYER_GETTARGET);

View File

@ -13,8 +13,7 @@
// //
// Lith_KeyZoom // Lith_KeyZoom
// //
[[__call("ScriptS"), __extern("ACS"), __script("net")]] script acs net void Lith_KeyZoom(int amt)
void Lith_KeyZoom(int amt)
{ {
if(ACS_Timer() < 10) return; if(ACS_Timer() < 10) return;
@ -42,8 +41,7 @@ void Upgr_Zoom_Deactivate(struct player *p, upgrade_t *upgr)
// //
// Update // Update
// //
[[__call("ScriptS")]] script void Upgr_Zoom_Update(struct player *p, upgrade_t *upgr)
void Upgr_Zoom_Update(struct player *p, upgrade_t *upgr)
{ {
if(UData.vzoom < UData.zoom) if(UData.vzoom < UData.zoom)
UData.vzoom = lerpf(UData.vzoom, UData.zoom, 0.099); UData.vzoom = lerpf(UData.vzoom, UData.zoom, 0.099);

View File

@ -122,8 +122,7 @@ static bool CheckDead(struct boss *b, int num)
// //
// Lith_PhantomSound // Lith_PhantomSound
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_PhantomSound(void)
void Lith_PhantomSound(void)
{ {
ACS_AmbientSound("enemies/phantom/spawned", 127); ACS_AmbientSound("enemies/phantom/spawned", 127);
} }
@ -131,8 +130,7 @@ void Lith_PhantomSound(void)
// //
// Lith_PhantomTeleport // Lith_PhantomTeleport
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_PhantomTeleport(void)
void Lith_PhantomTeleport(void)
{ {
fixed ang = ACS_GetActorAngle(0); fixed ang = ACS_GetActorAngle(0);
@ -147,8 +145,7 @@ void Lith_PhantomTeleport(void)
// //
// Lith_PhantomDeath // Lith_PhantomDeath
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_PhantomDeath(void)
void Lith_PhantomDeath(void)
{ {
ACS_StopSound(0, 7); ACS_StopSound(0, 7);
@ -192,8 +189,7 @@ void Lith_PhantomDeath(void)
// //
// Lith_SpawnBoss // Lith_SpawnBoss
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_SpawnBoss(void)
void Lith_SpawnBoss(void)
{ {
if(!boss) return; if(!boss) return;
@ -211,8 +207,7 @@ void Lith_SpawnBoss(void)
// //
// Lith_TriggerBoss_Script // Lith_TriggerBoss_Script
// //
[[__call("ScriptS"), __extern("ACS"), __address("Lith_TriggerBoss"), __optional_args(1)]] script acs address("Lith_TriggerBoss") optargs(1) void Lith_TriggerBoss_Script(int diff, int num, int phase)
void Lith_TriggerBoss_Script(int diff, int num, int phase)
{ {
switch(diff) switch(diff)
{ {
@ -230,8 +225,7 @@ void Lith_TriggerBoss_Script(int diff, int num, int phase)
// //
// Lith_SpawnBosses // Lith_SpawnBosses
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_SpawnBosses(i96 sum, bool force)
void Lith_SpawnBosses(i96 sum, bool force)
{ {
if(!force && sum < scorethreshold) return; if(!force && sum < scorethreshold) return;

View File

@ -76,8 +76,7 @@ void Lith_InstallSpawnedCBIItems(void)
// //
// Lith_CBIItemWasSpawned // Lith_CBIItemWasSpawned
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_CBIItemWasSpawned(int num)
void Lith_CBIItemWasSpawned(int num)
{ {
cbispawn[cbispawniter++] = num; cbispawn[cbispawniter++] = num;
} }
@ -85,8 +84,7 @@ void Lith_CBIItemWasSpawned(int num)
// //
// Lith_PickupCBIItem // Lith_PickupCBIItem
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_PickupCBIItem(int num)
void Lith_PickupCBIItem(int num)
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
Lith_FadeFlash(0, 255, 0, 0.7, 0.5); Lith_FadeFlash(0, 255, 0, 0.7, 0.5);

View File

@ -10,8 +10,7 @@
// How to make DECORATE into a decent VM: Registers! // How to make DECORATE into a decent VM: Registers!
#define PVarFunc(fn, expr) \ #define PVarFunc(fn, expr) \
[[__call("ScriptS"), __extern("ACS")]] \ script acs int fn \
int fn \
{ \ { \
withplayer(LocalPlayer) { \ withplayer(LocalPlayer) { \
int *val = &p->decvars[var - 1]; \ int *val = &p->decvars[var - 1]; \
@ -21,8 +20,7 @@
} }
#define WVarFunc(fn, expr) \ #define WVarFunc(fn, expr) \
[[__call("ScriptS"), __extern("ACS")]] \ script acs int fn {int *val = &world.decvars[var - 1]; return expr;}
int fn {int *val = &world.decvars[var - 1]; return expr;}
#define RegisterMachine(reg, name) \ #define RegisterMachine(reg, name) \
reg(L##name##Get(int var ), (*val) ) \ reg(L##name##Get(int var ), (*val) ) \
@ -43,8 +41,7 @@ RegisterMachine(WVarFunc, WVar)
// //
// Lith_UniqueTID // Lith_UniqueTID
// //
[[__call("ScriptS"), __extern("ACS")]] script acs int Lith_UniqueTID(void)
int Lith_UniqueTID(void)
{ {
return ACS_UniqueTID(); return ACS_UniqueTID();
} }
@ -52,8 +49,7 @@ int Lith_UniqueTID(void)
// //
// Lith_Timer // Lith_Timer
// //
[[__call("ScriptS"), __extern("ACS")]] script acs int Lith_Timer(void)
int Lith_Timer(void)
{ {
return ACS_Timer(); return ACS_Timer();
} }
@ -61,8 +57,7 @@ int Lith_Timer(void)
// //
// Lith_UpdateScore // Lith_UpdateScore
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_UpdateScore(void)
void Lith_UpdateScore(void)
{ {
i96 score = ACS_CheckInventory("Lith_ScoreCount") * (double)RandomFloat(0.7f, 1.2f); i96 score = ACS_CheckInventory("Lith_ScoreCount") * (double)RandomFloat(0.7f, 1.2f);
Lith_GiveAllScore(score, false); Lith_GiveAllScore(score, false);
@ -72,8 +67,7 @@ void Lith_UpdateScore(void)
// //
// Lith_Velocity // Lith_Velocity
// //
[[__call("ScriptS"), __extern("ACS")]] script acs fixed Lith_Velocity(fixed velx, fixed vely)
fixed Lith_Velocity(fixed velx, fixed vely)
{ {
fixed x = ACS_GetActorX(0); fixed x = ACS_GetActorX(0);
fixed y = ACS_GetActorY(0); fixed y = ACS_GetActorY(0);
@ -83,8 +77,7 @@ fixed Lith_Velocity(fixed velx, fixed vely)
// //
// Lith_VelHax // Lith_VelHax
// //
[[__call("ScriptS"), __extern("ACS")]] script acs int Lith_VelHax(int fuck)
int Lith_VelHax(int fuck)
{ {
ACS_SetActivator(0, AAPTR_MASTER); ACS_SetActivator(0, AAPTR_MASTER);
@ -101,8 +94,7 @@ int Lith_VelHax(int fuck)
// //
// Lith_Barrier // Lith_Barrier
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_Barrier()
void Lith_Barrier()
{ {
withplayer(LocalPlayer) withplayer(LocalPlayer)
for(int i = 0; p->active && i < 35 * 30; i++) for(int i = 0; p->active && i < 35 * 30; i++)
@ -115,8 +107,7 @@ void Lith_Barrier()
// //
// Lith_BarrierBullets // Lith_BarrierBullets
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_BarrierBullets()
void Lith_BarrierBullets()
{ {
struct player *p = Lith_GetPlayer(0, AAPTR_TARGET); struct player *p = Lith_GetPlayer(0, AAPTR_TARGET);
@ -134,8 +125,7 @@ void Lith_BarrierBullets()
// //
// Lith_BarrierCheck // Lith_BarrierCheck
// //
[[__call("ScriptS"), __extern("ACS")]] script acs bool Lith_BarrierCheck()
bool Lith_BarrierCheck()
{ {
ACS_SetActivatorToTarget(0); ACS_SetActivatorToTarget(0);
return ACS_CheckFlag(0, "COUNTKILL"); return ACS_CheckFlag(0, "COUNTKILL");
@ -144,8 +134,7 @@ bool Lith_BarrierCheck()
// //
// Lith_PoisonFXTicker // Lith_PoisonFXTicker
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_PoisonFXTicker()
void Lith_PoisonFXTicker()
{ {
for(int i = 0; i < 17; i++) for(int i = 0; i < 17; i++)
{ {

View File

@ -19,8 +19,7 @@ extern struct dlgdef *lmvar dlgdefs;
// Static Functions ----------------------------------------------------------| // Static Functions ----------------------------------------------------------|
[[__optional_args(1)]] optargs(1) static int *NextCode(struct pstate *d);
static int *NextCode(struct pstate *d);
static void GetStatement(struct pstate *d); static void GetStatement(struct pstate *d);
// Types ---------------------------------------------------------------------| // Types ---------------------------------------------------------------------|

View File

@ -8,7 +8,7 @@
// Static Objects ------------------------------------------------------------| // Static Objects ------------------------------------------------------------|
// This is lazy-allocated. Don't touch or GDCC will break your computer's face. // This is lazy-allocated. Don't touch or GDCC will break your computer's face.
[[__no_init]] static dmon_t dmonalloc[DMON_MAX]; noinit static dmon_t dmonalloc[DMON_MAX];
// Extern Objects ------------------------------------------------------------| // Extern Objects ------------------------------------------------------------|
@ -60,8 +60,7 @@ void DmonDebugInfo(void)
// //
// DmonPtr // DmonPtr
// //
[[__call("ScriptS")]] script dmon_t *DmonPtr(int tid, int ptr)
dmon_t *DmonPtr(int tid, int ptr)
{ {
if(tid || ptr) if(tid || ptr)
ACS_SetActivator(tid, ptr); ACS_SetActivator(tid, ptr);

View File

@ -240,8 +240,7 @@ static void ApplyLevels(dmon_t *m, int prev)
// //
// ShowBarrier // ShowBarrier
// //
[[__call("StkCall")]] stkcall static void ShowBarrier(dmon_t const *m, fixed alpha)
static void ShowBarrier(dmon_t const *m, fixed alpha)
{ {
bool anyplayer = false; bool anyplayer = false;
@ -329,8 +328,7 @@ static void ApplyPainResist(dmon_t *m)
// Spawn a Monster Soul and temporarily set the species of it until the // Spawn a Monster Soul and temporarily set the species of it until the
// actor is no longer solid, so it won't explode immediately. // actor is no longer solid, so it won't explode immediately.
// //
[[__call("ScriptS")]] script static void SoulCleave(dmon_t *m, struct player *p)
static void SoulCleave(dmon_t *m, struct player *p)
{ {
int tid = ACS_UniqueTID(); int tid = ACS_UniqueTID();
ACS_SpawnForced("Lith_MonsterSoul", m->ms->x, m->ms->y, m->ms->z + 16, tid); ACS_SpawnForced("Lith_MonsterSoul", m->ms->x, m->ms->y, m->ms->z + 16, tid);
@ -420,8 +418,7 @@ static void OnDeath(dmon_t *m)
// //
// Lith_MonsterMain // Lith_MonsterMain
// //
[[__call("ScriptS"), __alloc_Aut(0x7F)]] script stksize(0x7f) void Lith_MonsterMain(dmon_t *m)
void Lith_MonsterMain(dmon_t *m)
{ {
struct dmon_stat ms = {}; struct dmon_stat ms = {};
@ -464,8 +461,7 @@ void Lith_MonsterMain(dmon_t *m)
// //
// Lith_MonsterInfo // Lith_MonsterInfo
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_MonsterInfo(int tid)
void Lith_MonsterInfo(int tid)
{ {
if(tid) ACS_SetActivator(tid); if(tid) ACS_SetActivator(tid);
while(!world.gsinit) ACS_Delay(1); while(!world.gsinit) ACS_Delay(1);
@ -501,8 +497,7 @@ void Lith_MonsterInfo(int tid)
// //
// Lith_MonsterFinalized // Lith_MonsterFinalized
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_MonsterFinalized()
void Lith_MonsterFinalized()
{ {
ifauto(dmon_t *, m, DmonPtr()) ifauto(dmon_t *, m, DmonPtr())
OnFinalize(m); OnFinalize(m);

View File

@ -15,8 +15,7 @@ enum
// //
// Blinker // Blinker
// //
[[__call("ScriptS")]] script void Blinker(void)
void Blinker(void)
{ {
static int const time = 20; static int const time = 20;
@ -47,8 +46,7 @@ void Blinker(void)
// //
// Lith_Title // Lith_Title
// //
[[__call("ScriptS")]] script void Lith_Title(void)
void Lith_Title(void)
{ {
ACS_Delay(35*5); ACS_Delay(35*5);

View File

@ -39,8 +39,7 @@ static bool dorain;
// Extern Functions ----------------------------------------------------------| // Extern Functions ----------------------------------------------------------|
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_SpawnBosses(i96 sum, bool force);
void Lith_SpawnBosses(i96 sum, bool force);
// //
// Lith_GetWorldExtern // Lith_GetWorldExtern
@ -53,8 +52,7 @@ worldinfo_t *Lith_GetWorldExtern(void)
// //
// Lith_FreezeTime // Lith_FreezeTime
// //
[[__call("StkCall")]] stkcall void Lith_FreezeTime(bool on)
void Lith_FreezeTime(bool on)
{ {
static int lmvar frozen; static int lmvar frozen;
@ -95,8 +93,7 @@ void Lith_FreezeTime(bool on)
// //
// Lith_BeginAngles // Lith_BeginAngles
// //
[[__call("StkCall")]] stkcall void Lith_BeginAngles(int x, int y)
void Lith_BeginAngles(int x, int y)
{ {
world.a_cur = 0; world.a_cur = 0;
for(int i = 0; i < countof(world.a_angles); i++) for(int i = 0; i < countof(world.a_angles); i++)
@ -111,8 +108,7 @@ void Lith_BeginAngles(int x, int y)
// //
// Lith_AddAngle // Lith_AddAngle
// //
[[__call("StkCall")]] stkcall fixed Lith_AddAngle(int x, int y)
fixed Lith_AddAngle(int x, int y)
{ {
if(world.a_cur >= countof(world.a_angles)) if(world.a_cur >= countof(world.a_angles))
return 0; return 0;
@ -125,8 +121,7 @@ fixed Lith_AddAngle(int x, int y)
// //
// Lith_AddAngleScript // Lith_AddAngleScript
// //
[[__call("ScriptS"), __extern("ACS"), __address("Lith_AddAngle")]] script acs address("Lith_AddAngle") void Lith_AddAngleScript(int x, int y)
void Lith_AddAngleScript(int x, int y)
{ {
Lith_AddAngle(x, y); Lith_AddAngle(x, y);
} }
@ -178,8 +173,7 @@ int Lith_UniqueID(int tid)
// //
// Lith_EmitScore // Lith_EmitScore
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_EmitScore(int amount)
void Lith_EmitScore(int amount)
{ {
Lith_GiveAllScore(amount, false); Lith_GiveAllScore(amount, false);
} }
@ -187,8 +181,7 @@ void Lith_EmitScore(int amount)
// //
// Lith_EmitEXP // Lith_EmitEXP
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_EmitEXP(int amount)
void Lith_EmitEXP(int amount)
{ {
Lith_GiveAllEXP(amount); Lith_GiveAllEXP(amount);
} }
@ -196,8 +189,7 @@ void Lith_EmitEXP(int amount)
// //
// Lith_MakeSerious // Lith_MakeSerious
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_MakeSerious()
void Lith_MakeSerious()
{ {
ACS_SetActorProperty(0, APROP_RenderStyle, STYLE_None); ACS_SetActorProperty(0, APROP_RenderStyle, STYLE_None);
ACS_SetActorPropertyString(0, APROP_ActiveSound, "silence"); ACS_SetActorPropertyString(0, APROP_ActiveSound, "silence");
@ -208,8 +200,7 @@ void Lith_MakeSerious()
// //
// LPData // LPData
// //
[[__call("ScriptS"), __extern("ACS")]] script acs int LPData(int info, int permutation, bool target)
int LPData(int info, int permutation, bool target)
{ {
if(target) ACS_SetActivatorToTarget(0); if(target) ACS_SetActivatorToTarget(0);
@ -230,8 +221,7 @@ int LPData(int info, int permutation, bool target)
// //
// LWData // LWData
// //
[[__call("ScriptS"), __extern("ACS")]] script acs int LWData(int info)
int LWData(int info)
{ {
switch(info) switch(info)
{ {
@ -249,8 +239,7 @@ int LWData(int info)
// //
// Lith_RainDropSpawn // Lith_RainDropSpawn
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_RainDropSpawn()
void Lith_RainDropSpawn()
{ {
if(rain_chk) if(rain_chk)
{ {
@ -266,8 +255,7 @@ void Lith_RainDropSpawn()
// //
// DoRain // DoRain
// //
[[__call("ScriptS")]] script static void DoRain()
static void DoRain()
{ {
// Doesn't work in multiplayer, sorry! // Doesn't work in multiplayer, sorry!
if(ACS_PlayerCount() > 1) if(ACS_PlayerCount() > 1)
@ -338,8 +326,7 @@ static void DoPayout(void)
Lith_ForPlayer() Lith_ForPlayer()
{ {
[[__call("ScriptS")]] script extern void Lith_PlayerPayout(struct player *p);
extern void Lith_PlayerPayout(struct player *p);
Lith_PlayerPayout(p); Lith_PlayerPayout(p);
} }
@ -350,8 +337,7 @@ static void DoPayout(void)
// //
// CheckEnemyCompat // CheckEnemyCompat
// //
[[__call("ScriptS")]] script static void CheckEnemyCompat(void)
static void CheckEnemyCompat(void)
{ {
if(ACS_GetCVar("sv_nomonsters") || world.enemycheck) if(ACS_GetCVar("sv_nomonsters") || world.enemycheck)
return; return;
@ -380,8 +366,7 @@ static void CheckEnemyCompat(void)
// //
// SpawnBoss // SpawnBoss
// //
[[__call("ScriptS")]] script static void SpawnBoss()
static void SpawnBoss()
{ {
ACS_Delay(1); // Delay another tic for monster spawners. ACS_Delay(1); // Delay another tic for monster spawners.
@ -607,13 +592,11 @@ static void WInit(void)
// //
// Lith_World // Lith_World
// //
[[__call("ScriptS"), __script("open")]] script type("open") static void Lith_World(void)
static void Lith_World(void)
{ {
begin: begin:
if(ACS_GameType() == GAME_TITLE_MAP) { if(ACS_GameType() == GAME_TITLE_MAP) {
[[__call("ScriptS")]] script extern void Lith_Title(void);
extern void Lith_Title(void);
Lith_Title(); Lith_Title();
return; return;
} }
@ -719,8 +702,7 @@ begin:
// //
// Lith_WorldReopen // Lith_WorldReopen
// //
[[__call("ScriptS"), __extern("ACS")]] script acs void Lith_WorldReopen(void)
void Lith_WorldReopen(void)
{ {
reopen = true; reopen = true;
} }
@ -728,8 +710,7 @@ void Lith_WorldReopen(void)
// //
// Lith_WorldUnload // Lith_WorldUnload
// //
[[__call("ScriptS"), __script("unloading")]] script type("unloading") static void Lith_WorldUnload(void)
static void Lith_WorldUnload(void)
{ {
extern void Lith_InstallSpawnedCBIItems(void); extern void Lith_InstallSpawnedCBIItems(void);
world.unloaded = true; world.unloaded = true;