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

301
Proposals / Re: LGM themes (Warning: Images)
« on: September 18, 2010, 09:46:32 PM »
The GTK+ theme was horrible.
Clearlooks is great.  What's wrong with you.

302
Proposals / Re: LGM themes
« on: September 18, 2010, 10:17:58 AM »
why can't ORACLE just use regular WinAPI/Qt calls like everyone else

303
Proposals / Re: Add a place for extra returns.
« on: September 16, 2010, 05:32:20 PM »
Alternatively, use 0x's initaliser lists for var args and return vectors.

template<typename type> std::vector<type> some_function(std::vector<type> args);
some_function({1,2,3,...});

Speaking of which, ENIGMA's var should support operator= with initialiser lists.

304
Proposals / Re: Add a place for extra returns.
« on: September 15, 2010, 08:26:29 PM »
You do realise that STL supports pairs?

I think that it might eventually support variable-length pairs with the new 0x additions.

305
Off-Topic / Re: Slow compile times for C++?
« on: September 12, 2010, 07:19:23 PM »
PHP is interpreted, though.  lol

306
Off-Topic / Re: Slow compile times for C++?
« on: September 12, 2010, 05:30:20 PM »
The language would be ten times better if they dumped most of the old, unneeded parts of the C spec.
I agree entirely.  And on top of that, the old functions should be coded to work with the newer spec, for example, string and iostream.

307
Off-Topic / Re: Slow compile times for C++?
« on: September 12, 2010, 10:36:42 AM »
We should all use XML to code games.  It has a faster compile time... because you don't have to compile!  How cool is that!

308
Function Peer Review / Re: Trimming
« on: September 11, 2010, 09:31:46 AM »
isspace() returns true if a character is a space, \t, \r, or \n.

And it can work with other linebreaks if you convert it first.

309
Function Peer Review / Re: Trimming
« on: September 10, 2010, 05:47:26 PM »
Leading sounds better.  Fixed.

310
Function Peer Review / Trimming
« on: September 09, 2010, 03:35:56 PM »
I was bored, and I had these lying around.  Dunno if anyone would use them for a game, but hey, whatever.

Code: [Select]
string string_trim_leading(string str)
  {
  for (size_t i=0;i<str.length();i++)
    {
    if ((str[i]=='\n' || i==0) && isspace(str[i+1]) && str[i+1]!='\n')
      {
      str.erase(str.begin()+(--i)+2);
      }
    }

  return str;
  }


string string_trim_trailing(string str)
  {
  for (size_t i=0;i<str.length();i++)
    {
    if ((str[i]=='\n' || i==str.length()-1) && isspace(str[i-1]) && str[i-1]!='\n')
      {
      str.erase(str.begin()+(--i));
      }
    }

  return str;
  }


inline string string_trim_lines(string str) { return string_trim_leading(string_trim_trailing(str)); }


string string_trim_begin(string str)
  {
  if (str.length()>0)
    {
    while (isspace(str[0]))
      {
      str.erase(str.begin());
      if (str.length()==0)
        {
        break;
        }
      }
    }

  return str;
  }


string string_trim_end(string str)
  {
  if (str.length()>0)
    {
    while (isspace(str[str.length()-1]))
      {
      str.erase(str.length()-1,1);
      if (str.length()==0)
        {
        break;
        }
      }
    }

  return str;
  }


inline string string_trim_both(string str) { return string_trim_begin(string_trim_end(str)); }


string string_trim_chars(string str, string chars)
  {
  for (size_t i=0;i<str.length();i++)
    {
    for (size_t j=0;j<chars.length();j++)
      {
      if (str[i]==chars[j])
        {
        if (i>0)
          {
          while (isspace(str[i-1]))
            {
            str.erase(str.begin()+(--i));
            }
          }

        if (i<str.length()-1)
          {
          while (isspace(str[i+1]))
            {
            str.erase(str.begin()+i+1);
            }
          }
        }
      }
    }

  return str;
  }

inline bool string_empty(string str) { return string_trim_both(str)==""; }


string string_trim_leading(string str) - Trims whitespace at the beginning of lines
string string_trim_trailing(string str) - Trims whitespace at the end of lines
string string_trim_lines(string str) - Trims whitespace around lines
string string_trim_begin(string str) - Trims whitespace at the beginning of a string
string string_trim_end(string str) - Trims whitespace at the end of a string
string string_trim_both(string str) - Trims whitespace on both sides of a string
string string_trim_chars(string str, string chars) - Trims whitespace around certain characters
bool string_empty(string str) - Returns true if a string consists only of whitespace

311
Issues Help Desk / Re: Needed ENIGMA functions
« on: September 07, 2010, 06:47:31 AM »
instance_place requires the collision system to be working.

And it shows lines and line position for me.

312
Proposals / Re: GM Function Implementations
« on: August 29, 2010, 08:36:37 PM »
I prefer:
inline double sine(double x) { return sin(x); }

over:
#define sine sin

It prevents variables from breaking.

313
Announcements / Re: Mini Progress Feed
« on: August 28, 2010, 10:25:44 PM »
It was, for whatever reason, my internet flopping.  It's back to 512 k/s upload, now.

For the packages, it's just me running a script that will pull the latest SVN revision, build packages, start dropbox (if it's not already started), create a package list file, and upload the files to my dropbox account.

If anyone's even attempted to install my packages up to this point, I'd suggest that right now, you uninstall it, delete the ENIGMA icon from the applications menu, and download the latest version of it (a list of the current packages can be found here).


Also, for the record, I am still getting the undefined object_locals error that I've been getting from the beginning. :V

That being:
Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h: In function ‘void enigma::constructor(enigma::object_basic*)’:
Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:50:17: error: ‘struct enigma::object_locals’ has no member named ‘alarm’
In file included from SHELLmain.cpp:121:0:
Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:69:15: error: ‘struct enigma::object_locals’ has no member named ‘image_single’
Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:70:15: error: ‘struct enigma::object_locals’ has no member named ‘image_speed’

314
Off-Topic / Would you rather...
« on: August 27, 2010, 10:47:27 PM »
???

315
Proposals / Re: Optimize it
« on: August 27, 2010, 02:26:38 PM »
Josh:
#if SYSTEM != WINDOWS
  #include <endian.h>
#else
  #define __BYTE_ORDER LITTLE_ENDIAN
#endif