2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
my.emask |= ENABLE_SCAN = off?
#371892
05/26/11 12:24
05/26/11 12:24
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
Hi people; I´m translating old c-scripts to Lite-C, and i know that...
my.enable_scan=on; //C-script
is now:
my.emask |= ENABLE_SCAN;//Lite-C
...but how do you write "my.enable_scan=OFF"? Any help is appreciated, thanks in advance.
|
|
|
Re: my.emask |= ENABLE_SCAN = off?
[Re: Ericmor]
#371893
05/26/11 12:27
05/26/11 12:27
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: my.emask |= ENABLE_SCAN = off?
[Re: WretchedSid]
#371894
05/26/11 12:49
05/26/11 12:49
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
Thanks JustSid. Pity, emasks can´t be set/reset/toggled like the other flags.
set(my, ENABLE_SCAN);
reset(you,ENABLE_SCAN);
It would be so more simaple
|
|
|
Re: my.emask |= ENABLE_SCAN = off?
[Re: Ericmor]
#371898
05/26/11 13:20
05/26/11 13:20
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Write your own macro that does the job:
#define setEmask(ent, flag) ent.emask |= flag
#define resetEmask(ent, flag) ent.emask &= ~flag
#define toggleEmask(ent, flag) ent.emask ^= flag
#define isEmask(ent, flag) ent.emask & flag
Its just like the set, reset, toggle and is macros that are already defined for you in the engine.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: my.emask |= ENABLE_SCAN = off?
[Re: WretchedSid]
#371899
05/26/11 13:30
05/26/11 13:30
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
there is also an undocumented reset_emask(); function, when called from inside an event, it resets that event from the emask.
the function is placed right after the set/reset macros in acknex.h
3333333333
|
|
|
Re: my.emask |= ENABLE_SCAN = off?
[Re: Ericmor]
#371901
05/26/11 13:46
05/26/11 13:46
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
I just copy/pasted your code in my acknex.h! DON'T do this! Acknex.h doesn't belong to you but to the engine, you should only edit files that belong to you!
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|