[QUOTE=Jallen;20057955]My editor for the game I'm making is coming along nicely.
*image*
I made all of the icons on the buttons lol. It's programmer art but I don't think it's too bad (the open icon is a bit crappy)
[/QUOTE]
I've just noticed this, in almost every program I can imagine the icon for 'Save' is always a floppy disc. Why are we still using outdated technology for our icons? People in future generations won't have ever seen a floppy disc!
[QUOTE=Mattz333;20058168]I've just noticed this, in almost every program I can imagine the icon for 'Save' is always a floppy disc. Why are we still using outdated technology for our icons? People in future generations won't have ever seen a floppy disc![/QUOTE]
Am I understanding this right, you are against iconic symbol of entire computer generation?
I don't know why they started making 3" floppies as icon, but original icons were 5" ones, which are really what you call floppy.
[QUOTE=Mattz333;20058168]I've just noticed this, in almost every program I can imagine the icon for 'Save' is always a floppy disc. Why are we still using outdated technology for our icons? People in future generations won't have ever seen a floppy disc![/QUOTE]
Because all our programmer culture is derived from old stuff and it's great, we should keep it!
e.g., Bugs are from when computers were huge and bugs getting stuck in them would break them.
[QUOTE=Eleventeen;20058203]Because all our programmer culture is derived from old stuff and it's great, we should keep it!
e.g., Bugs are from when computers were huge and bugs getting stuck in them would break them.[/QUOTE]
Actually the term dates back before the discovery of a moth between terminals which is said to be the beginning of the term 'bug'
In fact it was used to describe radar problems in WW2 and to describe any fault in electronics.
The fact that that moth started the term is a myth really, though I'd sure it helped it along in popularity.
[QUOTE=Jallen;20058265]Actually the term dates back before the discovery of a moth between terminals which is said to be the beginning of the term 'bug'
In fact it was used to describe radar problems in WW2 and to describe any fault in electronics.
The fact that that moth started the term is a myth really, though I'd sure it helped it along in popularity.[/QUOTE]
Well, I was wrong. Still, everything has a history.
[QUOTE=Mattz333;20058168]I've just noticed this, in almost every program I can imagine the icon for 'Save' is always a floppy disc. Why are we still using outdated technology for our icons? People in future generations won't have ever seen a floppy disc![/QUOTE]
[IMG]http://i50.tinypic.com/3500zft.png[/IMG]
:buddy:
Just replace the save image with a guy pushing a lady out of the way of a speeding train...
[QUOTE=Jallen;20057955]The GUI on the right uses SFML and the 3D viewport uses irrlicht.[/QUOTE]
Why not use something like Qt or wxWidgets to render the GUI?
[QUOTE=Squad;20059448]Just replace the save image with a guy pushing a lady out of the way of a speeding train...[/QUOTE]
pic or stfu.
[QUOTE=Z_guy;20059749]Why not use something like Qt or wxWidgets to render the GUI?[/QUOTE]
Why use something bloated like wxWidgets for something simple like this?
[QUOTE=Xera;20059846]Why use something bloated like wxWidgets for something simple like this?[/QUOTE]
Or better still, use gwen :D
[QUOTE=honeybuns;20060225]Or better still, use gwen :D[/QUOTE]
little bit of brown on your nose there.
Been working on some A* pathfinding in C#. :buddy:
[img]http://imgkk.com/i/uOqzTC.png[/img]
[QUOTE=majorlazer;20060750]little bit of brown on your nose there.[/QUOTE]
From what I have seen GWEN looks like one of the best darn gui libaries I have seen. Just because it's made by garry doesn't mean anything.
Started SFML, I love this libary.
[img]http://filesmelt.com/dl/screenie15.png[/img]
Yeh, all I did was load up an image and make a sprite but it feels awesome!
[QUOTE=turby;20048265]As I said in a previous post, a is stored on the stack, however it seems to be more complex than that in C++ (as nullsquared said)[/QUOTE]
I meant, I can't see where it's pushed upon the stack or into a register.
[QUOTE=iPope;20061894]From what I have seen GWEN looks like one of the best darn gui libaries I have seen. Just because it's made by garry doesn't mean anything.
Started SFML, I love this libary.
Yeh, all I did was load up an image and make a sprite but it feels awesome![/QUOTE]
I'm right there with you. Tried it out las week and am loving it. Here's the first decent thing I've made with it, it's a simple mechanics simulator (still very much a WIP):
The red ball is the body, the lines are forces. White is weight, yellow is normal reaction and blue is the force caused by the user. The X and Y values are the resulting force overall.
[IMG]http://grlira.com/images/b/simple_mechanics1.png[/IMG]
And here, with App->Clear commented out, to get the trajectory of a body given a starting velocity of 10m/s in the X axis
[IMG]http://grlira.com/images/b/simple_mechanics2.png[/IMG]
Spot the error.
[code] public int Compare(Point a, Point b)
{
if (P[a].F > P[b].F) return 1;
if (P[b].F < P[b].F) return -1;
return 0;
}[/code]
It took me an hour of frustrating debugging to find that, because I don't have the source of my priority queue. :doh:
[QUOTE=noctune9;20062553]Spot the error.[/QUOTE]
I think we've all done that error at least once and wasted far too long on it. :D
I think I need help with this c++ class model that I am using.
I have code similar to this:
[cpp]
enum TokenType {
TOKEN_NUMBER,
TOKEN_FUNCTION,
TOKEN_STRING,
TOKEN_OTHER
}
class Token {
public:
TokenType type;
}
class StringToken: public Token {
public:
std::string stringValue;
}
class NumberToken: public Token {
public:
int numberValue;
}
[/cpp]
And then a [i]std::list<Token*> list[/i]. Any Token with a type of TOKEN_NUMBER is a NumberToken type and anything else is a StringToken.
When I iterate over the list I need to perform something on the stringValue or numberValue
The way I see it, I have two options:
[list]
[*]Cast the Token* to a NumberToken*/StringToken* depending on whether type is a TOKEN_NUMBER or not.
But I've read that casting down is very bad or somesuch.
[*]Some kind of virtual functions
This might have worked but a value() function would need to return a string for StringToken and int for NumberToken
[/list]
Is there anything else I can try? I'm open to suggestions
[QUOTE=noctune9;20062553]Spot the error.
[code] public int Compare(Point a, Point b)
{
if (P[a].F > P[b].F) return 1;
if (P[b].F < P[b].F) return -1;
return 0;
}[/code]
It took me an hour of frustrating debugging to find that, because I don't have the source of my priority queue. :doh:[/QUOTE]
That's why I love R#. It spots those kind of errors automatically.
[QUOTE=majorlazer;20060750]little bit of brown on your nose there.[/QUOTE]
go back to your script kiddie game hacking forums son
[QUOTE=Vampired;20063705]I think I need help with this c++ class model that I am using.
I have code similar to this:
[cpp]
enum TokenType {
TOKEN_NUMBER,
TOKEN_FUNCTION,
TOKEN_STRING,
TOKEN_OTHER
}
class Token {
public:
TokenType type;
}
class StringToken: public Token {
public:
std::string stringValue;
}
class NumberToken: public Token {
public:
int numberValue;
}
[/cpp]
And then a [i]std::list<Token*> list[/i]. Any Token with a type of TOKEN_NUMBER is a NumberToken type and anything else is a StringToken.
When I iterate over the list I need to perform something on the stringValue or numberValue
The way I see it, I have two options:
[list]
[*]Cast the Token* to a NumberToken*/StringToken* depending on whether type is a TOKEN_NUMBER or not.
But I've read that casting down is very bad or somesuch.
[*]Some kind of virtual functions
This might have worked but a value() function would need to return a string for StringToken and int for NumberToken
[/list]
Is there anything else I can try? I'm open to suggestions[/QUOTE]
The answer is templates. I can't help you on that though, haven't used it myself. But I'm sure that plenty of people here are able to help you.
I don't think templates are the answer.
I remember reading that you can cast the pointer and if it is 0 then the cast failed and it isn't that type.
You probably want to do this:
[code]A = new Token();
if (StringToken* B = dynamic_cast<StringToken>(A))
{
std::cout << B->stringValue;
}
if (NumberToken* B = dynamic_cast<NumberToken>(A))
{
std::cout << B->numberValue;
}[/code]
[QUOTE=noctune9;20060884]Been working on some A* pathfinding in C#. :buddy:
[img]http://imgkk.com/i/uOqzTC.png[/img][/QUOTE]
How did you create the grid in the form?
[QUOTE=Vampired;20063705]-snip-
Is there anything else I can try? I'm open to suggestions[/QUOTE]
Unions can take you a long way in this situation:
[cpp]
enum TokenType {
TOKEN_NUMBER,
TOKEN_INTEGER,
TOKEN_STRING,
//etc
};
class Token {
//for more safety, make these fields private and add getters
public:
TokenType type;
union
{
std::string string;
int integer;
double number;
//etc
};
Token(std::string str) : type(TOKEN_STRING), string(str){}
explicit Token(int i) : type(TOKEN_INTEGER), integer(i){}
explicit Token(double num) : type(TOKEN_NUMBER), number(num){}
//etc
};
#include <iostream>
int main()
{
Token tok1("Hello, world!");
Token tok2(123);
Token tok3(1.5);
//token type guaranteed to match data
//...
}
[/cpp]
edit:
Templating works too, anyway, it's just not as pretty to implement and use.
[QUOTE=SupahVee;20064498]How did you created the grid in the form?[/QUOTE]
I just register to the paint event and draw from there, like this:
[code] private void panel1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen pen = new Pen(Color.Black);
for (int x = 0; x < panel1.Width; x += 30)
{
g.DrawLine(pen, new Point(x, 0), new Point(x, height));
}
for (int y = 0; y < panel1.Height; y += 30)
{
g.DrawLine(pen, new Point(0, y), new Point(width, y));
}
}[/code]
I also call refresh() every time I add a block.
[QUOTE=Vampired;20063705]I think I need help with this c++ class model that I am using.
I have code similar to this:
enum TokenType {
TOKEN_NUMBER,
TOKEN_FUNCTION,
TOKEN_STRING,
TOKEN_OTHER
}
class Token {
public:
TokenType type;
}
class StringToken: public Token {
public:
std::string stringValue;
}
class NumberToken: public Token {
public:
int numberValue;
}
And then a [I]std::list<Token*> list[/I]. Any Token with a type of TOKEN_NUMBER is a NumberToken type and anything else is a StringToken.
When I iterate over the list I need to perform something on the stringValue or numberValue
The way I see it, I have two options:
[LIST]
[*]Cast the Token* to a NumberToken*/StringToken* depending on whether type is a TOKEN_NUMBER or not.
But I've read that casting down is very bad or somesuch.
[*]Some kind of virtual functions
This might have worked but a value() function would need to return a string for StringToken and int for NumberToken
[/LIST]
Is there anything else I can try? I'm open to suggestions[/QUOTE]
Like this?
[cpp]
template<class type>
inline SomeFunction(Token* token, type value)
{
switch(token->type)
{
case TOKEN_NUMBER:
//do specific NumberToken stuff here
NumberToken* tkn;
tkn = static_cast<NumberToken*>(token);
tkn->numberValue = value;
break;
case TOKEN_STRING:
//do specific StringToken stuff here
StringToken* tkn;
tkn = static_cast<StringToken*>(token);
tkn->stringValue = value;
break;
}
}
[/cpp]
Silly mistake fixed.
Nevermind, [B][URL="http://www.facepunch.com/member.php?u=61889"][B]jA_cOp[/B][/URL][/B]'s post seems better.
[QUOTE=Mattz333;20058168]I've just noticed this, in almost every program I can imagine the icon for 'Save' is always a floppy disc. Why are we still using outdated technology for our icons? People in future generations won't have ever seen a floppy disc![/QUOTE]
Funny you brought that up, because during this past week, I realized that for the first time too. I was in Notepad++ and it suddenly dawned upon me: Hey! The save icon is a floppy!
I've seen them my whole life as the "save" icon, but never actually realized that it was a floppy, because I never thought about it.
Sorry, you need to Log In to post a reply to this thread.