Chart Object now can be added to MMF HWA applications

The Chart Object I wrote for Multimedia Fusion 2 would not allow itself to be added to hardware accelerated (HWA) applications. At the time the object was released, this was a separate runtime. It was disallowed as it didn’t appear to work properly with it – nothing would be displayed (except for the pie chart mode, which writes to an internal buffer first).

Today I started work to make the Chart Object HWA compatible (although not actually take advantage of the HWA). The first thing I did was remove the tests which stopped it being added to HWA applications. I tried it, and it seemed to ‘just work’ so long as the ‘Display Mode’ setting in the application properties is not ‘Direct3D 8’ or ‘Direct3D 9’ (both of which may cause crashes).

Well, I thought this would probably do for now. I’d be interested to know if there are any people who are strongly bothered by the inability to use it with Direct3D. Perhaps if it is an actual problems I will convert it to use off-screen buffers, but I’d prefer not to.

Download the version of Chart Object without the HWA checks

Edit: A quote I found from my notes from Fimbul which – probably fairly – describes the situation:

[T]he graph object. It’s great, but it’ll probably never see HWA, java, etc. It has an excellent function that allows you to get the coordinates for the points, so if you want, you can plot a graph yourself, but you can’t use that in the other runtimes (and I think it glitches even in HWA if you try to use it there). This is another example of something that is already using a form of coding, but that instead of being “click-friendly”, it’s mostly “click-impossible”.

Alas, it was created before alternative run-times, but released at about the same time as them.

Work on Multimedia Fusion extensions

A few of my extensions have known problems with it. I don’t particularly enjoy working on these projects; actually, I pretty much hate it. I have much better things I could be doing. However,  I will try to make the changes when I can.

The known problems are:

Chart Object
  • No support for HWA, which means it doesn’t work in the latest version of MMF
  • No support for Unicode titles, etc.
Ini++
  • Crash to do with encryption
String Replacer
  • Suspected crash turned out to be due to a different object
Spell check Object
  • Lack of support for additional characters (such as accented characters)
String Replacer
  • Lack of support for additional characters (such as accented characters)

None of these will be much fun at all to work on, or particularly rewarding, so don’t expect progress to be quick. However, hopefully it will happen someday.

Chart Object Released

So, at last, I’ve released the Chart Object, along with the latest version of Ini++ v1.5. I have written many posts about the progress of the Chart Object, so it is great to finally get it released. I’m sure there will be an initial set of bugs, but hopefully there won’t be anything too major.

The Ini++ v1.5 object has a large number of bug fixes from the original release, and works much better. It is worth noting that the compression algorithm is different that before, so if you use compression it cannot open old Ini files.

The latest bug fix in Ini++ v1.5 is to do with the loading of subgroups, which didn’t work very well previously. Essentially, this is a feature which changes the loading and saving routines to take tabs into account. Groups which are indenting are considered ‘subgroups’. So for instance,

[Group]
a = 1
	[Subgroup]
	a = 2

has the group ‘Group’ and which has the subgroup ‘Subgroup’. The object does not support subgroups in memory, so it is faked by renaming groups to their path. It is hence loading in memory as:

[Group]
a = 1
[Group/Subgroup]
a = 2

This feature was always present, but it was previously fairly buggy.

Chart Object Near Release

The Chart Object has been updated again. Only a small number of changes this time:

  1. The ‘Export as image file’ and ‘Copy to clipboard’ actions now take a parameter so you can select the background colour. Of course if you export to a PNG file, black represents transparency.
  2. The vertical text is never rendered using anti-alias.
  3. The ‘Anti-alias’ option now decides if the labels are rendered with anti-aliasing or not. If you export to a PNG with transparency, you should probably turn this off!

Hopefully later tonight I will be able to create a release candidate. Then, providing everything goes well there can be a public beta release.

Speaking of which, I want to know if the Ini++ v1.5 beta release can be upgraded to an official release. Any feedback would be helpful – message me on the CT forums, even if it is just to say “I used it and it worked”. Thanks.

Chart Object and Ini++ v1.5

The Chart Object and Ini++ v1.5 have both been completed! Yay! Both are currently released to Clickteam’s testers, although I don’t think anybody is actually testing them at the moment. This means that either it will be released with bugs, or that its release will be delayed for a while, which is a real shame as I’ve put in effort recently getting this done when I’d really have prefered not to.

It often takes just one or two people to pop-up and try and use the object in a project of their own for it to be well-tested though. Or perhaps I should release it on here as a beta? I’m not sure yet and will have to talk to Clickteam. There are people paying me so I should respect their wishes too.

As for after this, I have other projects. For one thing, I want to pick up OpenTH again. I also have another MMF-related project (not quite an extension but something along those lines). I do have this ultimate idea of a card-game object though. More useful would probably be a set of custom GUI controls in a game-ish style, but these things are horrible to write if you want them to work with all languages, which I suppose I’d have to. Ideas are welcome.

Chart Object Documentation Written

I’ve finished writing the documentation for the Chart Object. I’m releasing it now so that people can see what it features, and also so that any mistakes can be pointed out.

The link to it is here. It is an MHT file (MIME HTML) which is an HTML file with the resources included. Opera and IE can view these files but Firefox can’t without an extension.

The released extension will have it just as an ordinary HTML file, however MHT is a bit more convent for now. One interesting thing about writing this is I decided to write it in Microsoft Word. The latest version of Microsoft Word is actually, for the first time, good at what it does.

Also, there are the following bug fixes: When total of values is zero, there is no longer a crash in pie-chart mode. Also, when there is only one slice to display, it is now rendered correctly.

Chart Object Progress

There has been more progress with the chart object. The changes are:
New feature: Automatic precision detection and new selectors for it in the property pane

Change: Ticks at end of series axis
Bug fix: x-Axis title no longer cut off by two pixels
New ACE: “Is position near graph point condition”
New ACE: “Get current data set number” expression.
New ACE: “Get nearest point to” expression
Change: Hide ‘axis’ in pie mode
New feature: Auto-tick for X axis
New feature: Now using muParser
Bug fix: Scaling fixing
Bug fix: Scaling works now for pictograms again
Bug fix: Display errors fixed with regards to overrunning
Bug fix: No surface on pictogram mode no longer crashes

So the things left to do are:

  • Write the documentation (which I am doing now)
  • Update Ini++ to reflect changes
  • Ask Yves why it isn’t working in HWA mode
  • One or two small things to do with hiding of properties.

It’s about time for Chris Branch to have a play with to make sure he thinks it is OK, and also for the people funding it to have a play with it. And then we have to decide about how it is released. It seems to be ‘the thing’ now to give it up KlikDisk before it actually goes public. It’s up to the people paying for it though…

New Parser Added to Chart Object

muParser is now implemented into the Chart object. This means that the ‘generate graph from equation’ action is much quicker and also is a lot more flexible. For instance, it now has ‘sin’, ‘cos’, ‘tan’, ‘asin’ (inverse sine), ‘log’, ‘abs’, ‘sign’, ‘log2’, ‘sqrt’, and so on. You can also have boolean operators in the expressions. For instance, “(x<0)*2 + (x>1)”, where comparisons give 1 if true and 0 if false.

Here is a picture of the graph defined by an equation:

Current Chart Object Progress

I’m still working on the Chart object. As I now have a full time job, work is slower, but I am still getting some things done.

Currently a few problems have been reported with the ‘generate points from equation’ action. Due to that I am currently changing the internal mathematics parser. It previously used a system that a friend wrote for me, however some bugs had been found in it – it didn’t parse some expressions properly. Instead, I am moving to the open source muParser. This also has the advantage of ‘pre-compiling’ the expressions (with references to variables) so that it can be evaluated multiple times quickly. This should make it a lot quicker!

I think I am away this weekend and so I won’t be able to implement this too soon. I started last night though, and got the code back to a compiling (although incorrect) state. After that I’ll need to go back to the auto-detection routines and fix them =)

Chart Object (VIII)

I’m quite happy with the improvements from when I last posted. Note that ACE stands for Action, Condition or Expression

  1. New feature: The ability to set a title
  2. New feature: The ability to give titles to the axes
  3. New feature: ‘Line of best fit’ line drawing mode.
  4. Bug fix: Padding problem on vertical axis.
  5. Bug fix: Now axis titles swap around properly on horizontal mode.
  6. Bug fix: Now pie-charts and radar-charts may have titles.
  7. Bug fix: Charts now work even when ‘Show individual values’ isn’t selected. (You may wonder how that bug even come to exist! In fact a variable was incremented at the wrong level in nested for and if loops. Stupid me.)
  8. Bug fix: Vertical axis now has transparent background, but it still doesn’t work very well on non-white surfaces.
  9. Bug fix: Clipping now works! The new text drawing functions can be slower than the older ones. There are tests to make sure that processor time isn’t wasted but due to how some of the labelling works it does do more work than strictly necessary in some cases if the margins are changed.
  10. Bug fixes: Clipping issues to do with graphs lines and markers have been resolved.
  11. New feature: Now if the tick spacing, axis scale labels spacing or grid spacing is too small (less than 3 pixels for the former and latter and less than the size of the largest item for the scale labels) it will be automatically enlarged. This means that if the scale automatically changes the graph will still be somewhat presentable.
  12. New feature: You can now decide if you wish markers to be able to go over the axes or not.
  13. New feature: Now ticks with numbers on are larger than those without (unless none have numbers).
  14. Bug fix: To do with switching between cts and discrete mode.
  15. Bug fix: Grid lines are not drawn on the minimum points anymore.
  16. Change: Lots of property changes, including some items being disabled when not in use.
  17. New feature: You can now set the padding on individual values separately. This was mainly to make the user interface simpler.
  18. Bug fix: Bar charts use proper margins for drawing the bars. This means it works when the minimum is negative.
  19. Bug fix: Very large tick marks work again, although I’m not sure what I did to make this work.
  20. Change: Line of Best Fit uses the viewing position instead of internal position for discrete graphs.
  21. Bug fix: ‘Line’, ‘Square tooth line’ and ‘Smooth line’ now displays according to viewing position, making it work is discrete mode.
  22. Bug fix: Now you can actually add elements to the end in discrete mode.
  23. Bug fix: Scatter chart items are displayed property now.
  24. Change: The order of the property groups has now changed.
  25. Bug fix: For a pie chart, it no longer will draw things in black, secretly changing it to colour 8 (‘opaque black’). This means that if you make a black shape it won’t suddenly become see-through.
  26. New feature: Border thickness, colour.
  27. New ACE: Actions have been added to change title texts, their colours and also to hide them.
  28. Bug fix: ‘Transparent’ option available again.
  29. Bug fix: ‘DisplayRunObject’ now updates the fonts before it is called. This probably fixes a few undiscovered issues to do with values changing that affect fonts during runtime.
  30. New ACE: Get and set the margins via actions and expression.
  31. New ACE: Set the axis thickness and colour via expressions.
  32. New ACE: Set the gridline thickness, colour and intervals for both axes (with automatic hiding when not relevant)
  33. New ACE: Set the tick sizes.
  34. New ACE: A set to change the line type, colour and thickness.
  35. New ACE: A set to change marker type, radius & thickness and colour.
  36. Change: Now ‘outline thickness/colour’ is relabelled ‘line thickness/colour’ in XY mode and put into the right folder.
  37. New ACE: Get rotation.
  38. Bug fix: Some problems with previously added ACEs fixed.
  39. New ACE: Set width/height.
  40. New ACE: Actions to set everything to do with the labels (series, value and individual).
  41. Bug fix: It used to crash if it was too small. Now it does not. This also fixes a problem with setting the margins too large.
  42. New Feature: The title text can now have shadow. You can also configure how much padding there is under the title. There are also new actions to set these values.
  43. Bug fix: The title used to be too low. Now it isn’t.
  44. Change: Menus sorted out. They should make more sense now but there is stuff further to go.
  45. Bug fix: Line of Best Fit mode was rounding the points to the nearest integer. Now fixed.
  46. Bug fix: Long standing issue which meant there was too much padding at the bottom is now fixed.
  47. Bug fix: The ChartGeometryXY constructor has been more-or-less rewritten. It now gets the spacing a lot better. It still doesn’t allocate space properly when you have graphs that span positive and negative though.
  48. Bug fix: Properly allocates space for all types of graphs now. Hopefully.
  49. Change: More intelligent positioning of series labels.
  50. New feature: Now if the axis meets at a place where both are zero, the zero will only be displayed once in a position which makes sense.
  51. New feature: Now menus which only have one item on them (even if that item is another pop-up menu) is copied into the previous menu. This means that the menu structure now looks organised in all modes.
  52. Bug fix: Labels are no longer displayed for pie-chart entries which are zero (or negative)
  53. Bug fix: Due to a bug in the menu hiding code the latest few menu entries were not hidden.
  54. New ACE: Now the auto-range modes can be set by actions.
  55. Change: Menus restructured a bit.
  56. Bug fix: It no longer assumes the text of the highest value is larger than that of the lowest value.
  57. Bug fix: Very negative graphs are now rendered better.
  58. Change: There is now a check-box in the ‘About’ tab that allows you to disable the menu ‘auto-hide’.
  59. Bug fix: Null check before it is attempted to draw the series labels.
  60. New feature: A new hidden ‘Set Chart Type’ feature. It is not shown in any mode, so you need to uncheck the box in the about pane to enable it.
  61. Bug fix: Gridlines are now drawn first and bugs in them have been corrected.
  62. Bug fix: Memory leak and a possible freeing of null pointer fixed.
  63. New ACE: New expressions to convert pixels to coordinates in axis-based graphs.
  64. New ACE: The ability to check if the cursor is within the graph area, and also to check if it is on a particular (or general) bar.
  65. Bug fix: Chart title rendered at correct height again.
  66. Ini++: Integration of Chart and Ini++ has been done.
  67. Bug fix: Grids were displayed in the incorrect place due to rounding problem.
  68. New feature: There can now be multiple data sets. 9 are allowed, numbered 0 to 8.
  69. New ACE: New features to change the data sets.
  70. Ini++: Updated to save all data set settings.
  71. New ACE: ‘Generate from equation’.
  72. Bug fix: Auto-hiding of conditions, and improvements in other auto-hiding
  73. Bug fix: ‘Generate equation’ silently fails now if it does. It can fail for individual instances (e.g. divide by zero) or for the whole thing (syntax error).
  74. New ACE: Get title, series axis title, value axis title.
  75. Change: Auto range now have padding
  76. Bug fix: Empty title used to cause the graph not to be displayed.
  77. Bug fix: Generate equation now draws the final point properly.
  78. Change: Auto-range uses the values from all data sets.
  79. New feature: New features to automatically set the tick and grid intervals
  80. Bug fix: Some rendering changes
  81. Change: New properties layout. Also tick-boxes for if you want grids-lines.
  82. Change: Labels make more effort to stay in the display area for bar charts.
  83. New ACE: New actions to turn on and off the gridlines.
  84. Change: Interface improved.
  85. Bug fix: Values off-the-scale on radar chart are now clamped into the range.
  86. Bug fix: Pictograms work again.