What you're looking for is pre-increment, so:
Code: Select all
bool recursionTest (int loop)
{
if (loop == 5)
return true;
else
return (recursionTest(++loop));
}
Code: Select all
bool recursionTest (int loop)
{
if (loop == 5)
return true;
else
return (recursionTest(++loop));
}
Code: Select all
typedef [[call("ScriptS")]]void(*ThreadFunction)(void*);
Code: Select all
function(argument);
Code: Select all
ACS_NamedExecuteWithResult((__str_ent)function, argument);
Code: Select all
__asm
(
"Move_W 1, Stk(), LocReg(Lit(:function))\n"
"Move_W 1, Stk(), LocReg(Lit(:argument))\n"
"Cnat 1, Lit(44), Stk(), Stk()\n"
"Move_W 1, Nul(), Stk()\n"
);
Code: Select all
ACS_NativeDeclFull(126, 0, int, NamedRequestScriptPuke, __str, int, int, int, int);
ACS_NativeDeclFull(127, 0, int, SystemTime, void);
ACS_NativeDeclFull(128, 0, int, GetTimeProperty, int, int, int);
ACS_NativeDeclFull(129, 0, __str, Strftime, int, __str, int);
Code: Select all
#define TM_SECOND 0
#define TM_MINUTE 1
#define TM_HOUR 2
#define TM_DAY 3
#define TM_MONTH 4
#define TM_YEAR 5
#define TM_WEEKDAY 6
Code: Select all
gdcc-cc --sys-include /usr/local/share/gdcc/lib/inc/C --bc-target ZDoom test.c -o test.acs
ERROR: Function undefined: '___GDCC__Plsf'
Code: Select all
gdcc-makelib --bc-target=ZDoom libGDCC -c -o libGDCC.o
gdcc-cc --bc-target=ZDoom test.c -c -o test.o
gdcc-ld --bc-target=ZDoom test.o libGDCC.o -o test.acs
Code: Select all
[[__address(7)]] __gbl_reg int SomeVar;
Code: Select all
#include <ACS_ZDoom.h>
#include <stdio.h>
#include <stdbool.h>
#define MAX_LEVELS 16
#define JUNCTION_LEVELNUM 2
//#define DEBUGSCRIPT
__addrdef __hub_arr hub_var;
[[__address(777)]] hub_var bool exitedLevels[MAX_LEVELS] = {false};
#ifdef DEBUGSCRIPT
[[call("ScriptS"), script("Enter")]]
void CheckLevelExits() {
ACS_BeginPrint();
for(int i = 0; i < MAX_LEVELS; i++) {
__nprintf("%d ", exitedLevels[i]);
}
ACS_EndPrint();
}
#endif
[[call("ScriptI"), address(777)]]
void ExitLevel(int spotnum) {
exitedLevels[ACS_GetLevelInfo(LEVELINFO_LEVELNUM)] = true;
ACS_Teleport_NewMap(JUNCTION_LEVELNUM, spotnum, 0);
}