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.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 »
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.
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.
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.
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.
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
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.
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.
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’
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’
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
#if SYSTEM != WINDOWS
#include <endian.h>
#else
#define __BYTE_ORDER LITTLE_ENDIAN
#endif