For your consideration,

Attached are a bunch of patches for the code changes I made to get 0.24
built and running with MSVC. I didn't include any of my changes to the
vcproj/sln's -- just the codebase itself -- as those were a bit more on the
hacky side. Some of these I think represent actual bugs, so I've marked them
with **BUG**; others are portability issues that I've marked with **PORT**.
Ones I've marked with **FIX** I think are solid fixes that I would suggest
merging into the codebase, whereas others marked as **HACK** are hacky
solutions that probably need a cleaner solution contrived for them. Unmarked
ones you can take or leave, I guess....

I've tested building and running wxterangreal and omnivos in both MSVC and
MinGW on windows with these fixes, using the demo project and also
connecting to the world at interreality.org, and they seem to work across
the board. Be aware, however, that I've only tested in debug mode -- no
release builds yet.

The only thing I haven't really tracked down is that avatar movement seems a
bit "jerky" in the MSVC build. If I get more time I might look into it...

Without further ado:

vos:
  apps/omnivos/plugins/demoplugin.cc
   - HAVE_UNISTD_H wrapper **PORT**
   - for new_DoorBehavior and new_ChatBotBehavior **BUG?**
     - in case misc:clickable metaobject hasn't been added yet, add it.
     - this one is strange... it seems that on my computer, the XOD loader
       doesn't add metaobjects to the class in the order specified in the
       file, but rather in alphabetical order. So the demo: objects get
       processed before the misc: objects, but unfortunately the demo
       objects assume that misc:clickable exists, which caused crashing
       for me. My solution was -- if it didn't exist yet -- check if the
       object had the type, and if so, do an "addType" to get the
       metaobject initialized. I'm not sure if your design intends
       metaobjects to load in the order specified in the file, so I don't
       know if this is the right fix or not.
   - force port 80 on wikipedia.org **BUG** **HACK**
     - really the fix should be in the URL class, but I'm not sure
       how much else in the codebase depends upon its current
       behavior.

  apps/terangreal/ter_util.cc
   - Terangreal::drawTextTexture: arrow only has 3 vertices, not 4. **BUG**
**FIX**

  libs/vos/extensions/http/httpclient.cc
   - define winsock2.h first, so it can exclude winsock.h **PORT**
     - winsock.h gets included somewhere later in the header chain,
       but I didn't pin down where. Other options are to explicitly
       exclude winsock.h ourselves, or I think defining
       WIN32_LEAN_AND_MEAN works, but I didn't try it.
   - use closesocket() instead of close() on windows **PORT** **FIX**

  libs/vos/vos/vosapp.cc
   - HAVE_UNISTD_H wrapper **PORT**

  libs/vos/vutil/getaddrinfowrapper.cc
   - #if 0'd out the custom versions of getaddrinfo, freeaddrinfo and
getnameinfo **BUG** **HACK**
     - the custom code didn't work -- it crashed if hints was 0, and
       didn't do any "service" lookup
     - note! for windows 2000, this will build using the MS SDK, but
       not in MinGW!

  libs/vos/vutil/sleep.h
   - put parenthesis around macro parameter extraction. **BUG** **FIX**

  libs/vos/vutil/snprintf.hh
   - use _snprintf on win32 as well as mingw **PORT**
     - the custom snprintf had some bug in it that I didn't track down.


crystalspace:
  include/csutil/win32/csconfig.h
   - define CS_NO_NEW_OVERRIDE **HACK**
     - not sure what the best solution is. MSVC was just having
       a hell of a time handling the new override with our code. I
       think variables were getting created with the standard new
       and deleted with the CS override new, which is bad.

  plugins/video/canvas/wxgl/GLWXDriver2D.cpp
   - add SetFocus() to csGLCanvas::OnEnterWindow **BUG**
     - I'm not entirely happy with the default behavior to steal
       focus whenever the cursor floats over the render view
       (it can steal it from dialog boxes, etc) -- but apparently
       this is how things were originally. I'm not sure what you
       want to do with that code that broadcasts a focus event
       to crystalspace.


wxwidgets:
  include/wx/msw/setup.h
   - define wxUSE_GLCANVAS to 1 **PORT** **FIX**

  src/msw/main.cpp
   - change WXMAKINGDLL to WXMAKINGDLL_CORE **BUG** **FIX**

Enjoy!

-Ken

Attachment: demoplugin.patch
Description: Binary data

Attachment: ter_util.patch
Description: Binary data

Attachment: httpclient.patch
Description: Binary data

Attachment: vosapp.patch
Description: Binary data

Attachment: getaddrinfowrapper.patch
Description: Binary data

Attachment: sleep.patch
Description: Binary data

Attachment: snprintf.patch
Description: Binary data

Attachment: csconfig.patch
Description: Binary data

Attachment: GLWXDriver2D.patch
Description: Binary data

Attachment: setup.patch
Description: Binary data

Attachment: main.patch
Description: Binary data

_______________________________________________
vos-d mailing list
vos-d@interreality.org
http://www.interreality.org/cgi-bin/mailman/listinfo/vos-d

Reply via email to