• Content count

  • Joined

  • Last visited

Community Reputation

1298 Excellent

About smart_idiot

  • Rank
  1. Parsing an OpenType Font File

    Use [url=""]FreeType[/url]. Don't worry, you can still waste as many days as you want caching glyphs in textures, and if you still get bored, you can even try to get subpixel rendering to work. I don't think anyones ever bothered to do that in a 3D game, but hey, you can be the first.
  2. [quote name='SiCrane' timestamp='1303126227' post='4799843'] [quote name='smart_idiot' timestamp='1303125433' post='4799839'] [code] std::string result = (char *)str; RpcStringFree(&str); return strguid; [/code] [/quote] I think you mean return result;. Also, if the constructor for result throws an exception, str will leak. [/quote] [i]*smart_idiot grumbles incoherently about RAII and wanders away. [/i][i]*smart_idiot pauses for a moment to wonder if he'll be told to use boost::shared_ptr, and then continues walking.[/i] [i] [/i]
  3. [code]#include <rpc.h> #include <string> #include <stdexcept> std::string GetUnqueIDString(UUID *guid) { std::string result; unsigned char *str = NULL; if(UuidToString(guid, &str) != RPC_S_OK) { OutPutDebug( "ERROR GetUniqueIDString FAILED", //the message to display __PRETTY_FUNCTION__, //the location the message was called Eg. what function true); throw std::runtime_error("Unable to determine GUID."); } try { result = (char *)str; } catch(...) { RpcStringFree(&str); throw; } RpcStringFree(&str); return result; } [/code]
  4. This looks like a DailyWTF in the making. GetUnqueIDString does a bunch of nonsense and then returns an empty string.
  5. The only thing that comes to mind is 'backing store', but that's pretty generic and can apply to anything stored in a cache.
  6. already defined in main.obj

    I fear the dependency graph for your program is going to look like a bowl of tangled spaghetti.
  7. Where is this pointer and what is the problem you're having with it?
  8. already defined in main.obj

    [quote name='Mozly' timestamp='1303095203' post='4799720'] still one little thing, How do you globally define a union type like SDL_Event event in a header file? Because I keep getting this error 1>main.obj : error LNK2001: unresolved external symbol "union SDL_Event event" (?event@@3TSDL_Event@@A) even though I declared it as an external variable [/quote] [i]Hello? Hello? Anybody home? Huh? Think, McFly. Think! I gotta have time to get 'em retyped. Do you realize what would happen if I hand in my reports in your handwriting? I'll get fired. You wouldn't want that to happen, would ya? Would ya? [/i]The union isn't special, you stick a non-extern copy of it in a source file like you did with everything else... although I'm really doubtful there's a good reason your event object needs to be seen globally.
  9. pseudocode

    [code] #include <whatever> class Entity { protected: double x, y; public: Entity(double x, double y): x(x), y(y) {} virtual ~Entity() {} void draw() = 0; void update() = 0; }; class Ship: public Entity { public: // whatevers } // ... int main() { // Init drawing code. bool running = false; vector<Entity *> entities; while(running) { while(messages) { if(message.type == KEY_DOWN) switch(message.key) { case KEY_ESCAPE: running = false; break; case KEY_S: shields = !shields; break; // ... } } for(vector<Entity>::iterator i=entities.begin(); i != entities.end(); ++i) { i->update(); i->draw(); } SwapThineBuffersLestThyEntitiesBeInvisible(); } // Clean up code here. } [/code]
  10. already defined in main.obj

    [quote name='Mozly' timestamp='1303093661' post='4799710'] [quote name='smart_idiot' timestamp='1303092583' post='4799705'] Put '[i]extern SDL_Surface *red, *green[/i][i], *blue, *shimmer;[/i]' in the header file, and put '[i]SDL_Surface *red, *green[/i][i], *blue, *shimmer;[/i]' inside the source file. [/quote] Now that I added extern it works. But I dont get why? [/quote] Extern is compiler speak for 'Please just take it on faith that this variable exists and that the linker is going to tell you where at some as of yet unknown time and place.'
  11. already defined in main.obj

    Put '[i]extern SDL_Surface *red, *green[/i][i], *blue, *shimmer;[/i]' in the header file, and put '[i]SDL_Surface *red, *green[/i][i], *blue, *shimmer;[/i]' inside the source file.
  12. I can't see anything obviously wrong with it, other than that I don't see a #include <string> anywhere.
  13. I'm skeptical that m_Strings is of the type std::map<std::string, int>; why is the error message mentioning std::vector?
  14. Design Discussion: Perma Death

    Perma-death is fine if: [list][*]You can't die due to the whims of the RNG. There should be a clear reason for your death that can be learned from and avoided in the future.[*]Your dead characters can leave their mark on the world. You can find your deceased players in Nethack, Oregon Trail you can find their tombstones, in Dwarf Fortress you can explore and read the engravings in your fallen fortresses. It's also a sense of accomplishment, as finding these things means you've surpassed your old character.[*]There's no PvP combat. Humans are no good dirty cheaters and must never be trusted.[/list]
  15. [.net] LuaInterface issues...

    Sorry, I don't know about LuaInterface. My best shot in the dark is that '[i]PersonSelectionScreen.LoadBackground(0x3FA[/i][i])[/i]' should be '[i]PersonSelectionScreen[color="#FF0000"][b]:[/b][/color][/i][i]LoadBackground(0x3FA[/i][i])[/i]', which is equivalent to [i]'PersonSelectionScreen.[/i][i]LoadBackground([/i][i]PersonSelectionScreen, [/i][i]0x3FA[/i][i])[/i]'