From: <re...@us...> - 2006-11-28 23:57:21
|
Revision: 25996 http://svn.sourceforge.net/crystal/?rev=25996&view=rev Author: res2002 Date: 2006-11-28 15:57:18 -0800 (Tue, 28 Nov 2006) Log Message: ----------- res merged r25992 into 1.0 (VC warning fixes). Modified Paths: -------------- CS/branches/release/V1.0/docs/history.txt CS/branches/release/V1.0/docs/history10.txt CS/branches/release/V1.0/include/csutil/nobjvec.h CS/branches/release/V1.0/include/csutil/scf_impl.h CS/branches/release/V1.0/include/iengine/collectn.h CS/branches/release/V1.0/include/iengine/engine.h CS/branches/release/V1.0/include/iengine/region.h CS/branches/release/V1.0/plugins/engine/3d/cscoll.h CS/branches/release/V1.0/plugins/engine/3d/engine.cpp CS/branches/release/V1.0/plugins/engine/3d/engine.h CS/branches/release/V1.0/plugins/engine/3d/meshgen.cpp CS/branches/release/V1.0/plugins/engine/3d/meshobj.cpp CS/branches/release/V1.0/plugins/engine/3d/region.cpp CS/branches/release/V1.0/plugins/engine/3d/region.h Modified: CS/branches/release/V1.0/docs/history.txt =================================================================== --- CS/branches/release/V1.0/docs/history.txt 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/docs/history.txt 2006-11-28 23:57:18 UTC (rev 25996) @@ -19,6 +19,8 @@ license and allows commercial usage. This is done with permission from Anders Wisur. - res updated the docs for the new winlibs version. + - res fixed a couple of VC deprecation warnings (collection and scene + node array related). 27-Nov-2006 - Jorrit fixed a bug in the terrain engine. It would incorrectly try to get the size from the alphamaps by using 'alphamap ' Modified: CS/branches/release/V1.0/docs/history10.txt =================================================================== --- CS/branches/release/V1.0/docs/history10.txt 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/docs/history10.txt 2006-11-28 23:57:18 UTC (rev 25996) @@ -12,6 +12,7 @@ - Jorrit merged r25965 into 1.0 (collider actor bugfix). - Jorrit merged r25974 into 1.0 (flarge collection removal). - res merged r25990 into 1.0 (new winlibs). + - res merged r25992 into 1.0 (VC warning fixes). 27-Nov-2006 - Jorrit merged r25937 into 1.0 (viewmesh/cegui fix). - Jorrit merged r25944 into 1.0 (terrain alphamap fix). Modified: CS/branches/release/V1.0/include/csutil/nobjvec.h =================================================================== --- CS/branches/release/V1.0/include/csutil/nobjvec.h 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/include/csutil/nobjvec.h 2006-11-28 23:57:18 UTC (rev 25996) @@ -34,6 +34,13 @@ * Named Object Vector class */ +/* Workaround for deprecation warnings caused by types used as the template + * parameter */ +#include "csutil/win32/msvc_deprecated_warn_off.h" + +/**\addtogroup util_containers + * @{ */ + /** * This class implements a typed array that correctly keeps track * of reference count and also is able to find by name. Assumes @@ -72,5 +79,8 @@ } }; +/** @} */ +#include "csutil/win32/msvc_deprecated_warn_on.h" + #endif // __CS_NOBJVEC_H__ Modified: CS/branches/release/V1.0/include/csutil/scf_impl.h =================================================================== --- CS/branches/release/V1.0/include/csutil/scf_impl.h 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/include/csutil/scf_impl.h 2006-11-28 23:57:18 UTC (rev 25996) @@ -118,6 +118,13 @@ #define SCF_IMPL_CAT_I(a, b) SCF_IMPL_CAT_II(a ## b) #define SCF_IMPL_CAT_II(res) res +/* The deprecation turn-off may seem odd here - but MSVC emits + * deprecation warnings when using the destructor of a deprecated + * class. Since interfaces may be deprecated this may cause + * deprecation warnings emitted in ~SCF_IMPL_NAME, which is kinda silly. + */ +#include "csutil/win32/msvc_deprecated_warn_off.h" + template<class Class SCF_IMPL_TYPES> class CS_CRYSTALSPACE_EXPORT SCF_IMPL_NAME : public SCF_IMPL_SUPER @@ -343,6 +350,8 @@ } }; +#include "csutil/win32/msvc_deprecated_warn_on.h" + #undef SCF_IMPL_NAME #undef SCF_IMPL_SUPER #undef SCF_IMPL_PRE_TYPES Modified: CS/branches/release/V1.0/include/iengine/collectn.h =================================================================== --- CS/branches/release/V1.0/include/iengine/collectn.h 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/include/iengine/collectn.h 2006-11-28 23:57:18 UTC (rev 25996) @@ -68,6 +68,8 @@ virtual iObject* GetObject (int i) const = 0; }; +#include "csutil/win32/msvc_deprecated_warn_off.h" + /** * iCollection list. * @@ -78,7 +80,8 @@ * - Engine stores them. * - Application uses them. */ -struct iCollectionList : public virtual iBase +struct CS_DEPRECATED_TYPE_MSG ("Collections are obsolete. Don't use then") + iCollectionList : public virtual iBase { SCF_INTERFACE(iCollectionList,2,0,0); /// Create a new collection. @@ -109,5 +112,7 @@ virtual iCollection *FindByName (const char *Name) const = 0; }; +#include "csutil/win32/msvc_deprecated_warn_on.h" + #endif // __CS_IENGINE_COLLECTN_H__ Modified: CS/branches/release/V1.0/include/iengine/engine.h =================================================================== --- CS/branches/release/V1.0/include/iengine/engine.h 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/include/iengine/engine.h 2006-11-28 23:57:18 UTC (rev 25996) @@ -1261,6 +1261,7 @@ /// Get the list of all shared variables. virtual iSharedVariableList* GetVariableList () const = 0; +#include "csutil/win32/msvc_deprecated_warn_off.h" /** * Get the list of collections. * \deprecated Collections are obsolete. @@ -1284,6 +1285,7 @@ CS_DEPRECATED_METHOD_MSG("Collections are obsolete") virtual iCollection* FindCollection (const char* name, iRegion* region = 0) = 0; +#include "csutil/win32/msvc_deprecated_warn_on.h" /** * Convenience function to 'remove' a CS object from the engine. Modified: CS/branches/release/V1.0/include/iengine/region.h =================================================================== --- CS/branches/release/V1.0/include/iengine/region.h 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/include/iengine/region.h 2006-11-28 23:57:18 UTC (rev 25996) @@ -38,7 +38,6 @@ struct iSector; struct iTextureWrapper; - /** * A region. A region is basically a collection of objects in the * 3D engine that can be treated as a unit. @@ -106,8 +105,10 @@ virtual iMaterialWrapper *FindMaterial (const char *iName) = 0; /// Find a camera position in this region by name virtual iCameraPosition *FindCameraPosition (const char *iName) = 0; +#include "csutil/win32/msvc_deprecated_warn_off.h" /// Find a collection in this region by name virtual iCollection *FindCollection (const char *iName) = 0; +#include "csutil/win32/msvc_deprecated_warn_on.h" /** * Check if some object is in this region. Modified: CS/branches/release/V1.0/plugins/engine/3d/cscoll.h =================================================================== --- CS/branches/release/V1.0/plugins/engine/3d/cscoll.h 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/plugins/engine/3d/cscoll.h 2006-11-28 23:57:18 UTC (rev 25996) @@ -30,6 +30,8 @@ class csEngine; class csSector; +#include "csutil/win32/msvc_deprecated_warn_off.h" + /** * A collection object is for convenience of the script language. * It simply groups objects which are related in some way. @@ -85,4 +87,6 @@ csCollectionList* collections; }; +#include "csutil/win32/msvc_deprecated_warn_on.h" + #endif // __CS_CSCOLL_H__ Modified: CS/branches/release/V1.0/plugins/engine/3d/engine.cpp =================================================================== --- CS/branches/release/V1.0/plugins/engine/3d/engine.cpp 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/plugins/engine/3d/engine.cpp 2006-11-28 23:57:18 UTC (rev 25996) @@ -244,6 +244,9 @@ } //--------------------------------------------------------------------------- + +#include "csutil/win32/msvc_deprecated_warn_off.h" + csCollectionList::csCollectionList () : scfImplementationType (this) { @@ -303,6 +306,8 @@ return collections.FindByName (Name); } +#include "csutil/win32/msvc_deprecated_warn_on.h" + //--------------------------------------------------------------------------- void csEngineMeshList::FreeMesh (iMeshWrapper* mesh) @@ -909,9 +914,8 @@ { SetClearZBuf (defaultClearZBuf); SetClearScreen (defaultClearScreen); - csRef<iThingEnvironment> te (SCF_QUERY_INTERFACE ( - GetThingType (), - iThingEnvironment)); + csRef<iThingEnvironment> te (scfQueryInterface<iThingEnvironment> ( + GetThingType ())); te->SetLightmapCellSize (16); SetMaxLightmapSize (defaultMaxLightmapWidth, defaultMaxLightmapHeight); SetAmbientLight (csColor ( @@ -1073,12 +1077,12 @@ { meshes.Add (mesh); // @@@ Consider no longer putting child meshes on main engine list??? - const csRefArray<iSceneNode>& children = mesh->QuerySceneNode () - ->GetChildren (); + const csRef<iSceneNodeArray> children = mesh->QuerySceneNode () + ->GetChildrenArray (); size_t i; - for (i = 0 ; i < children.Length () ; i++) + for (i = 0 ; i < children->GetSize() ; i++) { - iMeshWrapper* mesh = children[i]->QueryMesh (); + iMeshWrapper* mesh = children->Get (i)->QueryMesh (); if (mesh) AddMeshAndChildren (mesh); } @@ -1371,11 +1375,12 @@ if (s->GetMeshObject ()) s->GetMeshObject ()->GetRenderMeshes (num, rview, s->GetMovable (), 0xf); - const csRefArray<iSceneNode>& children = s->QuerySceneNode ()->GetChildren (); + const csRef<iSceneNodeArray> children = s->QuerySceneNode () + ->GetChildrenArray (); size_t i; - for (i = 0 ; i < children.Length () ; i++) + for (i = 0 ; i < children->GetSize () ; i++) { - iMeshWrapper* mesh = children[i]->QueryMesh (); + iMeshWrapper* mesh = children->Get (i)->QueryMesh (); if (mesh) PrecacheMesh (mesh, rview); } @@ -1809,6 +1814,8 @@ return campos; } +#include "csutil/win32/msvc_deprecated_warn_off.h" + iCollection* csEngine::FindCollection (const char* name, iRegion* reg) { @@ -1827,6 +1834,8 @@ return col; } +#include "csutil/win32/msvc_deprecated_warn_on.h" + void csEngine::ReadConfig (iConfigFile *Config) { defaultMaxLightmapWidth = @@ -3137,13 +3146,13 @@ csRef<iPortalContainer> pc; if (name) { - const csRefArray<iSceneNode>& children = parentMesh->QuerySceneNode ()-> - GetChildren (); + const csRef<iSceneNodeArray> children = mesh->QuerySceneNode () + ->GetChildrenArray (); size_t i; - for (i = 0 ; i < children.Length () ; i++) + for (i = 0 ; i < children->GetSize(); i++) { // @@@ Not efficient. - iMeshWrapper* mesh = children[i]->QueryMesh (); + iMeshWrapper* mesh = children->Get (i)->QueryMesh (); if (mesh) { if (!strcmp (name, mesh->QueryObject ()->GetName ())) Modified: CS/branches/release/V1.0/plugins/engine/3d/engine.h =================================================================== --- CS/branches/release/V1.0/plugins/engine/3d/engine.h 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/plugins/engine/3d/engine.h 2006-11-28 23:57:18 UTC (rev 25996) @@ -125,6 +125,8 @@ iLight* FetchNext (); }; +#include "csutil/win32/msvc_deprecated_warn_off.h" + /** * List of collections for the engine. This class implements iCollectionList. */ @@ -151,6 +153,8 @@ csRefArrayObject<iCollection> collections; }; +#include "csutil/win32/msvc_deprecated_warn_on.h" + struct csSectorPos { iSector* sector; @@ -202,6 +206,8 @@ }; +#include "csutil/win32/msvc_deprecated_warn_off.h" + /** * The 3D engine. * This class manages all components which comprise a 3D world including @@ -989,4 +995,6 @@ csRef<iEventHandler> weakEventHandler; }; +#include "csutil/win32/msvc_deprecated_warn_on.h" + #endif // __CS_ENGINE_H__ Modified: CS/branches/release/V1.0/plugins/engine/3d/meshgen.cpp =================================================================== --- CS/branches/release/V1.0/plugins/engine/3d/meshgen.cpp 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/plugins/engine/3d/meshgen.cpp 2006-11-28 23:57:18 UTC (rev 25996) @@ -745,10 +745,10 @@ if (!mesh) return; mesh->GetMeshObject ()->SetMixMode (mode); iSceneNode* sn = mesh->QuerySceneNode (); - const csRefArray<iSceneNode>& children = sn->GetChildren (); + const csRef<iSceneNodeArray> children = sn->GetChildrenArray (); size_t i; - for (i = 0 ; i < children.Length () ; i++) - SetFade (children[i]->QueryMesh (), mode); + for (i = 0 ; i < children->GetSize(); i++) + SetFade (children->Get (i)->QueryMesh (), mode); } void csMeshGenerator::SetFade (csMGPosition& p, float factor) Modified: CS/branches/release/V1.0/plugins/engine/3d/meshobj.cpp =================================================================== --- CS/branches/release/V1.0/plugins/engine/3d/meshobj.cpp 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/plugins/engine/3d/meshobj.cpp 2006-11-28 23:57:18 UTC (rev 25996) @@ -62,12 +62,12 @@ virtual void AppendShadows (iMovable* movable, iShadowBlockList* shadows, const csVector3& origin) { - const csRefArray<iSceneNode>& c = static_lod_mesh->QuerySceneNode () - ->GetChildren (); - size_t i = c.Length (); + const csRef<iSceneNodeArray> c = static_lod_mesh->QuerySceneNode () + ->GetChildrenArray (); + size_t i = c->GetSize (); while (i-- > 0) { - iMeshWrapper* child = c[i]->QueryMesh (); + iMeshWrapper* child = c->Get (i)->QueryMesh (); if (child && child->GetShadowCaster ()) { child->GetShadowCaster ()->AppendShadows (movable, shadows, origin); @@ -99,13 +99,13 @@ virtual void CastShadows (iMovable* movable, iFrustumView* fview) { - const csRefArray<iSceneNode>& c = static_lod_mesh->QuerySceneNode () - ->GetChildren (); - size_t cnt = c.Length (); + const csRef<iSceneNodeArray> c = static_lod_mesh->QuerySceneNode () + ->GetChildrenArray (); + size_t cnt = c->GetSize (); size_t i; for (i = 0 ; i < cnt ; i++) { - iMeshWrapper* child = c[i]->QueryMesh (); + iMeshWrapper* child = c->Get (i)->QueryMesh (); if (child && child->GetShadowReceiver ()) child->GetShadowReceiver ()->CastShadows (movable, fview); } Modified: CS/branches/release/V1.0/plugins/engine/3d/region.cpp =================================================================== --- CS/branches/release/V1.0/plugins/engine/3d/region.cpp 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/plugins/engine/3d/region.cpp 2006-11-28 23:57:18 UTC (rev 25996) @@ -121,9 +121,8 @@ iter = GetIterator (); while (iter->HasNext ()) { - csRef<iTextureWrapper> csth (SCF_QUERY_INTERFACE ( - iter->Next (), - iTextureWrapper)); + csRef<iTextureWrapper> csth (scfQueryInterface<iTextureWrapper> ( + iter->Next ())); if (csth) { if (!csth->GetTextureHandle ()) csth->Register (txtmgr); @@ -218,6 +217,8 @@ return cp; // DecRef is ok here. } +#include "csutil/win32/msvc_deprecated_warn_off.h" + iCollection *csRegion::FindCollection (const char *iName) { csRef<iCollection> col (CS_GET_NAMED_CHILD_OBJECT ( @@ -225,6 +226,8 @@ return col; // DecRef is ok here. } +#include "csutil/win32/msvc_deprecated_warn_on.h" + bool csRegion::IsInRegion (iObject *iobj) { return iobj->GetObjectParent () == this; Modified: CS/branches/release/V1.0/plugins/engine/3d/region.h =================================================================== --- CS/branches/release/V1.0/plugins/engine/3d/region.h 2006-11-28 23:46:56 UTC (rev 25995) +++ CS/branches/release/V1.0/plugins/engine/3d/region.h 2006-11-28 23:57:18 UTC (rev 25996) @@ -115,10 +115,10 @@ virtual iMaterialWrapper *FindMaterial (const char *iName); /// Find a camera position in this region by name virtual iCameraPosition *FindCameraPosition (const char *iName); +#include "csutil/win32/msvc_deprecated_warn_off.h" /// Find a collection in this region by name virtual iCollection *FindCollection (const char *iName); - - +#include "csutil/win32/msvc_deprecated_warn_on.h" }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |