• What are you working on? V5
    2,005 replies, posted
[QUOTE=nos217;18548059]Yes, I'm aware of that, but for the end user, it's unlikely that they will try anything else. And it's for my own learning and for looking back on if I forgot how to use vectors.[/QUOTE] Take the advice then move on. Also changed my project into a dedicated language rather than a fake os. I call it SeeF. Examples: [code] 0 out Hello, World! [/code] [code] 0 var a 1 var b 2 var c 3 in a A: 4 in b B: 5 add a b c 6 out you added #a and #b to make #c 7 goto 3 [/code] Function like things: [code] 0 goto ; function one 1 var a 2 var b 3 var c 4 goto 12 ; function two 5 in a A: 6 in b B: 7 add a b c 8 goto 13 ; function three 9 out in; #a , #b added to make #c 10 goto 12 ; main ; init vars 11 goto 1 ; loop 12 goto 5 13 goto 9 [/code] Yeh so they aren't really functions as they dont return to the last index but yeh, you get the idea. You could actually code a last index if I make goto accept vars and added some other stuff.
[QUOTE=nos217;18546848]while(cin >> value) [/QUOTE] What the hell does that evaluate to as a boolean? I do not like this while condition.
I think it then uses the [url=http://www.cplusplus.com/reference/iostream/ios/operator_voidpt/]operator void* of std::istream[/url], but I'm not 100% sure on that.
[QUOTE=ZeekyHBomb;18548963]I think it then uses the [url=http://www.cplusplus.com/reference/iostream/ios/operator_voidpt/]operator void* of std::istream[/url], but I'm not 100% sure on that.[/QUOTE] Indeed, either way it's a bit ambiguous and I don't like it, I wouldn't use it because I'd want my code to be more understandable by others. Use it if you like though. Also why the hell was I rated dumb in that post? It was a perfectly valid comment.
I didn't realise I would get so much negative response :S. I took the advice by the way, and I already knew that typing anything would give the same result as end. According to Accelerated C++: "The while loop executes so long as the condition [b]cin >> x[/b] succeeds." In my opinion, it's a clever way to exploit the fact that entering text when an integer is expected ends the loop. Don't know why you were rated dumb by the way.
[QUOTE=Jallen;18543640]About the ambient occlusion mapping, what exactly should a map look like and what effect would it have? Does it only effect the object with the shader applied to it? Or can you apply it to the whole scene to render AO on everything including between 2 objects?[/QUOTE] It's just an artistic "darkening" map that is multiplied with the ambient light. So instead of an object having a flat [0.5, 0.5, 0.5] ambient colour, it has precomputed AO on it. If this map is just all white, then nothing changes. It's per-object, can't be used for the whole scene. (Well, it can, but that would assume that all of your objects are positioned exactly as they were when you generated the AO map, and that you won't move or rotate them.)
I think it would also fail if you input some number larger than std::numeric_limits<int>::max() or lower than std::numeric_limits<int>::min().
[QUOTE=databee;18544841]I bet your teachers hate you so much :v:[/QUOTE] I'm pretty sure he does. But it's not my fault AP Comp Sci in high school is severely lacking in ... well, actually teaching anything. Plus, he's my math teacher. And I'm That Guy that screws around the whole class, never does any of the homework, and then gets the highest score of the class on every test, usually even higher than 100% due to a bonus that's meant to help students with lower scores :v:
Ok, thanks. The main point in this program is actually for learning vectors, but at least I know not to use this in proper circumstances. [editline]08:46PM[/editline] [QUOTE=nullsquared;18549420]I'm pretty sure he does. But it's not my fault AP Comp Sci in high school is severely lacking in ... well, actually teaching anything. Plus, he's my math teacher. And I'm That Guy that screws around the whole class, never does any of the homework, and then gets the highest score of the class on every test, usually even higher than 100% due to a bonus that's meant to help students with lower scores :v:[/QUOTE] No offence, but there's someone in my class like this and he has no friends :v:.
[QUOTE=nos217;18549546] No offence, but there's someone in my class like this and he has no friends :v:.[/QUOTE] Sucks for him :v:
[QUOTE=Jallen;18548801]What the hell does that evaluate to as a boolean? I do not like this while condition.[/QUOTE] Let's see, it's of the sort istream& istream::operator >>() so it returns the reference to itself. I can't be sure since there is no documentation, but I'll bet that a lot of isteam implementations have overloaded the bool typecast to something sane so nos's code works. [code] istream::opterator bool() const {return good();} [/code]
Yeah you're right, because he has been driven to depression :v:. [editline]09:14PM[/editline] [QUOTE=Cathbadh;18550138]Let's see, it's of the sort istream& istream::operator >>() so it returns the reference to itself. I can't be sure since there is no documentation, but I'll bet that a lot of isteam implementations have overloaded the bool typecast to something sane so nos's code works. [code] istream::opterator bool() const {return good();} [/code][/QUOTE] Thanks for actually bothering to check that out :). I presume a well respected book such as Accelerated C++ isn't wrong.
[QUOTE=Cathbadh;18550138]Let's see, it's of the sort istream& istream::operator >>() so it returns the reference to itself. I can't be sure since there is no documentation, but I'll bet that a lot of isteam implementations have overloaded the bool typecast to something sane so nos's code works. [code] istream::opterator bool() const {return good();} [/code][/QUOTE] Well, Google didn't came up with it when searching for std::istream operator bool so I think it uses the operator void* and casts that into a boolean. edit: I also couldn't find an operator bool defined for std::istream (or std::ios_base or std::ios), but an operator void* for std::ios_base (note std::istream inherits from std::ios, which inherits from std::ios_base), so at least when you're compiling with Microsofts Visual C++ compiler that's what's going on behind the curtains.
[QUOTE=nullsquared;18549420]I'm pretty sure he does. But it's not my fault AP Comp Sci in high school is severely lacking in ... well, actually teaching anything. Plus, he's my math teacher. And I'm That Guy that screws around the whole class, never does any of the homework, and then gets the highest score of the class on every test, usually even higher than 100% due to a bonus that's meant to help students with lower scores :v:[/QUOTE] When I had Java in school everyone feared the tests and started learning a week before and about 40% of the students got a 5s (worst mark you can get) and I never had under 90% (often over 100% too) without learning anything. It was weird.
[QUOTE=Cathbadh;18550138]I can't be sure since there is no documentation, but I'll bet that a lot of isteam implementations have overloaded the bool typecast to something sane so nos's code works.[/QUOTE] Nope. Consider this code: [cpp]int n = 3; cin << n; // convert cin to bool, promote to int & shiftleft cout >> n; // convert cout to bool, promote to int & shiftright[/cpp]
[QUOTE=nullsquared;18549420]I'm pretty sure he does. But it's not my fault AP Comp Sci in high school is severely lacking in ... well, actually teaching anything. Plus, he's my math teacher. And I'm That Guy that screws around the whole class, never does any of the homework, and then gets the highest score of the class on every test, usually even higher than 100% due to a bonus that's meant to help students with lower scores :v:[/QUOTE] I'm the one who gets bored, sits in a vegetated state for 3/4 of the class then goes home and learns things completely unrelated to (and 1000x more interesting than) school more quickly than they could teach it, then gets relatively average grades. The education system is excellent for knowledge sponges and extremely poorly suited to independant learners :frown: But I'm in university now so it's much better.
[QUOTE=Robber;18550348]When I had Java in school everyone feared the tests and started learning a week before and about 40% of the students got a 5s (worst mark you can get) and I never had under 90% (often over 100% too) without learning anything. It was weird.[/QUOTE] I was talking about my math class (he's my teacher for APCS [i]and[/i] math), but I definitely know what you're talking about. The problem is that those students are completely new to programming, so us not-new guys don't get to do anything interesting because the teacher needs to have everyone keep up.
[QUOTE=nullsquared;18549907]Sucks for him :v:[/QUOTE] It is going to get so hard for me to get used to your BYOB Dude avatar :(
[QUOTE=Jallen;18550530] The education system is excellent for knowledge sponges and extremely poorly suited to independant learners :frown: But I'm in university now so it's much better.[/QUOTE] Yes.
[QUOTE=r4nk_;18526147]Ah nice, I didn't realise. So it's a completely new engine that (sometimes) loads the old games data?[/QUOTE] I know it's a bit late, but OpenGTA2 is actually not entirely correct name. The engine itself is called OpenGBH, it's a custom top-down engine, it uses custom file formats and is in no way related to GTA2. But OpenGTA2 is set of tools and project to recreate GTA2 using this engine (which I'm writing from scratch). This is merely done to avoid any licensing issues. The engine itself doesn't use any formats or anything by Rockstar. The OpenGTA2 project simply provides some tools you can use to convert original files. All things aside - it's a GTA2 remake. Not reimplementation - but a remake. It means that physics might differ slightly, and it differs a lot in engine itself, but it follows same style and atmosphere. And you can convert GTA1 files to this too :) In the end it will be a playable, multiplayer, top-down game, which looks and feels like GTA2. [b]Edit:[/b] Got ya a video: [media]http://www.youtube.com/watch?v=BPFvoNTsX3E[/media]
[QUOTE=BlackPhoenix;18550599]Got ya a video: [media]http://www.youtube.com/watch?v=BPFvoNTsX3E[/media][/QUOTE] Where are the 9000+ polygons coming from? I can only see about 2-10(depending on what's actually 3D) [B]Edit:[/B] Are those all the polygons in the world, not just the ones on screen?
[QUOTE=Robber;18551226]Where are the 9000+ polygons coming from? I can only see about 2-10(depending on what's actually 3D)[/QUOTE] They are coming from because I'm drawing ugly FPS indicator. It drives about 1000+ sprites for that. Plus also font rendering - that all adds up polygons to the counter. Without this debugging interface it's more like 100: [media]http://filesmelt.com/downloader/opengta2a.PNG[/media] See that "VBO 128 STE"? It means that level is rendered with 128 polygons with STE tileset. It doesn't cull invisible polygons at this stage, so 128 number can be decreased a lot. Plus pedestrians are extra few polies :)
[QUOTE=noctune9;18550488]Nope. Consider this code: [cpp]int n = 3; cin << n; // convert cin to bool, promote to int & shiftleft cout >> n; // convert cout to bool, promote to int & shiftright[/cpp][/QUOTE] Ok, so what? Does the code not compile or not perform that typecasting? (I can't check for myself atm) (because istream::operator <<() is undefined, as is ostream::operator >>())
[cpp]#include <iostream> class foo { public: foo(void):i(0) {} foo& operator<<(int n) { i += n; return *this; } operator bool(void) { return i > 10; } private: int i; }; class bar { public: bar(void):i(0) {} bar& operator>>(int n) { i += n; return *this; } operator bool(void) { return i > 10; } private: int i; }; int main() { foo var1; bar var2; int i1 = 42, i2 = 21; var1 << i1; var1 >> i1; var2 << i2; var2 >> i2; std::cout << i1 << ';' << i2 << std::flush; return 0; }[/cpp] [code](28): warning C4552: '>>' : operator has no effect; expected operator with side-effect (29): warning C4552: '<<' : operator has no effect; expected operator with side-effect[/code] output: 42,21
@Zeeky: Perhaps implicit conversion only goes 1 level deep? Is casting completely transitive? (your test would suggest not) For example, we can implicitly cast a foo -> bool, and we can implicitly cast a bool -> unsigned int, but we [I]can't[/I] implicitly cast a foo -> unsigned int.
[QUOTE=Cathbadh;18552312]@Zeeky: Perhaps implicit conversion only goes 1 level deep? Is casting completely transitive? (your test would suggest not) For example, we can implicitly cast a foo -> bool, and we can implicitly cast a bool -> unsigned int, but we [I]can't[/I] implicitly cast a foo -> unsigned int.[/QUOTE] There's nothing ambiguous there to prove anything. operator bool() allows the shift operator that is not explicitly declared. Otherwise (I believe) you'd get an ambiguous function call error.
Working on the next version of my build system. Nearly have targets finished, so you can build more than just a binary :D To switch you can just do a simple System.dynamic, or System.static. Once I'm sure that's done, I just need to finish the sqlite3 backend, and *gasp* I may be done with the next version. All it'll need then is an MSVC compiler type, as well as a basic Windows system type :D
[QUOTE=Jallen;18549004]Indeed, either way it's a bit ambiguous and I don't like it, I wouldn't use it because I'd want my code to be more understandable by others. Use it if you like though.[/QUOTE] It's the right way to read from a file, too. [QUOTE=nullsquared;18549420]And I'm That Guy that screws around the whole class, never does any of the homework, and then gets the highest score of the class on every test, usually even higher than 100% due to a bonus that's meant to help students with lower scores :v:[/QUOTE] Don't want to bust your bubble, but that's pretty common in high school. I've never done any homework (that didn't count), it was just a waste of time. Only did work because I had nothing better to do in class =/
[QUOTE=gparent;18558085]It's the right way to read from a file, too. Don't want to bust your bubble, but that's pretty common in high school. I've never done any homework (that didn't count), it was just a waste of time. Only did work because I had nothing better to do in class =/[/QUOTE] I became an underachiever with learning problems because of that :( Edit: To be more on topic, programming is one of the few things that keeps my brain from shutting down :v:
[QUOTE=gparent;18558085]It's the right way to read from a file, too. Don't want to bust your bubble, but that's pretty common in high school. I've never done any homework (that didn't count), it was just a waste of time. Only did work because I had nothing better to do in class =/[/QUOTE] If it was so common then why the hell would the schools not increase the rate of learning? Oh a good percentage of the kids are doing great but not even trying, lets continue at the pace we are going. Also, whether it's the "right" way or not, I wouldn't be caught doing it, I'd rather have more easily understandable code than code which is "correct" as long as it doesn't impair the efficiency.
Sorry, you need to Log In to post a reply to this thread.