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.
#1
Off-Topic / Brilliant.
April 14, 2012, 02:00:34 AM #2
Announcements / New GitHub Repository
January 06, 2012, 10:45:49 PM
I've just set up a repository on GitHub for ENIGMA. You can find it here: https://github.com/enigma-dev/enigma-dev
If you're running a Linux-based distro, you can install the git package, then run the following command to create a local copy:
(note: git checkout is not like svn checkout; git clone is svn checkout)
For those of you that want something like TortoiseSVN, TortoiseGit is also available. If you don't know how Git works, I'd suggest learning it (it's not the same as SVN) or asking someone how to use it.
From GitHub, you can fork the repository (and then push changes in your fork back to us), submit bugs (either there or on flyspray here), and watch for changes. You can also view a list of files and commits with much more ease. If you want to download a copy of the repo at any time, GitHub also supports this: https://github.com/enigma-dev/enigma-dev/downloads
One of the largest differences between Git and SVN is Git's naming of commits; instead of using incremented numbers, it uses hashes. Commits can be named using tags (git tag <name> <commit>), and you can switch to a specific tag or branch with (git checkout <tag/branch>). Git also makes a single .git directory in the root instead of SVN's recursive .svn nonsense.
Note that the SVN repo is still up, but I'm not entirely sure of how things are going to work with either. This is a very large change, however, is really for the better.
If you're running a Linux-based distro, you can install the git package, then run the following command to create a local copy:
Code Select
git clone git://github.com/enigma-dev/enigma-dev.git(note: git checkout is not like svn checkout; git clone is svn checkout)
For those of you that want something like TortoiseSVN, TortoiseGit is also available. If you don't know how Git works, I'd suggest learning it (it's not the same as SVN) or asking someone how to use it.
From GitHub, you can fork the repository (and then push changes in your fork back to us), submit bugs (either there or on flyspray here), and watch for changes. You can also view a list of files and commits with much more ease. If you want to download a copy of the repo at any time, GitHub also supports this: https://github.com/enigma-dev/enigma-dev/downloads
One of the largest differences between Git and SVN is Git's naming of commits; instead of using incremented numbers, it uses hashes. Commits can be named using tags (git tag <name> <commit>), and you can switch to a specific tag or branch with (git checkout <tag/branch>). Git also makes a single .git directory in the root instead of SVN's recursive .svn nonsense.
Note that the SVN repo is still up, but I'm not entirely sure of how things are going to work with either. This is a very large change, however, is really for the better.
#4
Proposals / Laziness Buffer
October 15, 2011, 09:20:27 PM
typedef signed char byte;
typedef unsigned char ubyte;
typedef signed char schar;
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef long long llong;
typedef unsigned long long ullong;
typedef unsigned char ubyte;
typedef signed char schar;
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef long long llong;
typedef unsigned long long ullong;
#5
General ENIGMA / MIME Localisation
August 19, 2011, 07:58:31 PM
Simply because I don't trust Google at all:
For the file type associations under both Linux and Windows, I need translations for "Game Maker Project" and "ENIGMA Game Project." I don't think that GM localises at all (correct me if I'm wrong), so, "Game Maker" should be left as that regardless of language. I also need a translation for "Game Maker (Unknown Version)".
If you feel like helping out with localisation, help give me a localisation in whatever languages that you know. I know French, but that's about all that I've got.
In addition to the words, if you'd mind listing the number formatting as well (for example, "Game Maker 8.1" is "Game Maker 8,1" in French), that would help a bit.
For the file type associations under both Linux and Windows, I need translations for "Game Maker Project" and "ENIGMA Game Project." I don't think that GM localises at all (correct me if I'm wrong), so, "Game Maker" should be left as that regardless of language. I also need a translation for "Game Maker (Unknown Version)".
If you feel like helping out with localisation, help give me a localisation in whatever languages that you know. I know French, but that's about all that I've got.
In addition to the words, if you'd mind listing the number formatting as well (for example, "Game Maker 8.1" is "Game Maker 8,1" in French), that would help a bit.
#7
Proposals / Fix Wiki Namespaces
August 17, 2011, 08:24:09 PM
None of you know how to wiki.
Someone should read this and fix the pages.
Nested namespaces don't work.
Someone should read this and fix the pages.
Nested namespaces don't work.
#8
Proposals / Remove GLU dependency
July 31, 2011, 06:07:35 PM
Currently, the only two functions from it that are used are gluLookAt and gluPerspective. I also see a line with gluBuild2DMipmaps that is commented out, but it's really not necessary.
Both of these functions can be replicated with basic GL calls. Currently, they are only used in GSd3d.h and GSd3d.cpp.
Both of these functions can be replicated with basic GL calls. Currently, they are only used in GSd3d.h and GSd3d.cpp.
#9
General ENIGMA / Dependency List
July 31, 2011, 05:58:55 PM
Because so many people ask for it.
Dependencies for Ubuntu:
libgl1-mesa-dev
libglu1-mesa-dev
libx11-dev
libz-dev
libopenal-dev
libgtk2.0-dev
gcc
g++
make
java-common
Dependencies for Arch Linux:
libgl
libx11
mesa
zlib
openal
gcc
make
java-runtime>=6
gtk2
Dependencies for Ubuntu:
libgl1-mesa-dev
libglu1-mesa-dev
libx11-dev
libz-dev
libopenal-dev
libgtk2.0-dev
gcc
g++
make
java-common
Dependencies for Arch Linux:
libgl
libx11
mesa
zlib
openal
gcc
make
java-runtime>=6
gtk2
#10
Off-Topic / Linux Poll
May 27, 2011, 02:22:52 AM
Curious, is all. I'm going to do this primarily to see what packages that I need to make, even though I'm going to be making Ubuntu, Arch, and Fedora packages.
#12
Proposals / ENIGMA Project Icons
April 23, 2011, 01:32:08 AM
Might make sense to have some kind of icon for both GM projects and ENIGMA projects (not made yet), so that they can be used for file associations.
I've mentioned this a million times before, but whatever. Does anyone have enough artistic ability to work on this? We really only need two icons.
I've mentioned this a million times before, but whatever. Does anyone have enough artistic ability to work on this? We really only need two icons.
#15
Function Peer Review / Fede-lasse's functions
March 12, 2011, 03:59:21 PM
Because he didn't post them in their own topic, and I can't move topics:
Note that these functions have already been committed (in working forms), but I'll post them anyways:
Code Select
//bool place_snapped(double hsnap,double vsnap)
bool place_snapped(double hsnap,double vsnap) {
return (bool)(X == X%hsnap) && (Y == Y%vsnap);
}
//int move_random(double hsnap,double vsnap)
int move_random(double hsnap,double vsnap) {
X = floor(random(room_width)/hsnap)*hsnap;
Y = floor(random(room_height)/vsnap)*vsnap;
return (int)0;
}
//int move_snap(double hsnap,double vsnap)
int move_snap(double hsnap,double vsnap) {
X = floor(X/hsnap)*hsnap;
Y = floor(Y/vsnap)*vsnap;
return (int)0;
}
//int move_wrap(double hor,double vert,double margin)
int move_wrap(double hor,double vert,double margin) {
//not sure whether two IFs are faster than one big calculation in a single IF
if (hor) {
if (X < -margin || X > room_width+margin) {
X = -(X-room_width);
}
}
if (vert) {
if (Y < -margin || Y > room_height+margin) {
Y = -(Y-room_height);
}
}
return (int)0;
}
//int move_towards_point(double x,double y,double sp)
int move_towards_point(double x,double y,double sp) {
DIRECTION = point_direction(X,Y,x,y);
SPEED = sp;
return (int)0;
}Note that these functions have already been committed (in working forms), but I'll post them anyways:
Code Select
//double distance_to_point(double x,double y)
double distance_to_point(double x,double y) {
return (double)point_distance(median(BBOX_LEFT,x,BBOX_RIGHT),median(BBOX_TOP,y,BBOX_BOTTOM),x,y);
}
//double distance_to_object(int obj)
double distance_to_object(int obj) {
double _edgeX,_edgeY;
_edgeX = median(BBOX_LEFT,obj.X,BBOX_RIGHT);
_edgeY = median(BBOX_TOP,obj.Y,BBOX_BOTTOM);
if (_edgeX > obj.BBOX_LEFT && _edgeX < obj.BBOX_RIGHT && _edgeY > obj.BBOX_TOP && _edgeY < obj.BBOX_BOTTOM) {
return (double)0;
}
return (double)point_distance(_edgeX,_edgeY,median(obj.BBOX_LEFT,X,obj.BBOX_RIGHT),median(obj.BBOX_TOP,Y,obj.BBOX_BOTTOM));
}
#16
Proposals / Obliterating "inst" from functions.
February 28, 2011, 01:48:49 AM
Instead of defining:
or something similar in every instance-related function, there should be a pointer defined somewhere globally (or a macro if you insist) so that people don't have to define this everywhere, so that code is cleaner, and so that we can inline more stuff and make things generally faster.
Good idea/bad idea?
enigma::inst_iter_planar seems a lot nicer.
Code Select
enigma::object_planar* const inst = ((enigma::object_planar*)enigma::instance_event_iterator->inst);or something similar in every instance-related function, there should be a pointer defined somewhere globally (or a macro if you insist) so that people don't have to define this everywhere, so that code is cleaner, and so that we can inline more stuff and make things generally faster.
Good idea/bad idea?
enigma::inst_iter_planar seems a lot nicer.
#17
Proposals / Avatar Size
February 19, 2011, 06:08:48 PM
I see no reason why it shouldn't be at least 96x96, or maybe even 128x128. For external avatars, at least. The tables can handle it. :V
#18
Proposals / Static object variables
January 26, 2011, 10:15:26 PM
This is something that I think would be particularly useful. Opinions? Not sure if they'd use the member ( . ) operator or scope resolution ( :: ) like C++. Probably could be an option.
For those that are unfamiliar, static variables are variables that are accessed by a class, or object type, rather than a specific instance.
For those that are unfamiliar, static variables are variables that are accessed by a class, or object type, rather than a specific instance.
#19
do-until doesn't work, and GM doesn't have do-while. It's essentially do-!while, but we need it to work with GM.
#20
Function Peer Review / collision_point
January 23, 2011, 02:00:14 AMCode Select
int collision_point(double x, double y, int obj, bool prec /*ignored*/, bool notme)
{
const enigma::object_collisions* r = collide_inst_point(obj,false,notme,x,y); //false is for solid_only, not prec
return r == NULL ? noone : r->id;
}It's Ism's fault that this wasn't added.
#21
Issues Help Desk / Combining members
January 15, 2011, 09:46:52 PMCode 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
#22
Proposals / Object member functons
January 07, 2011, 12:50:50 AM
It would be really cool if, somehow, ENIGMA would be able to do something like:
instead of:
Basically, calling a function as a member function would merely mean applying it as a with() statement with only one line. And there might be optimisations for it, too, for example:
would be parsed to:
Granted, you could abuse this and do things like obj.draw_set_color(), but it's still a nicer syntax (and you can do that in with(), too). Obviously, with() would have to be used for ifs and loops, but for simple functions, writing it out this way just looks nicer.
I dunno how doable that this would be, but I think that it would be a really nice thing to have.
Code Select
obj.instance_destroy();instead of:
Code Select
with(obj)
{
instance_destroy();
}Basically, calling a function as a member function would merely mean applying it as a with() statement with only one line. And there might be optimisations for it, too, for example:
Code Select
obj.f1();
obj.f2();would be parsed to:
Code Select
with (obj)
{
f1();
f2();
}Granted, you could abuse this and do things like obj.draw_set_color(), but it's still a nicer syntax (and you can do that in with(), too). Obviously, with() would have to be used for ifs and loops, but for simple functions, writing it out this way just looks nicer.
I dunno how doable that this would be, but I think that it would be a really nice thing to have.
#23
Function Peer Review / move_contact functions optimised for bbox
December 31, 2010, 05:09:58 AMCode Select
int move_contact(double direction, double max_distance, bool solid_only)
{
enigma::object_collisions* const inst1 = ((enigma::object_collisions*)enigma::instance_event_iterator->inst);
double max_x = lengthdir_x(direction, max_distance);
double max_y = lengthdir_y(direction, max_distance);
for (enigma::inst_iter *it = enigma::fetch_inst_iter_by_int(all); it != NULL; it = it->next)
{
const enigma::object_collisions* inst2 = (enigma::object_collisions*)it->inst;
if (inst2->id == inst1->id || solid_only && !inst2->solid) continue;
if (max_x > 0)
{
const double x1 = inst1->x + max_x, x2 = inst2->x + inst2->bbox_left;
if (x2 < x1)
{
max_x = x2 - inst1->x;
}
}
else if (max_x < 0)
{
const double x1 = inst1->x + max_x, x2 = inst2->x + inst2->bbox_right;
if (x2 > x1)
{
max_x = x2 - inst1->x;
}
}
if (max_y > 0)
{
const double y1 = inst1->y + max_y, y2 = inst2->y + inst2->bbox_top;
if (y2 < y1)
{
max_y = y2 - inst1->y;
}
}
else if (max_y < 0)
{
const double y1 = inst1->y + max_y, y2 = inst2->y + inst2->bbox_bottom;
if (y2 > y1)
{
max_y = y2 - inst1->y;
}
}
}
inst1->x += max_x;
inst1->y += max_y;
return 0;
}
inline int move_contact_solid(double direction, double speed) { return move_contact(direction, speed, true); }
inline int move_contact_all(double direction, double speed) { return move_contact(direction, speed, false); }Haven't tested it yet, but this should work. Also am going under the assumption that objects don't collide when they share an edge.
#24
Function Peer Review / distance_to_object
December 21, 2010, 02:02:53 AMCode Select
#include <limits>
double distance_to_object_point(int object)
{
enigma::object_collisions* const inst1 = ((enigma::object_collisions*)enigma::instance_event_iterator->inst);
double distance = std::numeric_limits<double>::infinity();
double tempdist;
for (enigma::inst_iter *it = enigma::fetch_inst_iter_by_int(object); it != NULL; it = it->next)
{
const enigma::object_collisions* inst2 = (enigma::object_collisions*)it->inst;
if (inst1 == inst2) continue;
tempdist = point_distance(inst1->x, inst1->y, inst2->x, inst2->y);
if (tempdist < distance)
{
distance = tempdist;
}
}
return (distance == std::numeric_limits<double>::infinity() ? 0 : distance);
}
inline double dist_ranges(double left1, double right1, double left2, double right2)
{
double right = min(right1, right2), left = max(left1, left2);
return (left > right ? left - right : 0);
}
double distance_to_object_bbox(int object)
{
enigma::object_collisions* const inst1 = ((enigma::object_collisions*)enigma::instance_event_iterator->inst);
const double left1 = inst1->x + inst1->bbox_left, top1 = inst1->y + inst1->bbox_top,
right1 = inst1->x + inst1->bbox_right, bottom1 = inst1->y + inst1->bbox_bottom;
double distance = std::numeric_limits<double>::infinity();
double tempdist;
for (enigma::inst_iter *it = enigma::fetch_inst_iter_by_int(object); it != NULL; it = it->next)
{
const enigma::object_collisions* inst2 = (enigma::object_collisions*)it->inst;
if (inst1 == inst2) continue;
const double left2 = inst2->x + inst1->bbox_left, top2 = inst2->y + inst1->bbox_top,
right2 = inst2->x + inst1->bbox_right, bottom2 = inst2->y + inst1->bbox_bottom;
tempdist = hypot(dist_ranges(left1, right1, left2, right2),
dist_ranges(top1, bottom1, top2, bottom2));
if (tempdist < distance)
{
distance = tempdist;
}
}
return (distance == std::numeric_limits<double>::infinity() ? 0 : distance);
}Tested and both work. I don't know which method that GM uses, but here's two different algorithms.
#25
Function Peer Review / clamp()
December 13, 2010, 09:15:09 PMCode Select
double clamp(double x, double lower, double upper) { return (x < lower ? lower : (x > upper ? upper : x)); }Simple function that would be useful.
