Go Back   Winamp Forums > Visualizations > AVS > AVS Wishlist

Reply
Thread Tools Search this Thread Display Modes
Old 4th March 2004, 14:43   #1
Neoavs
Junior Member
 
Neoavs's Avatar
 
Join Date: Jan 2004
Location: Vilnius, Lithuania
Posts: 29
Send a message via ICQ to Neoavs
New edit box in codable effects

I was thinking of an On KbMouse edit box in AVS' codable effects. Now we use getkbmouse on frame. OK. To get the key it's simple. But how to fix the result? Yes it's an easy code (when you know it), but more simple if we have an on kbmouse edit box which code is executed everytime a key is pressed (this also can save fps, i think).

So instead of (i took my mouse press detection):
ONFRAME:
*code locating mouse position*
in=cx&cy; //check if both coordinates are in range
mb=getkbmouse(3); //check if mouse is pressed
pip=in&mb; //check if mouse pressed in range
p=(p+pip)*pip; //is like when you press the button, it's keeps adding up, but when you release it becomes 0
reg10=if(equal(p,1),bnot(reg10),reg10); //if there is press, makes reg10, if 0 then 1, if 1 then 0 (bnot), if there is no press, then it remains what it was. you can't just use pip instead of p because it remains 1 all the time if there is press so it keeps bnot'ing.

We can use:
ONKBMOUSE:
*code locating mouse position*
in=cx&cy;
mb=getkbmouse(3);
pip=in&mb;
reg10=if(pip,bnot(reg10),reg10); //we removed p because this ONKBMOUSE executes only when key is pressed, when there is keydown or smth. it doesn't execute while key is pressed, it executes when it is pressed.

So we save 1 variable, and code doesn't execute every frame doing nothing (when key not pressed).
Neoavs is offline   Reply With Quote
Old 4th March 2004, 19:57   #2
Shock Value
Senior Member
 
Shock Value's Avatar
 
Join Date: Aug 2002
Location: USA
Posts: 158
As far as saving variables goes, the limit was removed in the latest version of AVS so don't worry about that. And executed code in the frame box really shouldn't slow AVS down noticably unless you are using very large loops. I should know--one of my presets has about 200 lines of code in the frame box (although I'll admit that not all lines are executed each frame, but the majority are). When I removed the code, I saw no increase in speed at all, at most it was .1 or .2 frames per second (and the framerate was about 100fps, so small changes should have been noticable).
Shock Value is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Visualizations > AVS > AVS Wishlist

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump