Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

1080 Excellent

About amrazek111

  • Rank
  1. amrazek111

    Find Direct3D device

    Sure it can be done.  I assume you don't have control of the process that owns that handle, so what you'll be needing is 1) a strategy to get your own code running inside that process and 2) a strategy to find the device pointer once you're inside.   The simplest solution is a proxy DLL, which would cover both cases nicely.  Some helpful articles could be found by googling "DirectX hook proxy dll"
  2. amrazek111

    Double Screen Resolution

    You're going about this the wrong way. You can reduce the screen resolution and use your graphics at their current size, orscale your graphics up as part of the resource loading process rather than trying to scale the entire screen (or individual surfaces) on every frame, orscale your graphics up in whatever you're using to create them so that they're the correct size relative to your desired resolutionDoing any kind of pixel manipulation is going to be very slow in SDL1.2 so offload as much of it as you can into one-time processes performed at startup.
  3. You base the bullet's direction on the player's facing.  Turn bullet into a struct or class with the properties X, Y, and direction (or create yet another array for the bullet direction, though this is clunky).  When you shoot a bullet, copy the player's direction to the bullet's.  Then when you update bullet positions, use the bullet's own direction.   A cleaner way of doing this would to instead give each bullet a position and velocity vector (speed + direction) when fired.  Then there's no need for an if statement at all and bullets could travel in any direction.  Simply add the velocity vector (* elapsed time) to the bullet's position vector during each loop.
  4. amrazek111

    Digging Tunnels In Map

    Funnily enough I ran into this exact problem (and I mean exact) some time back.  Tunnels were represented by a connected graph.  The map itself was a plane made up by a fairly dense grid of vertices.  When a tunnel was added, I swept along the path from origin node to the new node, deforming the plane's vertices in a half-cylinder with a touch of randomness to avoid perfectly smooth walls and with a taper as it reached the end.  This was done gradually as ants arrived at the "dig" site to "grab" a small piece of dirt to haul it to the surface.   In my case I didn't need a collision mesh as ants would always take paths connected by nodes and never ventured outside of those paths.  You could create one as you constructed tunnels fairly easily though.   If you're looking for a two-dimensional solution, one easy way (and the way I started out initially with HGE before switching to Ogre3D) is to create two layers.  One layer represents "dug" tunnels, the other a "cover" layer showing dirt.  As you create tunnels, erase parts of the cover so that the bottom layer shows though.  I've actually got a screenshot of that version: [spoiler]   I went with two layers rather than blitting the dug texture in so that the "cover" dirt would still be able to occlude some objects in the scene, giving the appearance of depth and eliminating the worry that the ant sprite would have to fit entirely within the confines of the tunnel at all times. [/spoiler]
  5. amrazek111

    Good indie games?

    Have you tried Super Meat Boy or Fez? 
  6. Nothing stands out to me at first glance.  Have you tried going through it line-by-line with a debugger?
  7. amrazek111

    Separating Windows folders

    I didn't want to respond until I'd had a reasonable amount of time to test things out, since I'd only recently moved my folders.  Everything has been working fine, with one exception: some updates (specifically, those related to internet explorer) failed with error 80070011.  It turns out Windows 7 has some entries in the registry that need to be altered if you move your program files with a junction.  I found this solution which solved those issues for me. 
  8. amrazek111

    Accelerated C++ chapter 3 help needed.

    That's because whatever invalid input cin tried to convert into x's type is still in the buffer.  What's wrong with simply ignoring the remainder of the invalid input with cin.ignore()?
  9. amrazek111

    Accelerated C++ chapter 3 help needed.

    It's a bit subtle.  http://www.parashift.com/c++-faq/istream-and-while.html   In a nutshell: your while loop continues until the user puts the stream into an error state, after which all attempts to extract data from it will fail until the error state is cleared.  After the loop, reset the stream's state with istream's clear() function (cin.clear() -- as cin is just an istream under the hood)   As an aside, you can still break things in the same way by providing invalid input for the first two cins.  For instance, typing anything that can't be cast to a double for the midterm or final grades will also put the stream into an error state and skip past the loop and your final cin.  It might be wise to check the stream's state after those to see if the user tried to input something invalid.
  10. amrazek111

    Separating Windows folders

    Have you tried symbolic links?  I moved my Program Files directories off of my 32GB SSD successfully using them.    Edit: Using robocopy and the Windows 7 Repair command prompt*
  11. Is your image loaded successfully?  Right after img would be a good place to display SDL_GetError() if img turns out to be NULL.   Also: Don't assume you know the underlying pixel format.  For instance, on my computer your masks are wrong.  Just use the screen's format. SDL_Surface* img = IMG_Load("blocks.png");     if (!img) {         std::cout << "Error: " << SDL_GetError() << std::endl;         return -2;     } SDL_Surface* f1 = SDL_CreateRGBSurface(SDL_SWSURFACE,500,500,32,_screen->format->Rmask,                                                                     _screen->format->Gmask,                                                                     _screen->format->Bmask,                                                                     _screen->format->Amask); After that, blitting with the alpha transparency worked fine for me.
  12. amrazek111

    [SOLVED] Shader crash

    It sounds like D3DXCreateEffect* might have failed and you're trying to access a NULL pointer. Did you check its return value?
  13. In the interest of a direct answer: that's a forward declaration wrapped in a friend clause.   class Foo {     friend Event; }; class Event {}; Compiler error - error C2433: 'Event' : 'friend' not permitted on data declarations     class Foo {     friend class Event; }; class Event {}; No problem!  Equivalent to:   class Event; class Foo {     friend Event; }; class Event {};   Apologies if this was obvious.  If your question has to do with why it's being used like that, I haven't the faintest idea.  It appears event, request and response are tightly coupled for some reason
  14. So it's already sorted by chunk, that'll do just fine.  What stops you from simply looping through the grass strips of the removed chunk and adjacent chunks and applying your chosen solution?    You needn't necessarily delete any offending grass strip*, either.  If you want all the strips to use exactly the same model and similar geometry, simply rotating or translating an existing strip a little bit to a new valid position might even work.   *on blocks adjacent to the removed one
  15. Isn't your grass sorted in some way already?  If you don't have some kind of paging* system in place you might run into performance constraints later if you wind up having a lot of grass   Edit: when I say paging I'm thinking octree or other spatial hierarchy
  • 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!