• Content count

  • Joined

  • Last visited

Community Reputation

158 Neutral

About Desdemona

  • Rank
  1. std::ifstream problem

    Are you sure the error is coming from this block of code? Which line? I tried compiling it under VC6 and didn't get any errors.
  2. Char to Binary

    I would say the only necessary edit was changing the 7 to an 8, as using {0} initializes the entire array to zero. Although, using {0} in place of a list of zeros is just a habit I picked up from others. I've never heard any concrete info about this "trick". Does anyone know of side-effects to initializing arrays or structures using {0}? D
  3. My current project is being written for Windows, although I have tried to keep OS-specific code to a minimum. I would like to try and port the project to Linux or Mac after I'm finished. I've never done any programming on either of those platforms, so this project would be my indoctrination for that. Is monitoring files for changes possible/difficult/efficient in Linux? Is there any OS mechanisms for this, or would I need to manually/constantly check the files for changes? I am just interested in Linux' general ability in this area. I have a few options that do not include monitoring file changes, and I just don't want to code myself into a corner. Thanks, D
  4. Need some logo work? Salsa is your flavor.

    Hey, I'm looking for a logo if they're still available... ;) You stuff looks good. I'm looking for something simple and abstract- something along the graphic style of the tigerblau logo, or Raven software, etc. The group name is cold coast entertainment. The logo needs to have a coastal theme (i.e. ocean, beach, rocks, lighthouse, etc). It would also be cool if it could be regional to Oregon (i.e. something like the outline of garibaldi rock). [Edited by - Desdemona on September 17, 2006 12:28:12 PM]
  5. Is process running?

    Fyi, an easy approach here is to simply use FindWindow if you know any "unique" window classes of the process in question (if it has any). i.e., if FindWindow("myClass", "myWindowName") returns NULL, then you know the process isn't running. D
  6. MUD/RPG economics

    Quote:However this can encourage solely hunting and not so much player interaction. Also, its unrealistic . . . I'm not sure I understand that statement. I generally find that keeping the rewards low and the prices high is the easiest way to make a game economy that is stable, albeit draconian. Its a balance issue- after a certain point of increasing the rewards, then everything simply goes to hell. Bartering systems could go a long way though. Say a monster dropped a weapon you don't want. You could barter that item for a weapon from a store. You would probably still need to pay some money for the store item, but the reduced price would be more than if you simply sold the monster-dropped item outright. D
  7. technorati

    Technorati Profile
  8. I say "virtual desktops" because I'm not sure how to better describe this. Is it possible to make a Win32 program that functions like an MDI app / desktop? By that I mean to be able to create child processes whose windows are child windows of the virtual desktop app, instead of the user's main desktop? (i.e. so you could have many program windows all encapsulated into a single MDI app window.) Any information would be appriciated. Thanks, D
  9. [web] rss

    Thanks for the reply. I ended up using a 3rd party site for this ( D
  10. [web] rss

    I was looking into what it would take to take an RSS feed and display it on my homepage. I guess there is two basic ways to do this, one being server-side (php?), and the other being client-side (javascript?). I would prefer doing things server-side. What are some good options for this? Any useful links to resources/tutorials? My page is hosted on, is server-side even an option? (I am a C/C++ junkie, my html/web abilities/knowledge is very low!) Thanks D
  11. Z-Buffer CSG Alternatives

    I have a complex triangle mesh that I am trying to split using axis aligned planes. I have a working z-buffer CSG implementation, but I would need to be able to store all the coordinates for the generated object. That is, after I split my object using my splitting plane, I want to update the triangles that were split by the plane, and generate additional triangles to fill the open areas of the object so that it appears solid. Does anyone know any methods for this that works on a triangle-level instead of using z-buffer tricks? Thanks, -D
  12. Laptop Computer for Game development

    One thing you should take note on is how you will get driver updates. I use an HP nw8000 for work with an ATI 128mb fireGL graphics card. It is a reasonable card for a laptop, but there is a gotcha: I can't just download the latest ATI drivers off of their website - I need to get my graphics drivers from HP. And HP is not exactly inclined to pump out updated drivers. It seems to be more a problem with laptop OEMs in general, and not just HP, as they are responsible for supporting their embedded graphics cards (not ATI). This recently became a thorn in my side when I went to my display properties to tweak my OpenGL preferences only to find that there was not an OpenGL preferences tab (only DirectX). And considering I'm running the latest and greatest drivers, there is not much hope unless I use modded drivers. -D
  13. getting HWND and message loop without a window

    Quote:Original post by Anonymous Poster Use PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE) to create a message queue for the thread, then use PostThreadMessage using the thread ID to send the messages That was me. Anyways, this works well in multithreaded environments, or if your only using a single thread, you can still use GetCurrentThreadId to get your main thread's ID. -D
  14. Index operator

    I have it by-value in my engine at the moment. Reason being is I do a lot of manipulation to the incoming string, and by-value saves me the need of creating a 2nd temporary string to hold the changes. Is there anything behind the scenes occuring in AngelScript that would make this much more inefficient than normal by-value parameters in C++? -D
  15. Index operator

    I'm trying to get the [] operator registered in my application, and AngelScript keeps on crashing on Build(). If I use ints/floats at the index parameter, everything is fine. The problem occurs when I try to use strings. Below is a simple test case for this (note that using a by-value string as the index is on purpose, although I have tried this using references/handles with the same effect). // asTest1.cpp #include <windows.h> #include <iostream> #include <string> #include <cassert> using namespace std; #include "angelscript.h" #pragma comment(lib, "angelscript.lib") struct : public asIOutputStream { void Write(const char* text) { cout << text; } } asOutput; struct CTestObj { CTestObj& operator[](string s); }; string asStringFactory(asUINT length, const char *text); void asStringConstructor(string* pthis); void asStringDestructor(string* pthis); string& asStringAssignString(string &cp, string *pthis); bool GetScript(char* filename, char* &code, unsigned int& size); void main(void) { int rc; char* code; char* szTestFile; unsigned int size; asIScriptEngine* engine; szTestFile = ""; if (!GetScript(szTestFile, code, size)) return; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); engine->SetCommonMessageStream(&asOutput); rc = engine->RegisterObjectType("string", sizeof(string), asOBJ_CLASS_CDA); assert(rc >= 0); rc = engine->RegisterStringFactory("string", asFUNCTION(asStringFactory), asCALL_CDECL); assert(rc >= 0); rc = engine->RegisterObjectBehaviour("string", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(asStringConstructor), asCALL_CDECL_OBJLAST); assert(rc >= 0); rc = engine->RegisterObjectBehaviour("string", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(asStringDestructor), asCALL_CDECL_OBJLAST); assert(rc >= 0); rc = engine->RegisterObjectBehaviour("string", asBEHAVE_ASSIGNMENT, "string& f(string &in)", asFUNCTION(asStringAssignString), asCALL_CDECL_OBJLAST); assert(rc >= 0); rc = engine->RegisterObjectType("CTestObj", sizeof(CTestObj), asOBJ_CLASS); assert(rc >= 0); rc = engine->RegisterObjectBehaviour("CTestObj", asBEHAVE_INDEX, "CTestObj& f(string)", asMETHOD(CTestObj, operator[]), asCALL_THISCALL); assert(rc >= 0); engine->AddScriptSection(0, szTestFile, code, size); engine->Build(0); engine->ExecuteString(0, "main()"); engine->Release(); } string asStringFactory(asUINT length, const char *text) { cout << __FUNCTION__ << " length=" << length << " text='" << text << "'\n"; return string(text); } void asStringConstructor(string* pthis) { cout << __FUNCTION__ << " pthis=" << (int)pthis << endl; new(pthis)string(); } void asStringDestructor(string* pthis) { cout << __FUNCTION__ << " pthis=" << (int)pthis << endl; pthis->~string(); } string& asStringAssignString(string &cp, string *pthis) { cout << __FUNCTION__ << " cp=" << cp << " pthis=" << (int)pthis << endl; return *pthis = cp; } bool GetScript(char* filename, char* &code, unsigned int& size) { DWORD dummy; HANDLE hFile = CreateFile( filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile != INVALID_HANDLE_VALUE) { size = GetFileSize(hFile, 0); code = new char[size + 1]; ReadFile(hFile, code, size, &dummy, NULL); CloseHandle(hFile); cout << "Script '" << filename << "' is " << size << " bytes\n"; } else cout << "Script '" << filename << "' does not exist\n"; return hFile != INVALID_HANDLE_VALUE; } CTestObj& CTestObj::operator[](string s) { cout << __FUNCTION__ << " s='" << s << "'\n"; return *this; } // void main() { CTestObj obj; obj["test"]; } Is anyone else successfully using strings as index parameters? -D