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 - Josh @ Dreamland

1486
Announcements / Re: Happenings
« on: January 14, 2011, 10:06:11 AM »
You may not treat custom classes as regular objects, but you can already create them in Definitions using C++ syntax.

1487
Announcements / Re: Happenings
« on: January 13, 2011, 09:34:13 PM »
Two hours for surfaces, probably three hours for switch()... two hours for ds_ functions... I only now got home from school, and I still have more work to do.

1488
Off-Topic / Broken forums
« on: January 12, 2011, 10:50:13 AM »
We've recently upgraded to SMF RC3. This cost us all custom modifications to the SMF forum system. This is what's broken, that we are currently aware:

1) Registration. I implemented a regexp captcha to the SMF engine because its original system was too poor to handle multiple answers. My system allowed them to be set as (answer1|answer2), or however else is legal in the regexp standard. As such, any question with more than one answer is impossible to answer correctly.
2) Unix names. Gary just implemented a system that allows users to give themselves a unix name. It wasn't implemented in the Wiki completely yet, but it's gone now.
3) Code highlighting. The system had a problem with generating previews (the page had to be refreshed to see any modifications), and it didn't distinguish between GML and C++, but it's gone now.

Any other problems, report them here.

1489
I have yet to implement switch(), but there are multiple problems with that code in any case, namely,
1) The point of a switch statement is to allow jumping to a piece of code marked by the correct value. So, "case varname==0" is pointless. Just "case 0" will suffice
2) The point of a switch statement is to quickly decode one value as a set of multiple values. So, "switch(boolean)" is, before optimization, less efficient than if (boolean) {} else {}.


1490
Function Peer Review / Re: move_towards_point
« on: January 11, 2011, 07:16:55 PM »
Actually, I have no idea why the fuck Ism's implementation works. direction.rval.d is in degrees. Or at least it's supposed to be. There is the possibility that it is only in degrees when it is the last variable set.

1491
I don't know why it's doing that if you're specifying the whole screen as the rectangle.

1492
I don't think two branches are unreasonable.

HaRRi, note two things. First, tbx and tby are both 1 for Po2 textures. Second, I believe the most efficient way to code this function is by giving it this structure:

Code: (C) [Select]
if (tbx == 1)
  if (tby == 1)
    //YOUR CURRENT METHOD
  else
    //DRAW LARGE TILED HORIZONTAL STRIPS OF SIZE REQUESTED_WIDTH * SPRITE_HEIGHT
else
  if (tby == 1)
    //DRAW LARGE TILED VERTICAL STRIPS OF SIZE SPRITE_WIDTH * REQUESTED_HEIGHT
  else
    //THE INEFFICIENT METHOD

1493
Proposals / Re: switch and mp_step functions.
« on: January 10, 2011, 07:27:41 PM »
You can just copy-paste it into "Definitions" under ENIGMA settings in the mean time, MrGriggs.

1494
You could just implement the 3D sound functions in ENIGMA's current OpenAL implementation; we'd appreciate it. (ENIGMAsystem/SHELL/Audio_Systems/OpenAL/)

1495
Proposals / Re: Shader effects
« on: January 10, 2011, 07:20:04 PM »
Yes, they will. I asked Retep a while back to research the difference in shader languages for DirectX and OPenGL. He never got back to me with the results. I want to ensure that ENIGMA's shader language is standard, and so I want to know what I'm up against. ENIGMA may implement its own shader language.

1496
General ENIGMA / Re: String Physics
« on: January 10, 2011, 06:39:32 AM »
HaRRi:
I didn't mean to imply that including a GL extensions library was all you had to do. You actually have to declare the function yourself and fetch a pointer to it.

Code: (C) [Select]
void glGenFramebuffersEXT(GLsizei n, GLuint* ids) { show_error("Surfaces not supported by card."); }
void (*glGenFramebuffersEXT)(GLsizei n, GLuint* ids) = &error_function_glsize_gluint;

//...

if (WHATEVER_YOURE_USING_SUPPORTS("GL_FRAMEBUFFER_EXT"))
    glGenFramebuffersEXT = WHATEVER_YOURE_USING_LOAD("GL_FRAMEBUFFER_EXT", "GL_GEN_FRAMEBUFFERS_EXT");

Or something like that.

1497
Proposals / Re: Object member functons
« on: January 09, 2011, 01:12:24 PM »
The stack is pushed twice at the beginning of the expression in my example, then popped twice right after.

pop_with(K) was what I was considering. But it wasn't until you posted it again that I realized I was thinking about it incorrectly. My first instinct was that there'd be no way to instantiate a template because the return type of func() can't be gathered from &func. But now I see that a simple template function would have done it.

Code: (C) [Select]
inline template<typename any> any& pop_with(any &r) { return r; }
So thank you, Luis; the simplicity of the matter escaped me.

1498
Proposals / Re: Object member functons
« on: January 09, 2011, 12:41:29 AM »
That's how with_iter works, luis. Issue is, you just passed func() the return value of enigma::pop_with().

1499
Proposals / Re: Object member functons
« on: January 08, 2011, 11:22:38 AM »
Unfortunately, r9k, it's not that simple. It's not as simple as polygone's suggestion, either.
The only way to implement this cleanly is too flawed to implement:
Code: (GML) [Select]
obj1.func()becomes
Code: (C) [Select]
(enigma::with_iter(obj1), func())When the expression starts, it will be as though it was executed for obj1. When the expression ends, the with_iter will destruct, and the code will be back in its original scope. However, this will fail catastrophically:
Code: (GML) [Select]
obj1.func(obj2.func())Both will be executed for obj2. This is because at the beginning of the expression, obj1 is pushed as the current instance, then obj2 is as well.

I haven't yet found a way around this.

1500
Proposals / Re: switch and mp_step functions.
« on: January 07, 2011, 02:38:48 PM »
Go for it. Feel free to do the A* shit, because I don't really want to. :P