2 registered members (Ayumi, 1 invisible),
584
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
FLAGS.. lets solve this problem together...
#144885
08/01/07 04:18
08/01/07 04:18
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
Lets face it guys... For anyone going from Cscript to LiteC, the flags are a really big pain in the ass. Could one of you more experienced programmers shed some light on a very dim path? HOW EXACTLY DO WE SET AND RESET AND DO WHATEVER... with the new flags? Quote:
LC In C, C++, or Lite-C, a flag is set at runtime by OR-ing the flags parameter with the flag (material.flags |= TANGENT;); it is reset by AND-ing the flags parameter with the inverse flag (material.flags &= ~TANGENT;); and it is read by AND-ing the flags parameter with the flag and comparing the result with zero. LC Entities have more than 32 flags and thus need several flag parameters in lite-C. The other parameters are flags2, eflags, emask, and smask. The parameter a flag belongs to is given in its Type field.
OH... that makes things much clearer... NOT!
"There is no problem that can't be solved with time and determination." -me prenceofdarkness for instant messages on AIM.
Looking for a model designer PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
|
|
|
Re: FLAGS.. lets solve this problem together...
[Re: PrenceOfDarkness]
#144887
08/01/07 04:48
08/01/07 04:48
|
Joined: Aug 2005
Posts: 390 Florida
oldschoolj
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 390
Florida
|
all I can say is yep... had a movement code that used alot of flags. had to completely redo that code, because I'm not smart enoug hto figure it out...
you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe.
__________________________________
yours truly
|
|
|
Re: FLAGS.. lets solve this problem together...
[Re: msl_manni]
#144890
08/01/07 07:58
08/01/07 07:58
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
Summary: there are 4 standard operations in acknex for particular flags which are covered by convenience macros. If you use them, you don't need to write the slightly unhandy flag-code everywhere (it is better to read and better to understand. Code:
#define set(obj,flag) obj.flags |= (flag) #define reset(obj,flag) obj.flags &= ~(flag) #define toggle(obj,flag) obj.flags ^= (flag) #define is(obj,flag) (obj.flags & (flag))
In addition, flags can be combined like you wish, e.g. Code:
set(my, VISIBLE | TRANSLUCENT | FAT | LOCAL);
or
my.flags |= (VISIBLE | TRANSLUCENT | FAT | LOCAL);
all available flags are listed in "atypes.h". This way you can define your own flags as well! But don't try to exceed the memoryspace of the variable which receives the flag(s) (a variable can store as much flags as bits it has). I hope this helps.
|
|
|
Re: FLAGS.. lets solve this problem together...
[Re: HeelX]
#144891
08/01/07 19:27
08/01/07 19:27
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi guys! With the help of D3D I've posted a 3 page table of flags in Lite-C Contribution under flags at a glance. Hope this helps...I'm using it and making improvements to it as I go. If you have any suggestions ...please do so. Ottawa
|
|
|
Re: FLAGS.. lets solve this problem together...
[Re: Ottawa]
#144892
08/02/07 16:25
08/02/07 16:25
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
i want to use set,reset,toggle, and is, but i'm afraid in a week they wont support it any more and i have to go and re-freaking script everything again set(obj,flag) is so easy... u guys think it's okay?
"There is no problem that can't be solved with time and determination." -me prenceofdarkness for instant messages on AIM.
Looking for a model designer PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
|
|
|
Re: FLAGS.. lets solve this problem together...
[Re: PrenceOfDarkness]
#144893
08/02/07 16:53
08/02/07 16:53
|
Joined: Aug 2005
Posts: 390 Florida
oldschoolj
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 390
Florida
|
those are macros and I think they are here to stay bud
you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe.
__________________________________
yours truly
|
|
|
|