Jump to content
  • Advertisement

Fionn

Member
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

122 Neutral

About Fionn

  • Rank
    Member
  1. After short looking at your code, at least this line contains unnecessary code: ((A&)(*this)) = A::operator=(bobj); You are calling a member function of your base class (since operators are also simple functions and just syntactic sugar). At the end of your base class function your return a reference to yourself. In that line above you take the reference to yourself get the address of yourself and assign the address of yourself to the this pointer (which allready contains the address of yourself). So this should be fine anyway: A::operator=(bobj); And I would say that you should never assign anything to this itself unless you really know what you are doing (but i guess even then you don't need to mess around with the this pointer). Btw, in your case even the automatically generated copy constructor and assignment operator will do the job, since you are not doing anything but a binary copy of your objects.
  2. Fionn

    foreach in C++?

    Well the direct access loop may not always be the best thing you can do. If you have a linked list container and are accessing the element by offset you may have to travel trough all elements each time you access the container. But all STL containers also give you iterators: #include <vector> #include <string> int main() { std::vector<std::string> myVector; myVector.push_back("test 1"); myVector.push_back("test 2"); typedef std::vector<std::string>::iterator MyIteratorType; MyIteratorType begin = myVector.begin(); MyIteratorType end = myVector.end(); for(; begin != end; ++begin) { //You loop as long as you are not at the "past the end" iterator std::cout << *begin << std::endl; //With *begin you access the actual element you are at } }
  3. Fionn

    Tutorial C++

    I liked the Books of Bruce Eckel "Thinking in C++" Vol1 and Vol2 back in the days of lerning C++. They are also available for free at www.mindview.net (Seems to be down currently, but go to books->download or something like that). They may not be the books for the total beginner, but the quality is very good.
  4. I allready thought about UDP but the question is if you can get the packet loss recovery better than than TCP/IP, and the advantage of TCP/IP is that the hardware (possibly) deals with the packet loss stuff. The other question here is why then many sucessful games (in the mmorpg sector WoW, Linage, ...) use only TCP connections? There it seems to work perfectly well. Also encrypting UDP traffic seems much more work than encrypting a stream of TCP/IP. An the Firewall/NAT story also seems to speak for TCP/IP (I may be wrong here, but i think a client opened TCP/IP connection is easier than a UDP two way channel - so UDP seems also to raise the support amount). An idea which i head in the last minutes is this: Use async I/O with the buffer size set to 1 or a few bytes which would trigger allways if there is some new data, and then use a nonblocking read on that socket to get maybe waiting buffered data. The question is just if this would be better than a large select/poll for performance. But I have read that this calls doesn't scale well if you have a lot of connections, which would be true for an multiplayer server/gateway. [Edited by - Fionn on December 2, 2006 6:20:45 PM]
  5. In the last days i figured must stuff about IMEs out, but there is one thing still puzzling me: If i am inside a game, i got it working to switch the different input languages (DE->EN->JP for example), but as far as i know there are also different input modes. (I used this example http://bulldog2.redlands.edu/dept/AsianStudiesDept/Language/japanese_write.htm) So there seems to be some different input modes with each IME too (like the Direct Input and Hiragana in the sample). How would you switch this modes inside a game (or how would it be best to implement that?), everything with Hotkeys/Shortcuts? Or does a internationalized game has a sort of complex language managment bar? If you would have some screenshots of actual implementations of IMEs in games that would be great. Fionn
  6. Well this is why i hope that someone who uses it everyday can help me here, because most of the info on the net are not really useful if you have no idea how it is used in everyday usage and such things.
  7. Fionn

    Text and Complex Scripts

    For the rendering on Linux i know you have to use ICU or Pango together with freetype. Freetype just does the glyph rendering - nothing else. All the painfull features in the TrueType Tables most be done seperatly. @Anon Mike: So you transfer whole strings to texture memory?
  8. Fionn

    Text and Complex Scripts

    The question is with the glyph cache thing if you not loose the performance gain with not rendering the strings with the transfer of the quads, because then you have to store the location of every single glyph and transfer this glyph image every frame. And i believe that most text survives many frames (even with chat or log windows) - if you let a seperate thread do the rendering you should not have any problems i guess (for example i can also let a game run and some sort of irc client or such stuff in another window on my second screen smooth, which would be the same as running the rendering of strings in another thread). And for long living text (like Player Names etc..) only a single transfer is needed instead of one for every glyph. And if the system implements a glyph cache in it's system functions, rendering the strings would be very fast.
  9. Fionn

    Text and Complex Scripts

    @hplus0603: So you have multiple lines of text in one big texture (maybe split the texture vertical into lines of the size of on line at a particular font size)? I just thought that maybe a mixture of the quad based and the line based could do it. I tought of splitting the lines also horizontally, e.g. 20 elements in a line. And then using something like a page table in the system kernel. Just discover how many items a string would take up and find the next free sequence. If you run out of long enough seuqences you just could pack the existing texture or create a new one. Because if you just use a one item per line it would waste much room of the texture. E.g. "The quest objective is to blabla..." compared to "Open", or just simple labels on the buttons.
  • 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!