Quote from: Josh @ Dreamland on July 24, 2014, 02:53:59 AMThen in place of [snip=edl]caller->image_index[/snip], you use [snip=edl]caller->image_single == -1? caller->image_index : caller->image_single[/snip].
What you describe is how I think GM actually implements it. The problem with this, if I'm not misreading your code, is that it requires us to check image_single every time we want to access image_index. Lots of seemingly-unrelated areas of code (like the collision system, I think?) use image_index directly. Maybe we could get away with turning just image_index into its own class, with an int() operator that checks image_single.... but that's not quite right either. Remember, you can do the following:
Code Select
//In Create()
self.image_index = 0;
self.image_speed = 0.5;
//Some time later.
self.image_single = 4;
self.image_index = 2; //This affects the "underlying" value, NOT image_single.
//Some time later.
self.image_single = -1;
//At this point image_index should be 2.I guess we could solve that with operator=, but see my next point.
Quote from: Darkstar2 on July 24, 2014, 03:40:52 AMAnything that slows down or has potential of slowing down ENIGMA for users who do not need those or don't use those functions is counter productive IMO. I canceled one of my past pull requests by concern of it slowing down. Don't assume people won't notice, perhaps things become more noticeable when your game is very complex and requires every bit of juice squeezed out. These type of functions that are not really used much should not be forced but made optional through the use of extension IMO.
I'm inclined to agree. As excited as I am to have figured out a decent solution to image_single, the fact remains that it's a deprecated and confusing feature, and no-one uses it. I'd much prefer to switch it "off" by default ---one of my Pull Requests adds a "compat" setting for GM5 (for timeline_running); maybe we can use the same setting to selectively enable image_single?
Again, if you guys really want this merged I'll prepare a cleaner patch, but I'm uneasy about this particular feature and I'd much prefer to keep it in some kind of extension.
