Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (vicknick, 7th_zorro), 888 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
Member
Ericmor  Offline 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...
Code:
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 Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Code:
my.emask &= ~ENABLE_SCAN


Its btw mentioned in the manual: http://www.conitec.net/beta/flags.htm


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 Offline OP
Member
Ericmor  Offline 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.
Code:
set(my, ENABLE_SCAN);
reset(you,ENABLE_SCAN);


It would be so more simaple frown

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 Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Write your own macro that does the job:
Code:
#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 Offline
Senior Expert
Quad  Offline
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: Quad] #371900
05/26/11 13:41
05/26/11 13:41
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Thanks, JustSid and Quadraxas!
I just copy/pasted your code in my acknex.h!
Seriously, seems like a good analysis inside acknex.h, Litec.h, compat.h and afuncs.h and all pre-defined scripts are necessary for a good understanding of the Lite-C... i tought all i needed was the tutorials, but that´s far from the truth... specially for big projects.
Thanks again!

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 Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: Ericmor
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
Re: my.emask |= ENABLE_SCAN = off? [Re: WretchedSid] #371904
05/26/11 14:06
05/26/11 14:06
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
yeah, instead of doing that just include acknex.h


3333333333
Re: my.emask |= ENABLE_SCAN = off? [Re: WretchedSid] #371988
05/27/11 00:13
05/27/11 00:13
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
...what?!?
I have a copy of acknex.h inside my project folder (to preserve the original)... i can´t have that?!?
Even owning the full license?
Well, placing the code in another location (inside the initial script maybe) would affect it in any way?

Re: my.emask |= ENABLE_SCAN = off? [Re: Ericmor] #371991
05/27/11 01:22
05/27/11 01:22
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Well, i deleted the lines from acknex.h and declared it in the main game.c, right after the acknex.h includes... the engine didn´t complained, so i guess it worked (can´t be sure, i still have 10000 lines of C-script to translate, lol)!

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1