Search found 339 matches

by lazi
Fri Nov 18, 2011 11:00 am
Forum: General programming
Topic: iif evaluates both conditions?
Replies: 2
Views: 2075

Re: iif evaluates both conditions?

Hehe, that's correct. :oops:

"The person who doesn't read, has no advantage over those who can't read!"

To be honest since I use the great Cubic-IDE add-on I visiting less the also great guide. However it is a mistake that this topic clearly proves.
by lazi
Fri Nov 18, 2011 10:26 am
Forum: General programming
Topic: iif evaluates both conditions?
Replies: 2
Views: 2075

iif evaluates both conditions?

Hi! Just figured out that iif can't be used to avoid division by zero errors. a = iif ( b=0, 0, 5/b) ; fails when b is zero It's a shame that all of the results are evaluating apart from the result of the condition. I think it is a Lua "feature", but tested similar method on php and behaves just lik...
by lazi
Sat Nov 05, 2011 11:34 pm
Forum: General programming
Topic: Sutherland - Hodgeman polygon clip
Replies: 0
Views: 1834

Sutherland - Hodgeman polygon clip

;########################################################### ;# # ;# Sutherland-Hodgeman polygon clipping algorithm # ;# 1.0 # ;# Ported to Hollywood by Lazi from wikipedia article: # ;# # ;########################################################### Const #_INSIDE = 0; // 0000 Const #_LEFT = 1; // ...
by lazi
Sun Oct 30, 2011 11:21 am
Forum: General programming
Topic: How to rotate a sprite?
Replies: 2
Views: 1951

Re: How to rotate a sprite?

There is not a function equivalent to RotateBrush for sprites?
Keep in mind that sprite IS NOT brush!

You can rotate brush and then convert it to sprite. CreateSprite(id, #BRUSH,....)
by lazi
Sun Oct 30, 2011 10:21 am
Forum: General programming
Topic: Line clipping with Cohen-Sutherland algorithm
Replies: 0
Views: 1787

Line clipping with Cohen-Sutherland algorithm

Hi! Just created a set of functions for line clipping. Have fun with it. ;########################################################### ;# # ;# Cohen-Sutherland line clipping algorithm # ;# 1.0 # ;# Ported to Hollywood by Lazi from wikipedia article: # ;# http://en.wikipedia.org/wiki/Cohen%E2%80%93Sut...
by lazi
Tue Aug 16, 2011 12:20 am
Forum: General programming
Topic: floating point numbers
Replies: 4
Views: 2793

Re: floating point numbers

The only advantage could be the ability to read files that stores single precision numbers. But forget it, implemented as a function: :D ;########################################## ;# # ;# CONVERTS FLOATING POINT NUMBERS # ;# # ;# doubleprecision=sp2dp(singleprecision) # ;# # ;######################...
by lazi
Sun Aug 14, 2011 10:00 pm
Forum: General programming
Topic: floating point numbers
Replies: 4
Views: 2793

Re: floating point numbers

May I ask it for a new feature?

I'd like to use dr2d drawings directly and that format uses such numbers. There is an old dr2d to hpgl converter on Aminet which I wrote (dr_hpgl), and like to port to hollywood. A little tweak on hpgl and we get complex 2d drawings in the form that Polygon() needs.
by lazi
Sun Aug 14, 2011 9:22 am
Forum: General programming
Topic: floating point numbers
Replies: 4
Views: 2793

floating point numbers

Hi!

There is Peek() and ReadFloat() which all requires double precision floating point numbers which takes 64 bit in memory.
Is there a way to handle simple precision 32 bit fp numbers in Hollywood?

Bye!
by lazi
Wed Aug 03, 2011 7:37 pm
Forum: General programming
Topic: How do i know how many frames animation has?
Replies: 2
Views: 1874

Re: How do i know how many frames animation has?

You can get animation frames count as follows from version 4.5:

n = GetAttribute ( #ANIM, id, #ATTRNUMFRAMES)