Commit Graph

43 Commits

Author SHA1 Message Date
Robert Osfield
38bb71460a Replaced deprecated Geometry::set*Binding() 2013-06-27 08:30:51 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
31aa1cdfee Fixed Coverity reported issues.
CID 11389: Resource leak in object (CTOR_DTOR_LEAK)
Allocating memory by calling "new bsp::VBSPData".
Assigning: "this->bsp_data" = "new bsp::VBSPData".
The constructor allocates field "bsp_data" of "struct bsp::VBSPReader" but the destructor and whatever functions it calls do not free it.
2011-05-06 09:20:06 +00:00
Robert Osfield
b24353b12c From Rafa Gaitan and Jorge Izquierdo, build support for Android NDK.
"- In order to build against GLES1 we execute:
$ mkdir build_android_gles1
$ cd build_android_gles1
$ cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF
-DDYNAMIC_OPENSCENEGRAPH=OFF -DANDROID_NDK=<path_to_android_ndk>/
-DOSG_GLES1_AVAILABLE=ON -DOSG_GL1_AVAILABLE=OFF
-DOSG_GL2_AVAILABLE=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DJ=2
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF
$ make
 If all is correct you will have and static OSG inside:
build_android_gles1/bin/ndk/local/armeabi.

- GLES2 is not tested/proved, but I think it could be possible build
it with the correct cmake flags.
- The flag -DJ=2 is used to pass to the ndk-build the number of
processors to speed up the building.
- make install is not yet supported."
2011-03-08 16:35:37 +00:00
Robert Osfield
438c8e7dc4 Converted osg::notify to OSG_INFO etc. 2010-05-28 16:30:58 +00:00
Robert Osfield
4e8f0561ad From Farshid Lashkari, "I modified some plugins to use the osgDB file stream functions in order to support UTF-8 encoded filenames." 2010-05-13 11:01:06 +00:00
Robert Osfield
d17d7159a1 Ported osgUtil, osgDB, osgGA, NodeKits and plugins to compile against OpenGL ES 1.1 and OpenGL ES 2.0. 2009-10-28 20:31:57 +00:00
Robert Osfield
9f454c1714 From Colin McDonald, "The bsp & mdl plugins have calls to atof() without including the
associated <stdlib.h> header.  This breaks the build on my Solaris setup.

Rather than adding the missing <stdlib.h> include, I have changed the
atof() calls to osg::asciiToDouble().  This is the same as was done
throughout the other plugins recently, for locale independance.

I've attached updates to the svn trunk, the fix is also appropriate for
the 2.8.* branch."
2009-08-20 14:59:29 +00:00
Robert Osfield
6af1859bc4 From Jason Daly, "This set of changes reworks the BSP plugin to use TexEnvCombine instead of a GLSL program for doing the texture blending on displaced terrain geometry. After working with it a while, I found this method to be more scene graph friendly (at least until Wojtek gets his VirtualProgram scheme working ;-) )
Note that this technique will require ARB_texture_env_crossbar (or NV_texture_env_combine4), as it mixes two textures in the first texture unit, and just does the lighting in the second.  I doubt this will be a problem for any card that can already handle GLSL programs, though."
2009-07-24 15:09:37 +00:00
Robert Osfield
c2c5a82b92 Fixed build. 2009-07-16 11:35:59 +00:00
Robert Osfield
9eb03d450d From Jason Daly, "These are some fixes to the mdl and bsp plugins to handle transparency and lighting better, plus a few other tweaks." 2009-07-16 11:21:02 +00:00
Robert Osfield
06abd75198 From Mathias Froehlich, "We are currently getting issues with locale settings and some osg plugins.
Therefore I have changed all the occurances of atof by asciiToFloat or
asciiToDouble.

I believe that it is safe to do so at least for all the plugins.
Included here are also asciiToFloat conversion of environment variables. One
might argue that these should be locale dependent. But IMO these should be
set and interpreted by osg independent of the current locale.
"
2009-06-25 16:07:49 +00:00
Robert Osfield
d62c34efe8 From Jason Daly, "Somehow, one of the shaders in the bsp plugin started behaving incorrectly between the original submission and now. I suspect it has to do with a typo in the setup of the shader that was fixed at some point, or it happened during the recent warnings purge. In any case, I had to invert the usage of a parameter in the shader to make it behave properly again.
The vtf plugin wasn't working in Windows due to OS differences in the byte-packing of the header structure (on Windows, the big block read was causing a buffer overrun).  I fixed this by reading the structure from the file field by field.  It's now happy on both Linux and Windows."
2009-01-29 11:18:03 +00:00
Robert Osfield
065b1d4978 Fixed warnings 2009-01-28 12:28:04 +00:00
Robert Osfield
7b598c5701 Warning fixes for VS, and removal of associated warning disables 2009-01-23 15:12:26 +00:00
Robert Osfield
908432c732 Replaced readImageFile() usage with readRefImageFile() to prevent threading issues with caching of imagery in the osgDB::Registry cache. 2009-01-21 18:23:55 +00:00
Robert Osfield
9b4c6e25ea Fix of warning reported on CDash 2009-01-09 15:11:15 +00:00
Robert Osfield
fa499dc55f From Andy Skinner, fixes for Solaris build 2009-01-09 12:17:40 +00:00
Robert Osfield
1697eb526d Fixed warnings 2008-12-24 10:30:21 +00:00
Robert Osfield
f0270f934e Changed the scale from 0.03 to 0.0254 as the Q3 bsp files are in inches. 2008-12-20 20:30:08 +00:00
Robert Osfield
28ca8277f8 From Jason Daly, "'ve been busy working on the Source engine plugins. There are several contributions in this submission:
osgDB/FileUtils.cpp:
Needed this extra code to allow a true case-insensitive search.  This is because the HL2 map and model files are often sloppy with case.  For example, the file might look for materials/models/alyx/alyx_sheet.vtf, but the file is actually in materials/Models/Alyx/alyx_sheet.vtf.  In case-insensitive mode, the new code recursively disassembles the path and checks each path element without regard to case.  In case-sensitive mode, the code behaves exactly as it used to.  The new code is also mostly skipped on Windows because of the case-insensitive file system.  Previously, I did all of this with custom search code in the .bsp plugin, but this allows the user to tailor the search using OSGFILEPATH.  There are some instructions in the plugins' README files about this.

osgPlugins/mdl:
This is a new plug-in for Half-Life 2 models (as opposed to maps).  This allows you to load Source models individually, as well as allowing the .bsp plugin to load models (props) that are embedded into maps.  Mdl files can contain simple object (crates, barrels, bottles), as well as fully articulated characters with skeletal animations.  Currently, it can load the simple objects.  It can also load the characters, but it can't load the skeletons or animations.

osgPlugins/bsp:
This contains all of the changes needed to load props along with the basic map geometry.  There are also
several bugs fixed.

osgPlugins/vtf:
This is the loader for Valve's texture format.  Previously, we had agreed to put this in with the bsp plugin, but I didn't think of the .mdl plugin at that time.  It's conceivable that a user might want to load models individually (not as part of a map), so the vtf reader does have to be separate.  I also fixed a rather significant bug.

I tested all of this code on RHEL 5.2 (32-bit), and Fedora 9 (64-bit).  I'll be testing on Windows soon.

I also attached a simple .mdl file, along with it's associated files and textures.  Just extract the tarball into it's own directory, set your OSGFILEPATH to point at that directory, and load the model like this:

 osgviewer models/props_junk/gascan001a.mdl"
2008-12-20 13:35:49 +00:00
Robert Osfield
6055dee411 Fixed warnings 2008-12-18 15:49:44 +00:00
Robert Osfield
e754fc5aab From Sekender, fixed warnins 2008-12-17 10:34:09 +00:00
Robert Osfield
315aeeb557 Where possible moved redundent C header includes from headers to source files 2008-12-12 18:47:30 +00:00
Robert Osfield
25eff6e27c From Jason Daly, added support for reading Valve's texture format files 2008-12-04 10:27:29 +00:00
Robert Osfield
cf440dfec3 Changed unsigned long to unsigned int to avoid 64bit portability issue. 2008-11-27 14:05:30 +00:00
Robert Osfield
b7882c57f8 Fixed warning and some unitialized variables. 2008-11-25 12:22:33 +00:00
Robert Osfield
bf8c3cc07e From Jason Daly, "This is a plugin (two, actually) that will allow OSG to load .bsp map files from Valve's Source Engine games (Half-Life 2, etc.). One plugin (called "vbsp" to distinguish it from the Quake 3 bsp loader) reads the .bsp file itself, and the other ("vtf") reads the texture files.
The set up for this to work is a bit more complex than most files, since the engine expects all files to be in a certain place, and it tends to mix case a lot.  I tried to explain everything in the VBSP_README.txt file."

This plugin has been integrated with the pre-exisiting bsp plugin.
2008-11-24 11:39:02 +00:00
Robert Osfield
38f7fabb10 Renamig of files in prep of merge of valve bsp support 2008-11-24 10:28:19 +00:00
Robert Osfield
02b456bcfa Converted plugins to use the new supportsExtension()/supportsOptions/supportsProtocl() methods
to help enable better querying of supported features
2008-07-13 22:18:59 +00:00
Robert Osfield
9e2fe92ef1 From Rudolf Wiedemann, "I need to link OpenSceneGraph statically to my application, so I
completed the new registration of the plugin-readerwriters
("REGISTER_OSGPLUGIN") according to your osgstaticviewer-example (see
attachment, based on today's svn)."
2007-07-06 13:54:26 +00:00
Robert Osfield
2e6ee4bb39 Removed old gmake and VisualStudio build files 2007-04-10 13:10:25 +00:00
Robert Osfield
462803fd57 From Paul Martz, speeling fixes for Tessellator/Tessellation. 2007-01-08 21:29:49 +00:00
Robert Osfield
553d017fd9 From Daniel Trstenjak, build fixes for Hpux 11.11, Irix 6.5, Solaris 8 and Aix 2006-08-02 10:43:26 +00:00
Robert Osfield
6665e2a38a Tweaked for loop variaible definition. 2006-07-06 14:43:30 +00:00
Robert Osfield
9ae10af995 Fixed warnings 2006-07-05 09:52:03 +00:00
Robert Osfield
0170689c9d Warning fix. 2006-07-04 10:55:58 +00:00
Robert Osfield
70391108fd Fixed orientation and lighting of model. 2006-07-03 16:21:57 +00:00
Robert Osfield
e0258f23b3 Changed unsinged int to GLuint for OSX compile fix. 2006-06-29 08:08:39 +00:00
Robert Osfield
17e51e73c4 Changed unsigned int to GLuint for OSX build. 2006-06-28 20:38:32 +00:00
Robert Osfield
4dff461b1c Change internal variables across to being GLuint. 2006-06-28 14:36:28 +00:00
Robert Osfield
a39516c297 Changed GLunit usage to unsigned int. 2006-06-26 10:57:17 +00:00
Robert Osfield
f104656d9f From Carlos García and Paul Baker, Port of Paul Baker's Quake3 BSP loader to OSG by Carlos García.
Added Quake3 BSP plugin.
2006-05-15 09:46:54 +00:00