Jump to content

  • Log In with Google      Sign In   
  • Create Account


SimonForsman

Member Since 18 Oct 2005
Online Last Active Today, 05:25 AM
*****

Posts I've Made

In Topic: SDL Keyboard input

07 July 2014 - 08:38 AM

 

 

Thanks for response! Your suggestion did fix my problem however now I am getting a weird bug when if I just simply move character it works fine and then suddenly it just keeps going into random direction as if SDL did not notice that I release the button (SDL_KEYUP). In order to interrupt my character from moving uncontrollably I have to tap the button twice for sdl to register the SDL_KEYUP. At first I thought my keyboard was glitched so I rebind-ed the buttons. Same thing. I checked everywhere but I think I am doing something totally wrong with event handling. Any suggestions? pastebin.com/mGv4ZLmJ (updated)

 

If you are using this code: https://github.com/gratholio/sdlscroller as your base: please don't. it is making a huge mess of things.

the sdl_setup::begin method gets a single event from the queue and stores it as mainevent (which is then returned by all calls to GetMainEvent) and clears the renderer(big wtf), it also discards the return value from SDL_PollEvent, there is no way to use that wrapper correctly since the wrapper itself is completely broken.

 

Just use standard SDL instead.

 

[source]

 

while(!quit) {

    SDL_Event event;

    while(SDL_PollEvent(&event) != 0) {

        quit = event.type == SDL_QUIT;

        //handle the rest of the events here       

    }

    update();

    render();

}

 

Thanks a lot! Now it works perfect. I was actually following "Lets Make an RPG C++/SDL" tutorials on youtube but it appears that the code is exactly the same as the link you provided. Can you suggest a good resource to learn from or I should just stick to lazyfoo?

 

 

The Lazyfoo tutorials are fairly high quality so they would be a good choice, i would recommend avoiding video tutorials (videos are a bad format for tutorials).

 

Video lectures however work great, these are worth watching(Not game specific):

http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/video-lectures/


In Topic: SDL Keyboard input

06 July 2014 - 09:30 PM

Thanks for response! Your suggestion did fix my problem however now I am getting a weird bug when if I just simply move character it works fine and then suddenly it just keeps going into random direction as if SDL did not notice that I release the button (SDL_KEYUP). In order to interrupt my character from moving uncontrollably I have to tap the button twice for sdl to register the SDL_KEYUP. At first I thought my keyboard was glitched so I rebind-ed the buttons. Same thing. I checked everywhere but I think I am doing something totally wrong with event handling. Any suggestions? pastebin.com/mGv4ZLmJ (updated)

 

If you are using this code: https://github.com/gratholio/sdlscroller as your base: please don't. it is making a huge mess of things.

the sdl_setup::begin method gets a single event from the queue and stores it as mainevent (which is then returned by all calls to GetMainEvent) and clears the renderer(big wtf), it also discards the return value from SDL_PollEvent, there is no way to use that wrapper correctly since the wrapper itself is completely broken.

 

Just use standard SDL instead.

 

[source]

 

while(!quit) {

    SDL_Event event;

    while(SDL_PollEvent(&event) != 0) {

        quit = event.type == SDL_QUIT;

        //handle the rest of the events here       

    }

    update();

    render();

}


In Topic: Can you import character rigs from games?

30 June 2014 - 06:42 PM

I was wondering is it possible to import character rigs from a game and use them? For example, WoW has a lot of character emotes, is it possible to copy/paste those onto a blank model and have it emote accordingly?

 

Yes it is possible (allthough its a bit more work than simply copy & paste), (it would most likely violate the license terms of whatever game it is you are taking the rigs from though, the games that have permissive licenses tend to make their assets easy to access and use)


In Topic: Cross Platform C++ Database library?

28 June 2014 - 09:53 AM

I see your point regarding security. I'll go with the server and add a little encryption between the client and server. But still, how does one get hands on the MySql source? I followed the links, tried with Bazaar, no success!

 

The mysql source can be found here:

http://dev.mysql.com/downloads/mysql/

 

Select "Source code" as your platform to get the source code (Same thing goes for all the connector libraries etc, just select source code as your platform if you don't want a binary package)


In Topic: How to download a website as ms word with the pictures inside

26 June 2014 - 10:43 PM

You should probably be aware that a html document that you give a .doc extension is still a html document, not a word document and thus it can't include images (it can link to images but those images will have to be downloaded separatly) (Other office suites might also have trouble opening those files as they won't be in the expected format)

 

A far better solution is to actually generate a word document using for example: http://phpword.codeplex.com/ (It is very easy to use)

 

 

If you absolutely insist on using renamed html documents you will have to make an archive (zip for example) containing all the required files (images, stylesheets, etc) or to use data uris (<img src="data::image/png;base64,{base64encodedimagedata}"/>) but i don't know if word supports those. (it might work in newer versions of word (Microsoft added partial support for it in IE8 and made it semi decent in IE9)


PARTNERS