Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RetroX

166
Issues Help Desk / Re: Combining members
« on: January 18, 2011, 09:52:23 AM »
what

167
Issues Help Desk / Re: Combining members
« on: January 15, 2011, 08:20:29 PM »
Yeah, the point of combining them was to force both classes to use the same value.  Anyways, thanks for the help.

168
Proposals / Re: Shader effects
« on: January 15, 2011, 04:48:37 PM »
All of it is true.

All of it.

169
Issues Help Desk / Combining members
« on: January 15, 2011, 04:46:52 PM »
Code: [Select]
struct foo { int x; };
struct bar { int x; };
struct foobar : public foo, public bar {};
results in a class with the members foo::x and bar::x.  However, foobar::x does not exist.  Is there any way to do this?

Example:
Code: [Select]
foobar val;
val.x = 5;
results in:
Code: [Select]
error: request for member ‘x’ is ambiguous
error: candidates are: int bar::x
error:                 int foo::x

170
Off-Topic / Re: Broken forums
« on: January 12, 2011, 02:22:07 PM »
Good job, a2h.

171
Function Peer Review / Re: move_towards_point
« on: January 12, 2011, 08:24:59 AM »
Nope. :P

172
Function Peer Review / Re: move_towards_point
« on: January 11, 2011, 04:49:46 PM »
oh, well, ignore what I posted, then

173
Function Peer Review / Re: move_towards_point
« on: January 11, 2011, 04:14:14 PM »
Yeah, it is.  Updated:
Code: [Select]
void motion_set(double newdir, double newspd) {
  enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);
  inst->direction.rval.d = newdir;
  inst->speed.rval.d = newspd;
  inst->hspeed.rval.d = newspd * cos(degtorad(newdir));
  inst->vspeed.rval.d = newspd * sin(degtorad(newdir));
}

inline void move_towards_point(double x, double y, double spd) {
  motion_set(point_direction(
    ((enigma::object_planar*)enigma::instance_event_iterator->inst)->x,
    ((enigma::object_planar*)enigma::instance_event_iterator->inst)->y,
    x,y),spd);
}

void motion_add(double newdir, double newspd) {
  enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);
  inst->hspeed.rval.d += newspd * cos(degtorad(newdir));
  inst->vspeed.rval.d += newspd * sin(degtorad(newdir));
  inst->direction.rval.d = point_direction(0, 0, inst->hspeed.rval.d, inst->vspeed.rval.d);
  inst->speed.rval.d = abs(hypot(inst->hspeed.rval.d, inst->vspeed.rval.d));
}

Suggestion: point_direction_radians

174
Function Peer Review / Re: move_towards_point
« on: January 09, 2011, 06:22:56 PM »
I think also did this one (move_towards_point). Is anyone actually reading this?
In GML, not C++.

175
Function Peer Review / Re: move_towards_point
« on: January 08, 2011, 05:34:03 PM »
move_towards_point should be inline, at least. :V

176
Proposals / Re: Object member functons
« on: January 08, 2011, 05:33:38 PM »
That was actually what he mentioned doing, I believe.

177
Proposals / Re: Object member functons
« on: January 08, 2011, 12:51:20 PM »
Polygone, I wasn't suggesting any solution.  I was mentioning what would actually happen.

I think that, like obj.x, obj.func() should only operate on one instance.

178
Function Peer Review / Re: move_towards_point
« on: January 07, 2011, 10:11:30 PM »
Also, random thing to mention, but:
Code: (C) [Select]
void motion_set(double newdir, double newspd) {
  enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);
  inst->direction.rval.d = newdir;
  inst->speed.rval.d = newspd;
  inst->hspeed.rval.d = newspd * cos(newdir);
  inst->vspeed.rval.d = newspd * sin(newdir);
}

inline void move_towards_point(double x, double y, double spd) {
  motion_set(point_direction(
    ((enigma::object_planar*)enigma::instance_event_iterator->inst)->x,
    ((enigma::object_planar*)enigma::instance_event_iterator->inst)->y,
    x,y),spd);
}

void motion_add(double newdir, double newspd) {
  enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);
  inst->hspeed.rval.d += newspd * cos(newdir);
  inst->vspeed.rval.d += newspd * sin(newdir);
  inst->direction.rval.d = point_direction(0, 0, inst->hspeed.rval.d, inst->vspeed.rval.d);
  inst->speed.rval.d = abs(hypot(inst->hspeed.rval.d, inst->vspeed.rval.d));
}

179
Proposals / Re: Object member functons
« on: January 07, 2011, 08:55:20 PM »
Suppose f1 and f2 return 0, and obj2.array[0,0] = 0.

The statement would be equivalent to the following:
obj1.a = 0;

As you can see, I'm totally lost, which is why someone needs to explain this one to me.
f1() is performed for all objects, f2() is performed for objects, and set to a for all objects.  It would be expansion hell, and really, in the end, the last one executed would actually be stored.  That's why it's a bad idea to make one variable operate on multiple objects.

180
Proposals / Re: Object member functons
« on: January 07, 2011, 08:54:16 PM »
It would be expansion hell.

Now, that makes sense, I guess.

with() will do what it will, I suppose.