Currently the strings must be manually told to adopt from the library functions
by using String("string").function(). This is temporary and later it should be
possible to apply functions directly to strings.
CharAt gives the a single character string at the index specified. The first
character is at index zero. Characters beyon the end are empty strings, and
errors return NULL. This can be used thusly:
str = "something";
letter = String(str).CharAt(7); # letter = "n"
letter = String(str).CharAt(12); # letter = ""
letter = String(str).CharAt("foo"); # letter = NULL
Previously, refresh, each sprite would refresh its old area, then its new area.
This, combined with situations where there are many sprites caused the area to
be redrawn many times, each time redrawing each overlapping sprite data.
Now we add all areas which need to be refreshed to a region and this makes a
smaller set of rectangles to refresh, and these are not overlapping.
Also uses the freeze display updates, which should work better now.
If the width and X position of the two rectangles is the same, we can merge
them together. The new set of exact overlaps detects this and determines the
direction the rectangle should be extended.
The region code now uses this. WARNING, when expanding rectangles, these have
to be merged with the other rectangles down the list as there may be overlap.
The previous version had a flaw where it would find the rectangles overlapping
if they spanned a range in one axis. Despite them having no overlap in the
other axis.
Because this version has strange (although correct) behaviour when dealing with
empty rectangles, region only calls the overlap function when both rectangles
are not-empty.
The issue is if an empty rectangle sits on the edge of a full rectangle, the
function reports (possibly correctly) that the edge is overlapped by the empty
rectangle. The region code then nudges the rectangle down one space and
subtracts one from the empty rectangle height. This creates a rectangle with
negative height (bad thing).
If the other version can be fixed I will put it back, but this one is also
useful for the combining two rectangles of equal width.
Now that we cannot rely on the next_node element. We must finish processing the
entry before removing it. Easiest way is to recurse and remove after return.
Also one redundant line. I think this code was never used in anger. There is a
major bug in the rectangle collision code which makes this detection ad-hoc.
If we fetch the next node while working on the current node, recursing down the
list may remove the next node. Just to be double sure, we recurse direct to
next node so the current is not damaged.
The x and y values, in area element, were used to determine the position of the
window on the screen. With the x and y not at 0, the full redraw not working
correctly on the second head.
Enables scripts to display test by converting it into an image. This can then
be shown using a sprite. Function takes a string and the value of the three
colors (red green blue).
new_image = Image.Text("text we want", 1.0, 0.0, 0.0); // gives red text image
The script image is now a pixel buffer. This allows some clever possibilities:
We can now implement text to image.
We can compose images by drawing on them, and record the areas which changed to
avoid refreshing the whole thing.
When the logo opacity was plugin wide, one view would change its logo, and the
others would not bother. This prevented the logo form showing up on the second
screen.
The fd element was only used within the load function so did not need to be in
the structure. Also removes the open and close file functions. Their contents
is inlined.
This is the last cleanup before merging with pixel-buffer.
This reverts commit 79baa323e6.
It wasn't really the right way to fix the original problem.
Now we end up in a case where timeouts can still run after
stop_watching_for_timeout is called on them. This can cause
crashes.
We need to instead fix the problem in a different way.
When the text or the position is changed, label will call draw events on areas
which were previously drawn on.
The two-step plugin is updated with the new method.
Small bug which would try to access the animation frame beyond the end of the
array. Only occurs when doing a redraw after the animation has completed
(e.g. password dialog).
These are small optimisation to: terminate interpolation early when operating
on fully transparent regions and do rotations by pre-computing the step size
rather than calling cos/sin/atan. These use around 30% fewer instructions on
general images.