Commit Graph

63 Commits

Author SHA1 Message Date
Scott Giese
69e20a3931 Bug Fix #1922 Wrong retun type 2018-09-29 18:41:00 -05:00
James Turner
48b7b70e23 BinObj code uses wide-strings on Windows. 2017-02-07 16:05:06 +00:00
James Turner
f21eac8473 Building with clean SGPath API 2016-06-30 16:17:52 +01:00
James Turner
bd896096cc Changing SGPath APIs, using SGPath in more places.
Change most places we control (i.e not helper libs) to use SGPath
to represent a path, instead of using std::string. Extend SGPath
API to explicitly expose the path in either UTF-8 or the
system 8-bit encoding.
2016-06-22 17:15:32 +01:00
Peter Sadrozinski
beeaef3868 - fix for index overrun when building TexturedTriangleArray
- fix for ws2.0 zero area triangles - drop them when loading
2014-12-26 13:07:33 -05:00
Peter Sadrozinski
19481983e5 fix windows build 2014-04-06 12:14:44 -04:00
Peter Sadrozinski
5b2b420c48 - secondary tc and vertex attribs in .btg file
- decrease debug when writing btg files
- deprecate some set_xxx apis
2014-04-05 21:48:38 +02:00
James Turner
8b0c246a7b Avoid a divide-by-zero on malformed BTG files.
Encountered while testing v850 airports; some airports
generate materials with no tris, and hence no indices.
This causes a divide-by-zero when computing the index stride.

Detect this, and convert the BTG reader to throw exceptions
in error conditions, and to catch this and report the
appropriate result code.
2013-10-17 20:13:50 +01:00
Tom Paoletti
15e3e92ec2 Performance optimization: empty() instead of size()>0
empty() is guaranteed to be constant complexity for both vectors and lists, while size() has linear complexity for lists.
2013-08-16 16:48:35 +01:00
James Turner
851a307c23 Test for, and fix, materials handling in BTG code.
It's possible (and happens!) to have less than 2^16 vertices or tex-coords, but more than 2^15 objects (tris) with the same materials. This was breaking our version 7 vs version 10 detection logic. Pete found the issue, I'm simply committing a version of his fix.
2012-11-07 21:10:00 +00:00
James Turner
f7a87789ab Improve decode_bin output slightly. 2012-09-30 16:44:22 +01:00
ThorstenB
49a23fdc2e Fix final simgear GCC warnings. 2012-01-09 21:51:09 +01:00
ThorstenB
dd45be518f Improve error messages, report file name. 2011-11-17 21:26:02 +01:00
James Turner
bc9b3f6ff1 Unit test for SGBinObj, and fix a bug in large-indice handling the test revealed. 2011-10-14 21:57:34 +01:00
James Turner
e4e31be7d4 Fix BTG writer for non-included index arrays. 2011-10-12 17:01:52 +01:00
James Turner
d9a281c493 Support for 32-bit vertex indices in BTG files 2011-10-06 21:28:55 +01:00
James Turner
2a2e2716bd Removal of PLIB/SG from SimGear 2010-08-07 13:55:33 +01:00
James Turner
aa859c488f Remove deprecated vector classes - finally! 2010-07-30 00:46:30 +01:00
ehofman
426f6de16f final fixes for SG_USING_STD removal 2008-07-29 08:25:17 +00:00
ehofman
733e6fa14f Reduce compiler.h to almost nothing (but it's worth keeping around I think, for
the MSVC and MipsPro warning stuff).

As a result of this patch, simgear/sg_traits.h can be deleted. So can SGCMath.h,
but I'll do that separately.

There is one more 'mechanical' change to come - getting rid of SG_USING_STD(X),
but I want to keep that separate from everything else. (There's another mechnica
l change, replacing <math.h> with <cmath> and so on *everywhere*, but one step a
t a time)
2008-07-25 18:35:40 +00:00
timoore
d219c5c4c6 Don't include <iostream> and "using" declarations in header files
<iostream> sucks in expensive initialization of the standard streams
and isn't appropriate in a header file. Use <istream> and <ostream>
instead.

using declarations should never appear at global scope in a header
file; source files get to decide what they want to use in their
namespace.
2008-06-02 20:21:27 +00:00
curt
7ed51be4e6 In the original flightgear native/binary scenery terrain data format, we
used short's extensively to represent counts of objects (number of points,
number of texture coordinates, number of traingle strips, etc.) and we used
shorts to index into larger structures.  But this capped many of our structure
sizes to a maximum of 32768.

By switching to unsigned shorts in the future, we can double the maximum
object/index counts without losing anything.  This was a pretty major
oversight in our original specification.

I have bumped up the native object file version from 6 to 7 and added code
in the reader to maintain full backwards compatibilty with version 6
scenery files (i.e. the current 0.9.10 scenery release.)

Curt.
2007-11-05 21:42:29 +00:00
frohlich
560c100484 Modified Files:
simgear/bucket/newbucket.cxx simgear/bucket/newbucket.hxx
	simgear/io/decode_binobj.cxx simgear/io/sg_binobj.cxx
	simgear/io/sg_binobj.hxx simgear/math/SGVec2.hxx
	simgear/math/SGVec3.hxx simgear/math/SGVec4.hxx
	simgear/scene/material/mat.hxx
	simgear/scene/material/matlib.cxx
	simgear/scene/material/matlib.hxx
	simgear/scene/model/Makefile.am simgear/scene/tgdb/Makefile.am
	simgear/scene/tgdb/obj.cxx simgear/scene/tgdb/obj.hxx
	simgear/scene/tgdb/pt_lights.cxx
	simgear/scene/tgdb/pt_lights.hxx
	simgear/scene/util/Makefile.am
	simgear/scene/util/SGNodeMasks.hxx
	simgear/scene/util/SGTextureStateAttributeVisitor.cxx
Added Files:
	simgear/scene/model/SGOffsetTransform.cxx
	simgear/scene/model/SGOffsetTransform.hxx
	simgear/scene/tgdb/SGDirectionalLightBin.hxx
	simgear/scene/tgdb/SGLightBin.hxx
	simgear/scene/tgdb/SGOceanTile.cxx
	simgear/scene/tgdb/SGOceanTile.hxx
	simgear/scene/tgdb/SGTexturedTriangleBin.hxx
	simgear/scene/tgdb/SGTriangleBin.hxx
	simgear/scene/tgdb/SGVasiDrawable.cxx
	simgear/scene/tgdb/SGVasiDrawable.hxx
	simgear/scene/tgdb/SGVertexArrayBin.hxx
	simgear/scene/util/SGEnlargeBoundingBox.cxx
	simgear/scene/util/SGEnlargeBoundingBox.hxx
	simgear/scene/util/SGSceneFeatures.cxx
	simgear/scene/util/SGSceneFeatures.hxx
Removed Files:
	simgear/scene/tgdb/leaf.hxx simgear/scene/tgdb/vasi.hxx:
	Reorganize tile loaders.
	Build bigger leafs for the tiles.
	Move runway light colors into materials.xml.
	Split out classes that might be useful at other places.
	Avoid static storage on binobject loading.
2007-05-28 05:00:28 +00:00
mfranz
95532cb318 fix error message 2007-02-05 21:41:40 +00:00
mfranz
2cccc26541 --warnings 2006-03-14 15:49:29 +00:00
mfranz
dcb95d131b - new FSF addresses
- coplied license headers from h(xx) files to respective c(xx) files
- removed trailing spaces
- fixe $Id$
- fixed typos
2006-03-08 18:16:08 +00:00
ehofman
b2a4cd488d Back out the previous patch. 2006-02-21 10:47:20 +00:00
ehofman
4e7fe460a5 Melchior FRANZ:
- new FSF address
- removed a few hundred trailing spaces
- fixed a few $Id$ lines
- copied two license headers from *.hxx files to their respective
  *.cxx counterparts
- added two test aps to .cvsignore
- don't unlock an already unlocked mutex (Someone wanted to be on
  the safe side with this, but the result is undefined and makes
  pthread_mutex_destroy fail. Reference: manpage for
  pthread_mutexattr_gettype/The Open Group[1]: "Attempting to
  unlock a mutex of this type which is not locked results in
  undefined behaviour.")
- re-enabled all subsystem destructors again (this has been disabled
  because fgfs hung on exit, due to the mutex destroy failure)
2006-02-21 09:40:12 +00:00
curt
0154f81e33 Clean up some compiler warnings. 2006-02-17 15:13:42 +00:00
fredb
795c079af0 Use the new SGPath::create_dir function
Ensure no triangles array could have more than 32767 vertices, a PLIB limit.
2006-01-07 13:21:36 +00:00
ehofman
99bc4e9a87 Vassilii Khachaturov:
clean up some build warnings caught with gcc-4.0.
2005-12-19 12:52:02 +00:00
curt
2c14f8587e Use an unsigned vs. signed short to double our element capacity for higher
resolution scenery.
2005-10-12 16:43:26 +00:00
ehofman
ac9716f193 Cygwin fixes(?), it's a good idea to do it this way anyhow. 2005-10-01 11:41:59 +00:00
ehofman
b1b6abf285 Use inttypes.h specified types. This is the standard and fixes some 64-bit problems. 2005-09-15 17:06:31 +00:00
curt
7fc8c02688 My old email address is no longer valid ... point to my web page. 2004-11-19 21:44:16 +00:00
curt
129e3c6326 Tweaks in preparation for the 0.3.6-pre1 release. 2004-07-14 22:01:15 +00:00
david
7379d8a54d Patches from Erik Hofman (for Irix? I've lost the original message). 2003-03-02 14:52:05 +00:00
david
78411d29a7 Patch from Erik Hofman:
This patch adds some more functionality to the header files and removes
*all* dependencies on SG_HAVE_NATIVE_SGI_COMPILERS in the SimGear code!

[dpm: I had to add some additional SG_USING_STD declarations to make
it compile]
2002-12-31 14:47:34 +00:00
curt
d1c8f60ca9 #include <simgear_config.h> as necessary. 2002-12-03 13:13:16 +00:00
curt
b75a694682 Bernie Bright:
Here are some changes that gave me a significant frame rate increase of about 10 fps with random objects disabled.  The interesting thing is that these changes aren't in the main loop but are in tile loader.  My guess is that I've reduced the memory footprint just enough to reduce CPU cache misses, though I have no hard evidence of this.

Initially I modified all SGBinObject member functions to pass/return by reference instead of by-value.  This gives little or no speed up but allows for some optimizations in fgBinObjLoad().  It is these changes that reduce the number of memory allocations.  Needless copying of vectors, and vectors of vectors, can be very memory intensive, especially if they are large.

Anyway I would be interested to see if you get similar results.  I would emphasize that the frame rate increase only occurs with random objects disabled.  I lose about 10-15 fps on my GF2MX 32MB with random objects, probably a fill-rate limitation or texture memory thing.
2002-08-23 17:52:10 +00:00
curt
f85a9866fe Remove efence support in favor of valgrind. 2002-07-30 14:10:08 +00:00
curt
033c66363d Fixes for IA-64 with Intel compiler. 2002-07-02 18:44:20 +00:00
curt
f645596606 Fixed an 'elstupido' bug.
Cleaned out some old #ifdef'd out code.
2002-03-13 05:01:51 +00:00
curt
7fa5dd7a35 Added a warning message if the file is not found. 2002-03-11 21:47:09 +00:00
curt
a3186af099 Additions to the binary file format to make it *much* more flexible.
For each major primative type: points, triangles, fans, and strips, you
can specify an index list of vertices, normals, colors, and texture
coordinates.  You can skip any of these you like to save on space.

Note that the work for this has only been done in the file format reader
and writer.  The FlightGear loader for instance still needs to have
support for this built in.

This is is one more small step towards runway lighting.
2002-03-10 22:49:01 +00:00
curt
520124c1be Add initial support for per vertex or per object colors. 2002-02-26 20:05:20 +00:00
curt
e251bfcbaf Extended .btg format to support a 'points' primitive. 2002-02-26 19:47:06 +00:00
curt
7a65a990ba Decouple sg_time code from the current time(NULL), i.e. you can run the
time calculations for an alternate calendar time (i.e. if the application
is being driven from an external source of data.)

Fix a bug in sg_binobj.cxx which disrupted the 'broken down time' globally
for the entire application.
2002-02-11 22:27:27 +00:00
curt
eca2afb982 Various changes for MingWin32 support. 2001-08-02 22:56:33 +00:00
curt
e2b4c0787a Attempt to resolve ambiguity between #include <config.h> for simgear vs.
flightgear, especially when this occurs in a simgear .hxx file.  This is
now expressly forbidden, and will cause problems anyways because we now
changed the name to <simgear_config.h> which isn't installed, so you can't
include it in an installed header file.
2001-05-15 19:26:22 +00:00