Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by Tjaalie

  1. Tjaalie


    Why not use std::stringstream?
  2. Tjaalie

    Study filmmaking or programming?

    What do you want to do? It is up to you, members at a forum from which you have no idea who they really are should not have anything to say about what kind of study you want to study (weird sentence, I'm sorry but where I live it is drinking time). For what you may known there all drunken 14 year olds who try to screw you over for live. Just think about what you really want, do you want to make movies? Or do you want to make games? Where I live you can always take a minor. There should be a man (or woman) at your school who is specialized at helping you find the study you want to do, I guess you should pay him a visit. Mind my English, if I screw up the rest of your life don't blame me! Tjaalie,
  3. And your still not resetting pos to zero.
  4. What I can see that is wrong: *Where do you set done to true? *You don't reset pos So it keeps writing stuff to the console because you are in a endless loop. So add: if (pos >= myline.length()) { done = true; } In your loop trying to parse the token. Once again don't forget to reset done to false before you enter enter the parsing loop again.
  5. Hello to all, I'm working on a small project on my own and its actually growing pretty large. Now is my question to you all, do you use source control when you are working on something on your own? I used to do it back when I was using windows, but I never used it on Linux. So who what and where are you using to keep track of your sources... I prefered svn when I was on windows, just because it integrates so well with explorer. On the other end, it would be really easy to add a few lines to my makefiles and integrate it to my projects. Someone got something to say on the subject? Maybe recommend something different then svn (keep in mind I'm on linux). Thanks to ya all,
  6. Tjaalie

    Question about meshes in 3ds Max

    Depends, I don't know your format requirements. You could join the mesh but it is most likely that the different meshes all use different textures. Your better of exporting it in a format that supports those 'submeshes' and multiple textures. You could also use maxscript and export to your own format.
  7. You could use Apache. I don't know if you can distribute it on a cd, you have to check that out yourself. You would still need to run it in a browser. But you could always write a app that uses the explorer control to display the web pages and start a local server (trough apache).
  8. Tjaalie


    your welcome. As a side note, for a game so small as a simple pong game you may want to distribute it in a zip archive or something. Since people downloading the are just going to try it, most are just not going to install something if they want to test it once. So to increase your user base you may want to distribute it in a zip archive. And use a installer for bigger games.
  9. Tjaalie


    From a look on your blog I think you are using visual studio. Just switch to release (change the dropdown box in the menu that now states 'debug') and press the build button. The exe is in <project directory>/Release if I remember correctly (haven't used visual studio for quite a while. For a installer just google for 'free installer creator' or something). But I think visual studio comes with a installer just look for it in your start menu, although I'm not totally sure about that. EDIT: I heard some good things about the Nullsoft Installer but since I'm a Linux user I never used it.
  10. Quote:Original post by rip-off Any project that isn't abandoned after a day or two has source control. I have a little machine on my network (P120 with 48Mb RAM, barely squeezed Ubuntu server onto it [grin]) that I use as a SVN server. When programming I like to reinvent the wheel. But that computer must be from before the discovery of the real wheel! lol
  11. Dear Thread reader, Now I finished all my helper classes for my scripting engine I need to make a design decision. With the help of all the helper classes I'm able to create a simple to mildly complex calculator program in just a few lines. It can execute calculations like this '5+3*8/(7+9)' thanks to my friendly tokenizer, parser and solver class. Now that I'm implementing the actual scripting class I'm faced with a design decision. When I parse my script should I first convert it into some kind of asm code and then into actual script byte codes? I think this will make the compiling process slower but makes it easier. This will also allow for a 'asm { code here }' kind of statement (although this would be useless since the use of a scripting engine is just that you can use some higher level language so it would be stupid to implement a feature like that). So what kind of approach do you prefer? I think I will go with intermediate language (I think g++ works in the same way) since the project is purely for a fun learning experience and speed (let alone compile speed) doesn't matter really. Tjaalie, PS: Don't say: "Use <insert, better then my scripting engine will ever be scripting engine's name>, your reinventing the wheel!" because the whole purpose of me writing my own scripting engine is because I want to reinvent the wheel.
  12. Quote:Original post by capn_midnight I absolutely use local source control for personal projects! Far too often I get an idea to make a big change to a project, only to end up breaking it completely. Revision control lets me go back to the good ol' days when my projects actually worked and I wasn't too big for my britches. That is actually a really good reason to use version control. I'm one of those guys that designs on the way, so sometimes when I make some decisions that I later regret I'm able to switch back! I'm so totally convinced right now. I'm going to convert all my projects (witch I'm actually still working on) to git. I'm so convinced that I might actually just use git to keep track of my whole computer (no I'm not going to do that, although I wonder what 'git add /' might do:P).
  13. Quote:Original post by deathkrush Tjaalie, If you are used to TortoiseSVN, then KDE has something very similar: KSvn. It integrates into Konqueror. I'm more of a gnome guy:P but I know of a few scripts that allow you to integrate svn into nautilus. But since I'm trying to convert all my projects to makefiles and text editors (the Linux way) it is just as easy to add a 'commit' target into my makefile so when I want to commit my changes I just do 'make commit'. As I see now git is really easy to use, the only problem I has was that I needed to write a simple program to keep track of the build number. Not that that was a problem (I already wrote such a application when I started developing on Linux). Here is the source if anyone is interested: /* * main.cpp * * Create a simple header with a version varriable. * * copyright (c) 2009 charlie gerhardus */ //includes #include <iostream> #include <fstream> #include <sstream> //entry point int main(int argc, char* args[]) { //vars std::string varname = "c_version"; std::ifstream infile; std::ofstream outfile; unsigned int buildnum = 0; //varname? if (argc > 1) { varname = args[1]; } //has build number file? infile.open(".buildnum"); if (!infile.good()) { std::cout << "warning: no buildnum file found, creating one!\n"; outfile.open(".buildnum"); outfile << buildnum; outfile.close(); } else { infile >> buildnum; buildnum++; outfile.open(".buildnum", std::ios::trunc); outfile << buildnum; outfile.close(); } //write var outfile.open("version.hpp", std::ios::trunc); outfile << "const char " << varname.c_str() << "[] = \"" << buildnum << "\";"; outfile.close(); //done return 0; } It makes a hidden file (or when its there it updates it) in the current working dir, and also writes to a file called 'version.hpp' witch contains a const char string containing the build number. Since I had no need for an integer version of the build number it is not there, but it is very easy to add. usage: ./buidnum <version string var name>
  14. What I think I will do is: 0. (optional) Script 1. assembler like script 2. bytecode that vm can execute This way I can work on a assembler like scripting engine first and the vm. So I get more visual output sooner (moral boost!). I got everything ready to create a normal scripting engine tough. I never read how real scripting engines work and mine works totally different. First I convert the script into a list of tokens (I know this is what others do too), next I have a class that I can use to define lines. First I add labels into the class (witch are words representing a token id), the line is defined in a simple script like it works like this: operators: & | - and and or, used to specify if a token must follow an other token or that it must have one of the two. ( ) - open and close, so you can create nested or lists. ! - previous token can be repeated. now when you want to create a simple integer definition line: parser.add_rule("tok_type_int & tok_name & tok_endofline", line_defint); when I parse the script it will contain a list of lines with a line id. In order to parse a function definition some more advanced is needed: parser.add_rule("(tok_int | tok_string) & tok_name & tok_open & (tok_close | (((tok_int | tok_string) & tok_name)! & tok_close)) & tok_endofline", tok_deffunction); this will allow you to parse lines like this: int test_function(int intparam string strparam); I got an other class that can 'solve' math, it just sorts the math in such a way that ()'s and other hight priority operators are in the right order. However because it is also rule based (just as the parser) it can be used for more then just solving math (like expressions within a if statement).
  15. Dear Thread reader, I had an idea about a class that will allow me to call member functions like they where normal functions. I'm not at my development pc right now so I can't really test this but I tough that maybe one of you guys knows if this might work. Here is a sample: typedef int (*memfunct)(void* _this, int argument); class member_function { public: member_function(void* _class, memfunct funct) { m_class = _class; m_funct = funct; } int call(int argument) { return m_funct(m_class, argument); } private: void* m_class; memfunct m_funct; }; class A { public: int do(int argument) { std::cout << argument; return argument+1; } } int main() { A aclass; member_function afunction(&aclass, (memfunct)A::do); afunction.call(15); return 0; } Now my question is, will this work or do I have to do some secret assembly magic? I have a general idea of how that will work. Just pop all arguments (including the this pointer) and then call the function address. But of course it would be nicer if this worked. I will check it out as soon as I get to my dev pc. Ow and I'm using linux so I would compile this with g++. Tjaalie, [Edited by - Tjaalie on August 19, 2009 8:55:02 AM]
  16. Thank you that looks really nice. Didn't expect to be introduced to new software so quick:P
  17. Quote:Original post by the_edd Why not just use the features the language provides to guarantee by design that you don't have a leak? The same techniques can be used for resources other than memory, too. That is a good recommendation, but maybe he is converting a lot of code from older projects? If this is the case and you know that the code won't leak (because you used it more then once already) why not just remove the debug code? If this is not the case you should look into what the_edd said.
  18. I'm not interested in a job in the industry. I like to program small things (including games), but I enjoy the systems behind them the most. I spent most of my time writing little libraries and not games. And I do this just for knowledge and fun. Sure its nice that I get recommended libraries that can do that kind of stuff, but that is not my goal. See it like this, some people like puzzles, but I like this kind of stuff. I rarely use the standard library (and is most likely why I never finish the games I'm trying to create), only the classes that I already made a long time ago and lost the source of. But I'm aware of the fact that other people have other goals when they are programming.
  19. Thank you, that is exactly what I wanted to do. Adding a name and id to the dispatcher class and it is ready for use. Not that my scripting engine is anywhere near ready enough to actually be able to execute some c++ code, it was just something I was wondering about. I will keep this thread with my bookmarks so when the time comes I can use the code you posted. Thank you very much.
  20. haha, funny. I don't think I will be using this. The only way to make this work in a way that I think has some nice notation is with a marco from hell.
  21. Call me crazy but I got it to work. Here is the totally messy code that shouldn't be used for anything other than experiments like this. I'm not going to use this code because this is probably undefined behaviour that somehow works the way I want it to work. #include <iostream> typedef int (*memfunct)(void* _this, int argument); class member_function { public: member_function(void* _class, void** funct) { m_class = _class; m_funct = (memfunct)*funct; } int call(int argument) { return m_funct(m_class, argument); } private: void* m_class; memfunct m_funct; }; class A { public: int doit(int argument) { std::cout << argument; return argument+1; } }; int main() { A aclass; int (A::*funct)(int) = &A::doit; member_function afunction(&aclass, (void**)&funct); afunction.call(15); return 0; } It prints '15' when compiled using g++. Maybe someone dares to try this with visual studio, just to see if it works. edit: I tried the code with member variables in the class A. Everything seems to work just as expected. If I can find a way to cleanly convert the member function to a void** without the need of the extra variable I might be able to actually use this. Although maybe not the smartest thing to do but it seems to work.
  22. Thank you, I know of the template stuff but I tough it looked nice if that would work. Too bad, I actually found a compiler on this computer and tried some stuff. I was able to get the address of a normal function into a 64 bit integer, but I couldn't get a member functions address. Is this also impossible? I'm just messing around with some idea's it doesn't really have a function yet, but it will as soon as my scripting engine will be capable of calling c++ functions. I rather not use boost because I'm programming for my own fun and want to do everything from scratch, its really fun to reinvent the wheel from a experience point of view. But thanks for your quick responses, that's why I love these forums. So is it possible to get the address of the function into a integer (or void*) I know this is really bad practice. edit: this is what I got so far. //works unsigned long long functptr = (unsigned long long)&main; //gives error (renamed do to doit) unsigned long long functptr = (unsigned long long)&A::doit;
  23. Quote:Original post by Maverick Programmer Dear God that "professional" site. The yellow. The grey. Why did people do this to themselves? Why? WHY?! *goes and cries* I guess people do crazy things for money. Look at it this way, if only 3 people on this earth think that the laughs they had was worth 5 bucks he gets himself a free nights down at the pub. On the other and you might wanna burn all the evidence of this, I wouldn't want this to show up at a job interview.
  24. I must admit that this is most creative way to beg for money I have ever seen!:P Nah expect for a few punkers I saw in Berlin who where just sitting together drinking beer and shouting to every tourist that walk by: "support our laziness, give us money" (they actually earned more money then the real homeless baggers.
  25. Where does it crash? I have no experience with boost so I'm possibly not in the position to actually help you but does it crash when you push the value, or does it crash later in the program when you have already pushed the value's (now I reread the sentence its really badly formulated:P).
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!