|
From: <mk...@us...> - 2003-04-18 11:10:11
|
Update of /cvsroot/csp/THIRDPARTYLIBS/demeter
In directory sc8-pr-cvs1:/tmp/cvs-serv28584
Modified Files:
CHANGES CHANGES.current Terrain.cpp Terrain.h aclocal.m4
configure
Log Message:
see CHANGES.current
Index: CHANGES
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/CHANGES,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CHANGES 15 Mar 2003 02:27:15 -0000 1.1
--- CHANGES 18 Apr 2003 11:10:00 -0000 1.2
***************
*** 2,5 ****
--- 2,18 ----
to CVS.
+ Version 0.3.1 (2003-04-18)
+ ===========================
+
+ 2003-04-06: delta
+ Committed .net project
+
+ 2003-03-14: onsight
+ First log entry: this is the format.
+
+ 2003-03-15: onsight
+ Changed configure.in to require autoconf 2.57
+
+
Version 0.3.0 (2003-03-14)
===========================
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/CHANGES.current,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CHANGES.current 6 Apr 2003 10:39:18 -0000 1.3
--- CHANGES.current 18 Apr 2003 11:10:00 -0000 1.4
***************
*** 1,12 ****
! Version 0.3.1 (in progress)
===========================
! 2003-04-06: delta
! Committed .net project
!
! 2003-03-14: onsight
! First log entry: this is the format.
! 2003-03-15: onsight
! Changed configure.in to require autoconf 2.57
--- 1,19 ----
! Version 0.3.2 (in progress)
===========================
! 2003-04-18: onsight
! Changed Terrain and TerrainLattice to inherit from
! osg::Referenced instead of just implementing compatible
! reference counting methods.
! Added DETAIL_TEXTURE_SIZE #define so that larger detail
! textures can be used. The original value was 256, but
! 512 works fine and so should larger sizes (although I
! haven't tested these). Ideally the size would be
! determined at runtime from the actual texture image, but
! this was the simplest approach for now. Note that
! Demeter will crash if the texture size exceeds the value
! of DETAIL_TEXTURE_SIZE. Textures that are smaller than
! DETAIL_TEXTURE_SIZE do not seem to cause a problem. The
! default setting is now 512.
Index: Terrain.cpp
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/Terrain.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Terrain.cpp 6 Apr 2003 10:39:18 -0000 1.4
--- Terrain.cpp 18 Apr 2003 11:10:00 -0000 1.5
***************
*** 31,34 ****
--- 31,36 ----
#include "assert.h"
+ #define DETAIL_TEXTURE_SIZE 512
+
#ifdef _WIN32
#include "io.h"
***************
*** 641,645 ****
Terrain::Terrain(int widthVertices,int heightVertices,float vertexSpacing,int maxNumTriangles,bool bUseBorders)
{
- m_refCount = 0;
m_pCommonTexture = NULL;
m_pTriangleStrips = NULL;
--- 643,646 ----
***************
*** 671,675 ****
Terrain::Terrain(const float* pElevations,int elevWidth,int elevHeight,const Uint8* pTextureImage,int textureWidth,int textureHeight,const Uint8* pDetailTextureImage,int detailWidth,int detailHeight,float vertexSpacing,float elevationScale,int maxNumTriangles,bool bUseBorders,float offsetX,float offsetY,int numTexturesX,int numTexturesY)
{
- m_refCount = 0;
m_pCommonTexture = NULL;
m_pTriangleStrips = NULL;
--- 672,675 ----
***************
*** 696,700 ****
Terrain::Terrain(const char* szElevationsFilename,const char* szTextureFilename,const char* szDetailTextureFilename,float vertexSpacing,float elevationScale,int maxNumTriangles,bool bUseBorders,float offsetX,float offsetY,int numTexturesX,int numTexturesY)
{
- m_refCount = 0;
m_pCommonTexture = NULL;
m_pTriangleStrips = NULL;
--- 696,699 ----
***************
*** 1022,1025 ****
--- 1021,1026 ----
vertexX = indexX * m_VertexSpacing;
vertexY = indexY * m_VertexSpacing;
+ #define NOSLOWNORMAL
+ #ifdef SLOWNORMAL
/*
// This average over 8 nearby normals is extremely slow compared
***************
*** 1035,1038 ****
--- 1036,1040 ----
// operates on vertices near the edges of the terrain tiles.
// -MR
+ */
Vector avgNormal;
avgNormal.x = avgNormal.y = avgNormal.z = 0.0f;
***************
*** 1055,1059 ****
m_pNormals[i].y = avgNormal.y / 8.0f;
m_pNormals[i].z = avgNormal.z / 8.0f;
! */
float nx, ny, nz;
GetNormal(vertexX+0.2,vertexY+0.8,nx,ny,nz);
--- 1057,1061 ----
m_pNormals[i].y = avgNormal.y / 8.0f;
m_pNormals[i].z = avgNormal.z / 8.0f;
! #else
float nx, ny, nz;
GetNormal(vertexX+0.2,vertexY+0.8,nx,ny,nz);
***************
*** 1061,1064 ****
--- 1063,1067 ----
m_pNormals[i].y = ny;
m_pNormals[i].z = nz;
+ #endif
}
}
***************
*** 3128,3131 ****
--- 3131,3135 ----
TerrainLattice::~TerrainLattice()
{
+ cout << "~TerrainLattice()\n";
if (Settings::GetInstance()->IsVerbose())
{
***************
*** 3803,3811 ****
if (pTexture)
{
! Uint8* pBuffer = new Uint8[256*256*4];
! memset(pBuffer,255,256*256*4);
! for (int i = 3; i < 256*256*4; i += 4)
pBuffer[i] = 0;
! Texture* pMask = new Texture(pBuffer,256,256,256,0,true,false,true);
delete[] pBuffer;
DetailTexture* pDetail = new DetailTexture;
--- 3807,3816 ----
if (pTexture)
{
! int bytes = DETAIL_TEXTURE_SIZE*DETAIL_TEXTURE_SIZE*4;
! Uint8* pBuffer = new Uint8[bytes];
! memset(pBuffer,255,bytes);
! for (int i = 3; i < bytes; i += 4)
pBuffer[i] = 0;
! Texture* pMask = new Texture(pBuffer,DETAIL_TEXTURE_SIZE,DETAIL_TEXTURE_SIZE,DETAIL_TEXTURE_SIZE,0,true,false,true);
delete[] pBuffer;
DetailTexture* pDetail = new DetailTexture;
Index: Terrain.h
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/Terrain.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Terrain.h 10 Apr 2003 01:32:17 -0000 1.5
--- Terrain.h 18 Apr 2003 11:10:01 -0000 1.6
***************
*** 70,73 ****
--- 70,75 ----
#include <vector>
+ #include <osg/Referenced>
+
//#include "mmgr.h"
***************
*** 274,278 ****
/// This class represents a single, contiguous chunk of terrain and is the primary public interface to Demeter. Most applications will create a single instance of this class to represent the terrain in the application, but multiple instances can be used to stitch together a very large world comprised of multiple terrains using the TerrainLattice class.
! class TERRAIN_API Terrain
{
public:
--- 276,280 ----
/// This class represents a single, contiguous chunk of terrain and is the primary public interface to Demeter. Most applications will create a single instance of this class to represent the terrain in the application, but multiple instances can be used to stitch together a very large world comprised of multiple terrains using the TerrainLattice class.
! class TERRAIN_API Terrain: public osg::Referenced
{
public:
***************
*** 371,382 ****
void SetTextureCell(int index,TextureCell* pCell);
enum DIRECTION {DIR_NORTH = 0,DIR_NORTHEAST = 1,DIR_EAST = 2,DIR_SOUTHEAST = 3,DIR_SOUTH = 4,DIR_SOUTHWEST = 5,DIR_WEST = 6,DIR_NORTHWEST = 7,DIR_CENTER = 8,DIR_INVALID = 9};
- /// Increment the reference count by one, indicating that this object has another pointer which is referencing it.
int GetTerrainPolygonsRendered();
- inline void ref() const { ++m_refCount; }
- /// Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
- inline void unref() const { --m_refCount; if (m_refCount<=0) delete this; }
private:
void Init(const Uint8* pTextureImage,int textureWidth,int textureHeight,const Uint8* pDetailTextureImage,int detailWidth,int detailHeight,bool bUseBorders,float offsetX = 0.0f,float offsetY = 0.0f,int numTexturesX = 0,int numTexturesY = 0);
--- 373,380 ----
***************
*** 422,426 ****
float* m_pTextureDetail;
Vector* m_pNormals;
- mutable int m_refCount;
#ifdef _WIN32
static vector<HGLRC> m_SharedContexts;
--- 420,423 ----
***************
*** 636,640 ****
};
! class TERRAIN_API TerrainLattice
{
public:
--- 633,637 ----
};
! class TERRAIN_API TerrainLattice: public osg::Referenced
{
public:
***************
*** 662,670 ****
- /// Increment the reference count by one, indicating that this object has another pointer which is referencing it.
- inline void ref() const { ++m_refCount; }
- /// Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
- inline void unref() const { /*assert(m_refCount > 0);*/ if (m_refCount > 0) {--m_refCount; if (m_refCount==0 && this) delete this;} }
-
private:
vector<TerrainLoadListener*> m_TerrainLoadListeners;
--- 659,662 ----
***************
*** 693,697 ****
int m_FactoryTilesHeight;
float m_fThreshold;
- mutable int m_refCount;
};
--- 685,688 ----
Index: aclocal.m4
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/aclocal.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** aclocal.m4 9 Dec 2002 01:33:51 -0000 1.2
--- aclocal.m4 18 Apr 2003 11:10:01 -0000 1.3
***************
*** 1,13 ****
! dnl aclocal.m4 generated automatically by aclocal 1.4
! dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
! dnl This file is free software; the Free Software Foundation
! dnl gives unlimited permission to copy and/or distribute it,
! dnl with or without modifications, as long as this notice is preserved.
! dnl This program is distributed in the hope that it will be useful,
! dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
! dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
! dnl PARTICULAR PURPOSE.
--- 1,14 ----
! # generated automatically by aclocal 1.7.2 -*- Autoconf -*-
! # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
! # Free Software Foundation, Inc.
! # This file is free software; the Free Software Foundation
! # gives unlimited permission to copy and/or distribute it,
! # with or without modifications, as long as this notice is preserved.
! # This program is distributed in the hope that it will be useful,
! # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
! # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
! # PARTICULAR PURPOSE.
Index: configure
===================================================================
RCS file: /cvsroot/csp/THIRDPARTYLIBS/demeter/configure,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** configure 9 Dec 2002 01:33:51 -0000 1.2
--- configure 18 Apr 2003 11:10:02 -0000 1.3
***************
*** 1,5 ****
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
! # Generated by GNU Autoconf 2.54 for CSP-demeter 0.1.
#
# Report bugs to <http://csp.sourceforge.net>.
--- 1,5 ----
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
! # Generated by GNU Autoconf 2.57 for CSP-demeter 0.1.
#
[...1496 lines suppressed...]
{ echo "$as_me:$LINENO: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
***************
*** 4553,4558 ****
if test "$no_create" != yes; then
ac_cs_success=:
exec 5>/dev/null
! $SHELL $CONFIG_STATUS || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
--- 4801,4809 ----
if test "$no_create" != yes; then
ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
! $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
|