Commit Graph

60 Commits (14af83a3912c2c1d35faf06d82880f1d15f93f25)

Author SHA1 Message Date
Hleb Valoshka 14af83a391 Implement Logger to replace raw cerr/cout and DPRINTF usage 2021-12-20 17:54:50 +03:00
Andrew Tribick 7c5c903f47 Remove pointers from mesh and model vectors
- Hold models in unique_ptr
2021-12-04 09:49:52 +01:00
Andrew Tribick 8684543580 Store vertex data as array of 4-byte words 2021-12-04 09:49:52 +01:00
Andrew Tribick 019411dc21 Remove pointers from VertexDescription and PrimitiveGroup indices 2021-12-04 09:49:52 +01:00
Andrew Tribick b79959979a Extract inner types from Material and Mesh
- Remove using namspace cmod
- Convert enums to enum classes
2021-12-04 09:49:52 +01:00
Andrew Tribick 474057221b Refactor 3DS loading to avoid excessive use of unique_ptr 2021-12-04 09:49:52 +01:00
Andrew Tribick 79234cda24 Remove inheritance from Material maps, Model destructor
- Reference texture maps by ResourceHandles in cmod Materials
- Add basic path manager for integration tests and tools
- Remove virtual destructor on Model class as nothing inherits from it
2021-11-25 19:11:06 +01:00
Andrew Tribick f79b21e7d3 Use existing tokenizer to parse ASCII cmod files 2021-11-15 18:28:06 +01:00
Andrew Tribick 5e141eef21 Refactor random number and Perlin noise 2021-11-14 19:42:39 +01:00
Andrew Tribick 61850bfb9b Use unique_ptr to indicate ownership in cel3ds 2021-11-05 19:53:05 +01:00
Andrew Tribick ef10800e7c Clean up headers/using namespace in cel3ds 2021-11-05 19:53:05 +01:00
Andrew Tribick ec232b7fad Fix for debug builds
- Include fmt/ostream.h in debug.h to allow formatting filesystem paths
- Avoid including headers via debug.h on non-debug builds
2021-10-26 10:17:48 +03:00
Hleb Valoshka ccd01c460f Fix fs::path printing using fmt 2021-10-23 12:15:01 +03:00
Hleb Valoshka 42790d9013 Replace deprecated fmt::fprintf calls 2021-10-19 19:35:23 +03:00
Joseph C Wang 05cb7196b5 make it compile with fmt v8 2021-06-27 20:52:35 +03:00
Hleb Valoshka fb4bede3d1 Allow building without NLS 2020-02-15 00:20:13 +03:00
Hleb Valoshka 4a38917e08 Split parser.* into hash.*, value.* and parser.* 2020-02-07 23:15:43 +03:00
Li Linfeng 9c371c891c define macros for print levels and avoid direct use of fmt::printf 2019-08-31 13:32:44 +08:00
Hleb Valoshka b6b543438d Port to filesystem API 2019-08-16 18:11:24 +03:00
Hleb Valoshka 4d5f2d9c64 Convert raw pointers to std::unique_ptr in ModelGeometry 2019-08-16 09:49:01 +03:00
Hleb Valoshka 1fda8e35f0 Fix warnings found by PVS
- 1 copy-paste error
  - 1 nullptr dereference
  - fixed self-assignment in Mesh::VertexDescription::operator=
  - a few missing delete
  - all other are checks for nullptr after new
2018-10-28 22:00:27 +03:00
Hleb Valoshka 363abc40f3 Use libfmt instead of C-style & iostream workflow
TODO: check StarDatabase::getStarName
2018-10-17 22:19:03 +03:00
Hleb Valoshka b3efd50661 Make cmod::Model destructor virtual (Closes: #8)
+tiny warning fixes
2018-10-13 23:05:32 +03:00
Hleb Valoshka 73638c116d Remove basictypes.h and use standard c++11 types 2018-09-22 23:42:03 +03:00
Hleb Valoshka b082d5f47f Automatically convert to c++11 using clan-tidy
+ manual cleanups
2018-09-22 23:42:02 +03:00
Hleb Valoshka 882e4ecf28 fix whitespaces and indents
trailing spaces are removed
tabs are replaced with 4 spaces

# Conflicts:
#	src/celengine/cmdparser.cpp
#	src/celengine/command.cpp
#	src/celestia/celestiacore.cpp
#	src/celestia/celestiacore.h
#	src/celestia/qt/qtappwin.cpp
#	src/celestia/qt/qtglwidget.cpp
#	src/celestia/win32/winmain.cpp
2018-09-22 23:41:57 +03:00
Chris Laurel ad6bd44172 Removed obsolete files vertexlist.h and vertexlist.cpp. Removed them from Qt4,
automake, and MSVC project files.
2010-02-12 20:20:06 +00:00
Chris Laurel c0b425c143 Fixed MeshManager to handle missing or corrupt model files gracefully. Solves crash with Selden's Hale add-on. 2010-02-06 02:27:36 +00:00
Chris Laurel 31a31d4e2f - Moved cmod code into a separate module celmodel.
- Updated cmodtools to use celmodel.
- Improved 3ds file loader to support multiple materials per mesh.
2010-02-05 20:05:18 +00:00
Chris Laurel c26ea667f2 Eigenized old sphere mesh code (used only for handling .cms mesh files now.) 2009-07-23 23:19:26 +00:00
Chris Laurel c4aa846945 Eigenized 3ds and cmod mesh code. 2009-07-23 02:58:10 +00:00
Chris Laurel b0903fae0b - Made Celestia more permissive when loading 3ds files. Some conversion tools create 3ds files with more texture coordinates that there are vertices. Such files are valid but Celestia was rejecting them. Applied the same change to the Celestia 3ds loader and the 3dstocmod tool.
- Fixed a for variable scoping error in cmodfix.cpp. The code had assumed old style for scope.
2009-02-10 01:45:05 +00:00
Chris Laurel 7c4330ac3f - Fixed scaling bug for cms meshes--they were always being treated as
unnormalized.
- Removed some leftover UNNORMALIZED_MESH #ifdefs that are no longer needed.
2008-10-23 05:10:46 +00:00
Chris Laurel 58a634722c Implemented NormalizeMesh property for solar system bodies. This property makes it easier to build assemblies from several bodies with mesh geometry. 2008-09-22 21:03:43 +00:00
Chris Laurel 9915c4cb39 Committing experimental code for particle systems; disabled until after 1.6.0. 2008-08-29 21:29:59 +00:00
Chris Laurel 41efec9e08 - Added abstract class Geometry; this will permit geometry other than
static models to be used for objects.
- Replace body, star, and DSO instances of Model with Geometry
- Renamed ModelManager to GeometryManager
- Fixed a GeometryManager bug that was triggered by multiple uses of a mesh
  file with different MeshCenters.
2008-07-23 21:54:53 +00:00
Christophe Teyssier ea2b8a899f Added translations of some console messages. 2007-09-30 20:28:11 +00:00
Chris Laurel 8404db405a Set model opacity flag at load time. This is used to do more intelligent depth sorting of translucent models. 2007-03-04 23:41:30 +00:00
Chris Laurel 7b1ad5f8d8 Improved load time mesh conditioning:
- Remove duplicate materials
- Sort submeshes by material to cut down graphics state change overhead
- Slightly improve the reliabliity of opacity sorting
- Print mesh vertex, primitive, and material statistics to log
2006-12-03 09:07:23 +00:00
Toti 2a36ada0ae Removed unused parameters 2006-09-16 14:32:08 +00:00
Chris Laurel 8283e04e95 Fixed the broken calculation of specular exponent when converting materials from 3DS files. 2006-07-10 07:03:16 +00:00
Christophe Teyssier 2318e423a3 Adding support for i18n with gettext. 2005-07-19 21:31:04 +00:00
Chris Laurel 61d076046c - Fixed typo in glcontext.cpp that caused compile errors
- Fixed pow calls for building with free MS C++ compiler
2004-10-26 09:12:00 +00:00
Chris Laurel cac5ae1020 Roughly sort the submeshes of model by opacity after loading. This fixes some of the problems with translucent triangles completely blocking geometry behind them. 2004-07-12 03:06:47 +00:00
Chris Laurel 8dad02c746 More fixes and improvements for meshes:
- Implemented more general textures (diffuse, specular, emissive, and normal maps supported)
- Fixed texture loading for binary CMOD files
- Corrected a nasty memory allocation error
2004-07-08 11:12:10 +00:00
Chris Laurel f6e194afb3 Open all cmod files as binary streams. This is harmless for ASCII and prevents corruption of binary cmods in Windows. Yet another hour wasted chasing a bug related to Windows' braindamaged newline convention. 2004-07-08 07:10:40 +00:00
Chris Laurel e539502cfb Changed base of material indices in models from one to zero for consistency with everything else. 2004-02-18 08:17:23 +00:00
Chris Laurel 286d0cc517 Fix .cms file loading. The cms meshes are now just converted to the standard Celestia model class upon loading. 2004-02-18 05:58:56 +00:00
Chris Laurel df98cc39cd Improved mesh support:
- Use more efficient and flexible internal representation
- Added code to convert 3DS meshes to new structure
- Support new Celestia mesh format (ASCII-only right now)
2004-02-17 09:58:52 +00:00
Chris Laurel 4be844c692 Log mesh loading failures. 2003-09-21 00:11:37 +00:00