Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by phirekid718

  1. phirekid718


    edit: i had my laugh now let me try to help. where exactly are you having problems? what is it that you understand and what don't you understand? do you know what you need to do? do you get the idea? No one is going to do your assignment for you, no matter how many times you say please. But if you have any questions then this is the right place.
  2. phirekid718

    Could someone explain this?

    I like to say char * a_pointer; You can also declare it as int main(int argc char **argv); http://stackoverflow.com/questions/3898021/mainint-argc-char-argv
  3. phirekid718

    An Open Letter to Young Programmers

    The reason programmers do not maintain a code base is because they have to follow deadlines. They would do anything to just get their concept onto the screen because the deadline is the only future they are concerned about.
  4. I am trying to implement a joystick in cocos2d-x. The idea is to allow the user to slide a circle within a larger circle so the direction of the slide controls the direction the character moves. If there is a better way to do this please let me know but so far my code looks something like this:   if(joystick.x < xMin)          joystick.x = xMin;      if(joystick.x > xMax)          joystick.x = xMax;      if(joystick.x < yMin)          joystick.x = yMin;      if(joystick.x > yMax)         joystick.x = yMax;   The joystick in this code represents a circular sprite that the user can slide around to control the character. But as you can see, the code confines the sprite so that it stays within a box formed by the sides xMin,xMax,yMin and yMax. I don't want that. I want to confine the sprite within a larger circle. How can I do this? Please and thank you.
  5. phirekid718

    Vitrual touchscreen joystick

    Are there any 2d games on touch screen devices with a good joystick (or dpad) implementation? I haven't found a good reference for this, so I have researching physical joysticks and what this comes down to is called a "restrictor gate". (see link under "8-way")   http://www.slagcoin.com/joystick/restrictors.html   Now I want to test the same concept, except within an octagon. So to clamp a point within a rectangle: if(point.x < throwRect.getMinX())         point.x = throwRect.getMinX();     if(point.x > throwRect.getMaxX())         point.x = throwRect.getMaxX();     if(point.y < throwRect.getMinY())         point.y = throwRect.getMinY();     if(point.y > throwRect.getMaxY())         point.y = throwRect.getMaxY();   To clamp a point within a circle: if(distance > throwDistance)     {         point.x = stickCenter.x + cos(angle) * throwDistance;         point.y = stickCenter.y + sin(angle) * throwDistance;         }   How can I clamp a point within an octagon? Thank you
  6. -first ten seconds   What is the idea behind both kinds of beams on the player? Two approaches come to mind. The first one seems like a long, animated sprite that is drawn on top of a ray cast and cropped off at the first collision. The side beams look like a chain of small images where the each link moves slightly slower than the one behind it. I am not sure though so any insight will be very much appreciated. Please and thank you.
  7. phirekid718

    Implementing beams for space shooter

    Thanks a trillion. I implemented the beam as a long animated texture that gets "cropped" based on a ray cast. If the ray cast intersects with a fixture then it renders a explosion sprite on top of it. The green projectiles are simply bullets shot at a fast speed as said earlier. However, the orbs (the white things that shoot the green projectiles) get their position from the player's position some x frames before.   Some pseudocode: const int delay = 10; //orbPosition is playerPosition at ten frames before player's currentPosition VectorClass pastPositions [delay]; //update index once per frame int index = 0; orbPosition = pastPositions[index] + offset; pastPositions[index] = currentPlayerPosition;
  8. phirekid718

    Vitrual touchscreen joystick

    Thanks. I was going to leave it as is. I just wanted to see if there was some programming trick that could be used.
  9. phirekid718

    Vitrual touchscreen joystick

    Thanks. It was the clamping that troubled me. Is there a way to do it without calculating square roots? I have read that it was expensive. But so far this works fine.
  10. phirekid718

    Implementing beams for space shooter

    Is that both of them (blue and green)? I can't see the individual sprites in the blue beam. And what is the logic behind the sprites in the green beam? Does each sprite follow the one preceding it? And how is it that both beams keep their stream-like fashion no matter how the player moves? Thanks again.
  11. phirekid718

    Textbook code memory leak

    Thank you. I thought it was just me. It's been nearly a month and the only way I could figure to get this working was to go with the ToyMaker's implementation of mesh animating. Although it uses software skinning, It works. Has anyone ever taken so long on one task? Why or why not? Things like this make it seem like I don't have what It takes to make games. Again, thanks.
  12. Character animation with direct3d http://www.cjgraphic.com/   If anyone can check out chapter 3.4 I would greatly appreciate it. I've been trying to find the leak for days now and I just can't. I feel that It must be the way he implements the allochierarchy class, but I just can't fix it. I also compared with the animation article on this site and with the sample code from directx, and it's taking nearly the same approach. If anyone can tell me whats causing it I would really appreciate it. Thanks.
  13. phirekid718

    No debug output in vs2010 after app close

    I ended up choosing to scrap xact and go with directsound as presented in the Toymaker's website. I may regret changing to this platform but for now it does exactly what I need it to do and the debug output displays as expected. I wish I didn't have to go through the process of changing the whole sound engine, but I can't see any other way, especially when the examples in the directx sdk such as "xactgame" have the same problem: loading up debug output at the start but not after the app closes. I guess I could have disabled the sound and continue building, but that would have been cheating for me. I feel that this problem is an indication of a much greater problem, but I don't know what. Any feedback would be appreciated.
  14. I set the debug version in the directx control panel, also the maximum validation and "most" output level. I also included the lib and include files for visaul leak detector. While my app is running the d3d shows the warnings ignoring the redundant state.   When I close the app however, there is no "memfini" output from directx or any output from visual leak detector. It just says exited with code 0.   What am I missing? Thank you.
  15. phirekid718

    No debug output in vs2010 after app close

    I found that it has something to do with the XACT code that I am using from the directx sdk tutorials. I can't figure it out yet. It seems that the threads in the sound engine get in the way of the debug output from the other threads, if that makes sense.
  16. phirekid718

    Textbook code memory leak

    I don't understand how someone gets away with publishing code that has memory leaks, leaving me to find them. I emailed the author, and I don't think I'm going to get a response. I tried switching to the code found below, which is similar, and doesn't have any leaks. But the problem is that I am having trouble making it so that my character can hold something in his hand. With the textbook code, the application shows the character holding (a sword in this case) and moving it around just fine, but I can't find the memory leak after all this time. With the code in the article implemented the character can still make the motions, but the sword is not there. If anyone has some insight please help. Maybe there's another resource on this subject? Thanks.   http://www.gamedev.net/page/resources/_/technical/game-programming/working-with-the-directx-x-file-format-and-animation-in-directx-90-r2079
  17. phirekid718

    Textbook code memory leak

    Thanks for your help. I tried it but unfortunately that,s not the issue. If I do not load the mesh using the hierarchy (last line in the same init method) then there are no leaks.   This is the output when the mesh is loaded (From the directx debug runtime). Direct3D9: :====> ENTER: DLLMAIN(6023d9a0): Process Detach 00001b20, tid=00001f54 Direct3D9: (INFO) :MemFini! Direct3D9: (ERROR) :Memory still allocated!  Alloc count = 143 ... Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 2388080 bytes   It also shows resources that are not destroyed when running pix. So there is definitely a sneaky leak somewhere, again most likely in the bonealloc class.
  18. How do I get an animated 3D model into a directx application? I know there's this mesh interface, but is it better to hard code it into a .x file or use a modeling program to export the .x file? It seems that the available exporters are either no longer online (panda) or not good for animated meshes. Are xfiles even the best way to go? Im reading otherwise on these forums. Also I'm using maya, but whatever works best is fine with me.   Basically if xfiles are the way to go  (for animation) what is the best way to create one? if not, what is?
  19. phirekid718

    D3D9 How to: Animated models? (xfiles?)

    Well softimage doesn't seem to export animation from .x files. I may be missing something, but I tried everything I could think of. I picked up TrueSpace which exports very well, animations and all. The exporter is also built in. It's much different from the autodesk products, however. I can't help but feel that I'm going about this the wrong way, even though everything works as expected. If anyone has any input on the process of creating a mesh, animating it and getting it into a directx 9 application I would greatly appreciate it.
  20. phirekid718

    D3D9 How to: Animated models? (xfiles?)

    Maybe the question was confusing. Im new to direct3d and just figured out how to export and load a static mesh. Autodesk softimage has a built in exporter. It's just that I wasn't sure about these other third party exporters for maya, 3dmax and blender, based on what I've been reading on these forums, which led me to believe that maybe the .x format is not the right way to go. Im just hoping that this softimage exporter will work with an animated mesh as well. Once I create the animated mesh I will post my experience getting it into my application.
  21. phirekid718

    D3D9 memory still allocated

    Thanks. My problem was that I called D3DXCreateFont twice for the same object. A small, sneaky line created it the second time. The debug output was irrelevant in this case. The PIX object list output was also distracting. What worked best in this situation and probably will in most direct3d leak errors is to use PIX's  "log of all D3D calls made in frame number:" on frame one.
  22. Direct3D9: (INFO) :MemFini! Direct3D9: (ERROR) :Memory still allocated!  Alloc count = 143 Direct3D9: (ERROR) :Current Process (pid) = 000010b4 ... Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 2083940 bytes Direct3D9: :====> EXIT: DLLMAIN(61d4d9a0): Process Detach 000010b4   I use these direct x objects, all of which I am sure I release() and set to NULL;   LPDIRECT3D9                                LPDIRECT3DDEVICE9      LPDIRECT3DVERTEXBUFFER9 LPDIRECT3DINDEXBUFFER9 LPD3DXSPRITE           LPD3DXFONT                map<wstring, LPDIRECT3DTEXTURE9>   PIX shows that the index and vertex buffer, created by the application, are never destroyed (I call release on both). It also shows that two d3d9 surfaces, created by direct3d, are never destroyed (usages: rendertarget and depthstencil).   When I call release() on the graphics device there is still a reference to it, so calling release on it again leaves no leaks. I doubt this is the solution, just doesn't seem right. What other methods would add a reference to the device? Or what could it be that I am missing? Thank you.    
  • 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!