• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Muhammad Haggag

Members
  • Content count

    3548
  • Joined

  • Last visited

Community Reputation

1358 Excellent

About Muhammad Haggag

  • Rank
    Contributor
  1. [quote name='hiigara' timestamp='1323117946' post='4890822'] Solved it!!!! It was bloody SVN shell extension. Still one question remains: if the SVN shell extension I installed corrupts memory, how come it does not crash Windows Explorer itself?[/quote] You're probably running into a corner case in the extension where it's not expecting to be invoked as part of the open file dialog. The dialog runs as part of your process, and so your process crashes.
  2. Can you post your attempts? Which version of Visual Studio are you using?
  3. The last time I ran into this, I was calling DefWindowProcA instead of DefWindowProcW.
  4. The problem manifests because of the MoveBall call: pe = gpBall->MoveBall(*gpPlayerOne, *gpPlayerTwo); You're dereferencing pointers. That'd have been fine if MoveBall took Player references (Player&), but it doesn't: PlayerEnum Ball::MoveBall(Player argP1, Player argP2) What happens is: 1. The MoveBall call copy-constructs two copies of players one and two. That'd have been fine if you'd implemented proper copy construction and assignment on the Player class, but you didn't, so the compiler-generated ones were used. 2. The compiler-generated copy constructor does a shallow copy of the instances (i.e. copies all members), so argP1 and argP2 both end up with handles to the player bitmaps (mhbmpPaddle). 3. At the end of MoveBall, both argP1 and argP2 are destroyed, and your destructor releases mhbmpPaddle, leaving gpPlayerOne and gpPlayerTwo with invalid mhbmpPaddle handles. 4. You SelectObject() with an invalid handle, which fails. You try to draw the paddles, but you're drawing with whatever object was selected before your drawing. There are several good things to learn from this: 1. If your class manages resources (i.e. releases them in the destructor), either write a proper copy constructor and assignment operator, or suppress the compiler from generating them. You can do this by declaring them private: private: Player(const Player&); Player& operator=(const Player&); 2. Avoid jumping to early conclusions while debugging. The problem has nothing to do with height at all. The first thing I did when debugging was to paint the paddles blue, with thin yellow and red stripes at the top and bottom. They still showed up as white, which confirmed that the bitmaps aren't being painted at all when the bug manifests, which pointed to either corruption of the bitmaps or their handles (since they were drawn fine at startup). 3. Always check for return values. If you were checking the return values of SelectObject(), you'd notice that it returns NULL for players right after you unpause the game. After suspecting the bitmaps, I replaced all calls to SelectObject() with a CheckedSelectObject() that breaks in the debugger if SelectObject() fails: inline HGDIOBJ CheckedSelectObject(HDC dc, HGDIOBJ obj) { HGDIOBJ result = SelectObject(dc, obj); if (!result || result == HGDI_ERROR) { OutputDebugString("SelectObject failed"); DebugBreak(); } return result; Once I related the bug to unpausing the game, I quickly isolated the MoveBall call as culprit. 4. Don't pass objects by value. By default, pass them as const references. You avoid painful bugs like this, as well as object slicing bugs (which are equally hairy to locate).
  5. That looks beautiful. I'll give it a try when I get home. Consider posting it to the Image of the Day gallery.
  6. It's been a long time since I've installed a DirectX SDK, so I don't recall what they used to do. I can confirm that the March one doesn't modify the Visual C++ directories, and I think it's better that way. System-wide include/library overrides are dangerous. It makes more sense to add directories per project instead.
  7. As far as Visual Studio plugins go, you won't find anything better for C++. If you're open to moving to other editors, though, some folks on my team use SlickEdit and swear by it. I haven't used it myself, though.
  8. I'd love to see you when you come to Redmond for the MVP summit. I'm not much of a pub/restaurant/whatever guy, but we'll manage something. I'll mail or PM you my phone number when the time draws closer.
  9. 1. Is that the actual code you used? I don't see any __declspec(dllexport) on the Object3D class. 2. Where's the code that calls initialize()?
  10. CodeProject: HowTo: Export C++ classes from a DLL. I'm not sure how things work on the gcc side, though. I generally avoid exporting C++ classes.
  11. Microsoft KB: How to Use WinDiff to Compare Registry Files. Summary: Export registry to text file before and after, use a textual file diff. Given that you're testing your installer, it's generally recommended to do this on clean OS installations using a virtual machine.
  12. Don't call the non-const version from the const one. By definition, the non-const version might change the object state, thus violating the contract of the const version. Do it the other way round: Call the const version from the non-const one. You'll need two casts: One static_cast to add const to this, and a const_cast to remove the const from the return type. Casting the constness away is safe because whoever called the non-const version in the first place has a non-const reference to the object. Color& getPixel( uint x, uint y ) { return const_cast<Color&>(static_cast<const Image*>(this)->getPixel(x, y)); } const Color& getPixel( uint x, uint y ) const { return pixels_[ y * width_ + x ]; }
  13. Quote:Original post by InvalidPointer Quote:Original post by xZekex Why don't you just link it normally in the project settings and not through #pragma stuff. I lose the ability to cleanly differentiate between the 64- and 32-bit versions of the libraries. You can create separate 64-bit configuration variants (i.e. Debug 64-bit, and Release 64-bit). Use the linker search path setting, which is a per-configuration setting, to point to either the 32-bit or 64-bit library directories.
  14. Mice can be harmful. They can transmit diseases. Back before the advent of electricity, it was possible for mice to cause fires by knocking down lanterns and similar primitive lighting devices. The first incident I could find was when a house was lit on fire by a mouse, and so prophet Muhammad told people they shouldn't leave fires lit at night, and that they're allowed to kill mice. So in general Sharia allows killing mice if they're deemed harmful. For those living in rich countries, this might seem irrelevant. It is relevant in many parts of the world--remember, the poor vastly outnumber the rich, the under-developed vastly outnumber the developed. The village where my mother was born, for example, was introduced to electricity only 40 years ago. My mother, a pathologist, used to study on Kerosene lamps when she was a child. How this guy projected the above into "Mickey Mouse is a soldier of Satan, and should be killed" is his problem. There are no "insane laws". The same guy, for example, thinks it's prohibited to take personal photographs unless necessary (as in: you can't just photograph yourself and keep the photo in an album--it has to be for a driver's license or something. And he's probably against using photos in drivers' licenses, but I digress). You'll find these sorts of opinions mostly among some Saudi "scholars", because of their somewhat bedouin lifestyle.
  15. Windows Server 2008 seems to beat the pants off Vista in terms of responsiveness. A coworker installed it recently and we watched in shock as he right clicked the desktop and the menu appeared right away! [grin] Seriously, Control Panel doesn't take time to load (as it does on the retarded Vista). He can have a build running, and actually be able to use Outlook (not possible under either Vista or XP with our Quad core machines at MS). And so on.