You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(46) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(185) |
Feb
(242) |
Mar
(237) |
Apr
(180) |
May
(102) |
Jun
(278) |
Jul
(114) |
Aug
(92) |
Sep
(246) |
Oct
(212) |
Nov
(279) |
Dec
(99) |
| 2007 |
Jan
(130) |
Feb
(194) |
Mar
(22) |
Apr
(72) |
May
(40) |
Jun
(111) |
Jul
(114) |
Aug
(154) |
Sep
(114) |
Oct
(2) |
Nov
(1) |
Dec
(5) |
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(51) |
Nov
(34) |
Dec
(130) |
| 2009 |
Jan
(22) |
Feb
(20) |
Mar
(41) |
Apr
(45) |
May
(82) |
Jun
(96) |
Jul
(48) |
Aug
(90) |
Sep
(13) |
Oct
(49) |
Nov
(31) |
Dec
(21) |
| 2010 |
Jan
(25) |
Feb
(9) |
Mar
(7) |
Apr
(28) |
May
(27) |
Jun
(7) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(13) |
Dec
(2) |
| 2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Charles L. <cn...@us...> - 2009-02-13 03:56:58
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13225/src Modified Files: MercuryODE.cpp Log Message: new ODE, and all static ODEs are upgraded. Index: MercuryODE.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryODE.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** MercuryODE.cpp 12 Feb 2009 18:03:13 -0000 1.101 --- MercuryODE.cpp 13 Feb 2009 03:56:51 -0000 1.102 *************** *** 8,16 **** #include "MercuryPoly.h" ! #if defined( __APPLE__ ) || defined( MACOSX ) || ( defined( HAVE_ODE_STATIC ) && defined( CPU_X86_64 ) ) ! void dInitODE() { } ! #endif ! ! #if ( defined( HAVE_ODE_STATIC ) && !defined( CPU_X86_64 ) ) extern "C" { --- 8,12 ---- #include "MercuryPoly.h" ! #if ( defined( HAVE_ODE_STATIC ) ) extern "C" { |
|
From: Charles L. <cn...@us...> - 2009-02-12 18:03:20
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1150 Modified Files: MercuryODE.cpp Log Message: Add the ODE-specific stuff for i386, we do need the static library at the moment. I think we should upgrade to 0.11, since they fixed some of the more common problems Index: MercuryODE.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryODE.cpp,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** MercuryODE.cpp 8 Feb 2009 23:24:51 -0000 1.100 --- MercuryODE.cpp 12 Feb 2009 18:03:13 -0000 1.101 *************** *** 12,15 **** --- 12,22 ---- #endif + #if ( defined( HAVE_ODE_STATIC ) && !defined( CPU_X86_64 ) ) + extern "C" + { + void dInitODE(); + } + #endif + #if defined(WIN32) && !defined(__GNUC__) #pragma comment(lib, "ode.lib") |
|
From: Charles L. <cn...@us...> - 2009-02-08 23:24:55
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25031/src Modified Files: MercuryODE.cpp ScreenMapEditor.cpp Log Message: add support for primary worlds, to allow world aggregation Index: MercuryODE.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryODE.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** MercuryODE.cpp 8 Feb 2009 20:38:56 -0000 1.99 --- MercuryODE.cpp 8 Feb 2009 23:24:51 -0000 1.100 *************** *** 514,517 **** --- 514,522 ---- bool MercuryODEWorld::LoadFromINI( MercuryINI & pINI, const MString & sWorldName ) { + //First see if there are any fallbacks... + MString sPrimary = pINI.GetValueS( sWorldName, "Primary" ); + if( sPrimary.length() ) + LoadFromINI( pINI, sPrimary ); + //Set this the world's name SetName( sWorldName ); Index: ScreenMapEditor.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/ScreenMapEditor.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** ScreenMapEditor.cpp 29 Dec 2008 06:27:29 -0000 1.48 --- ScreenMapEditor.cpp 8 Feb 2009 23:24:51 -0000 1.49 *************** *** 377,380 **** --- 377,396 ---- } + MString sPrimary = m_iWorldFile.GetValueS( sWorldname, "Primary" ); + + if( sPrimary.length() ) + { + ClearOutArea(); + + for ( unsigned i = 0; i < (unsigned int)m_iWorldFile.GetValueI( sPrimary, "NumElements", 0 ); i++ ) + { + MakeWorldPiece( i, sPrimary ); + } + + m_vODEObjs.resize( 0 ); + m_vVisObjs.resize( 0 ); + + } + ClearOutArea(); for ( unsigned i = 0; i < (unsigned int)m_iTightFile.GetValueI( sWorldname, "NumElements", 0 ); i++ ) *************** *** 392,396 **** { MString sPieceName = ssprintf( "Piece%d", i+1 ); ! int iObjNum = GenerateObject( m_iTightFile.GetValueS( sWorldname, sPieceName ), iTempSelect ); if ( iTempSelect >= 0 ) iObjNum = iTempSelect; --- 408,412 ---- { MString sPieceName = ssprintf( "Piece%d", i+1 ); ! int iObjNum = GenerateObject( m_iWorldFile.GetValueS( sWorldname, sPieceName ), iTempSelect ); if ( iTempSelect >= 0 ) iObjNum = iTempSelect; *************** *** 398,407 **** MercuryObject * oVis = m_vVisObjs[iObjNum]; ! float fX = m_iTightFile.GetValueF( sWorldname, sPieceName+"X" ); ! float fY = m_iTightFile.GetValueF( sWorldname, sPieceName+"Y" ); ! float fZ = m_iTightFile.GetValueF( sWorldname, sPieceName+"Z" ); ! float fRX = m_iTightFile.GetValueF( sWorldname, sPieceName+"RotX" ); ! float fRY = m_iTightFile.GetValueF( sWorldname, sPieceName+"RotY" ); ! float fRZ = m_iTightFile.GetValueF( sWorldname, sPieceName+"RotZ" ); if ( oODE ) { --- 414,423 ---- MercuryObject * oVis = m_vVisObjs[iObjNum]; ! float fX = m_iWorldFile.GetValueF( sWorldname, sPieceName+"X" ); ! float fY = m_iWorldFile.GetValueF( sWorldname, sPieceName+"Y" ); ! float fZ = m_iWorldFile.GetValueF( sWorldname, sPieceName+"Z" ); ! float fRX = m_iWorldFile.GetValueF( sWorldname, sPieceName+"RotX" ); ! float fRY = m_iWorldFile.GetValueF( sWorldname, sPieceName+"RotY" ); ! float fRZ = m_iWorldFile.GetValueF( sWorldname, sPieceName+"RotZ" ); if ( oODE ) { *************** *** 463,466 **** --- 479,488 ---- unsigned int iPieces = m_iWorldFile.GetValueI( sObjectIn, "NumPieces", 0, true ); + if ( iPieces == 0 ) + { + NotifyMessage( ssprintf( "No pieces found for item of type '%s'.", sObjectIn.c_str() ) ); + return -1; + } + if ( iPieceToReplace != -1 ) { |
|
From: Charles L. <cn...@us...> - 2009-02-08 22:08:07
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21176 Modified Files: Win32Window.cpp Log Message: Fix windows compilation with new crash handler. Index: Win32Window.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/Win32Window.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Win32Window.cpp 21 Jan 2009 20:12:09 -0000 1.34 --- Win32Window.cpp 8 Feb 2009 22:08:01 -0000 1.35 *************** *** 4,7 **** --- 4,10 ---- #include "MercuryLog.h" #include "MercuryINI.h" + #include "crash/cnbacktrace.h" + #include "crash/cncrash.h" + #include "MercuryInputWin32.h" #include "MercuryDriverRegister.h" |
|
From: Charles L. <cn...@us...> - 2009-02-08 21:58:47
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20232/src Modified Files: CopperPrimitives.cpp CopperPrimitives.h Log Message: fix mercury with respect to use imges on buttons. Index: CopperPrimitives.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/CopperPrimitives.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CopperPrimitives.h 5 Nov 2006 06:21:47 -0000 1.9 --- CopperPrimitives.h 8 Feb 2009 21:58:40 -0000 1.10 *************** *** 45,49 **** virtual void Init( CopperWindow * pParent, const MString & sName ); virtual bool MouseEvent( const CopperMouseEvent & pMouseEvent ); ! virtual bool IsFocusable() { return true; } CLASS_RTTI( CopperButton, CopperWindow ); --- 45,49 ---- virtual void Init( CopperWindow * pParent, const MString & sName ); virtual bool MouseEvent( const CopperMouseEvent & pMouseEvent ); ! virtual void Update( const float fDtime ); virtual bool IsFocusable() { return true; } CLASS_RTTI( CopperButton, CopperWindow ); Index: CopperPrimitives.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/CopperPrimitives.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** CopperPrimitives.cpp 15 Apr 2007 00:50:40 -0000 1.21 --- CopperPrimitives.cpp 8 Feb 2009 21:58:40 -0000 1.22 *************** *** 94,97 **** --- 94,112 ---- } + void CopperButton::Update( const float fDtime ) + { + //No image loaded (hopefully yet) + if( m_fWidth == 1 ) + { + m_fWidth = float(m_pBGUp.GetWidth()); + m_fHeight = float(m_pBGUp.GetHeight()); + + MercuryPoint pTranslate( m_fWidth/2, m_fHeight/2, 0 ); + m_pBGDown.SetPosition( pTranslate ); + m_pBGUp.SetPosition( pTranslate ); + } + CopperCaption::Update( fDtime ); + } + bool CopperButton::MouseEvent( const CopperMouseEvent & pMouseEvent ) { |
|
From: Charles L. <cn...@us...> - 2009-02-08 20:39:00
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv7586/src Modified Files: MercuryODE.cpp Log Message: fix mistake with reading Index: MercuryODE.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryODE.cpp,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** MercuryODE.cpp 8 Feb 2009 20:32:00 -0000 1.98 --- MercuryODE.cpp 8 Feb 2009 20:38:56 -0000 1.99 *************** *** 534,542 **** MString sClass = "MercuryODEObjectLoadable"; ! if( sClass_General.size() ) sClass = sClass_Specific; if( sClass_General.size() ) ! sClass = sClass_Specific; if ( ToMakeODEs->find( sClass ) == ToMakeODEs->end() ) --- 534,544 ---- MString sClass = "MercuryODEObjectLoadable"; ! if( sClass_Specific.size() ) sClass = sClass_Specific; if( sClass_General.size() ) ! sClass = sClass_General; ! ! LOG.Log( ssprintf( "Loading class: %s for %s (%d/%d)", sClass.c_str(), sInName.c_str(), i+1, NumElements ) ); if ( ToMakeODEs->find( sClass ) == ToMakeODEs->end() ) |
|
From: Charles L. <cn...@us...> - 2009-02-08 20:32:09
|
Update of /cvsroot/hgengine/Mercury In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6470 Modified Files: base_set.sh Log Message: tweak ODE on x86_64 and in general to permit class-general settings for objects Index: base_set.sh =================================================================== RCS file: /cvsroot/hgengine/Mercury/base_set.sh,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** base_set.sh 1 Dec 2008 06:35:13 -0000 1.29 --- base_set.sh 8 Feb 2009 20:32:00 -0000 1.30 *************** *** 99,102 **** --- 99,103 ---- if test $OPT_ode = 1; then if test $OPT_ode_static = 1; then + DEFINES="$DEFINES HAVE_ODE_STATIC" if test $ISMAC = 1; then LD_BASE="$LD_BASE src/maclib/libode.a" *************** *** 112,115 **** --- 113,118 ---- fi NEED_H="$NEED_H ode/ode.h" + CC_BASE="$CC_BASE -Isrc" + DEFINES="$DEFINES HAVE_ODE" fi |
|
From: Charles L. <cn...@us...> - 2009-02-08 20:32:07
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6470/src Modified Files: MercuryODE.cpp Log Message: tweak ODE on x86_64 and in general to permit class-general settings for objects Index: MercuryODE.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryODE.cpp,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** MercuryODE.cpp 6 Dec 2008 02:48:33 -0000 1.97 --- MercuryODE.cpp 8 Feb 2009 20:32:00 -0000 1.98 *************** *** 8,12 **** #include "MercuryPoly.h" ! #if defined( __APPLE__ ) || defined( MACOSX ) void dInitODE() { } #endif --- 8,12 ---- #include "MercuryPoly.h" ! #if defined( __APPLE__ ) || defined( MACOSX ) || ( defined( HAVE_ODE_STATIC ) && defined( CPU_X86_64 ) ) void dInitODE() { } #endif *************** *** 530,534 **** MString sName = pINI.GetValueS( sWorldName, ssprintf( "Piece%dName", i+1 ), sInName ); ! MString sClass = pINI.GetValueS( sWorldName, ssprintf( "Piece%dClass", i+1 ), "MercuryODEObjectLoadable" ); if ( ToMakeODEs->find( sClass ) == ToMakeODEs->end() ) --- 530,542 ---- MString sName = pINI.GetValueS( sWorldName, ssprintf( "Piece%dName", i+1 ), sInName ); ! MString sClass_Specific = pINI.GetValueS( sWorldName, ssprintf( "Piece%dClass", i+1 ), "" ); ! MString sClass_General = pINI.GetValueS( sInName, "Class", "" ); ! MString sClass = "MercuryODEObjectLoadable"; ! ! if( sClass_General.size() ) ! sClass = sClass_Specific; ! ! if( sClass_General.size() ) ! sClass = sClass_Specific; if ( ToMakeODEs->find( sClass ) == ToMakeODEs->end() ) |
|
From: <cn...@us...> - 2009-01-22 16:29:03
|
Revision: 150
http://hgengine.svn.sourceforge.net/hgengine/?rev=150&view=rev
Author: cnlohr
Date: 2009-01-22 16:28:56 +0000 (Thu, 22 Jan 2009)
Log Message:
-----------
Cleanup non-sse code.
Modified Paths:
--------------
Mercury2/src/MercuryMath.cpp
Mercury2/src/MercuryMath.h
Mercury2/src/MercuryMatrix.cpp
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-01-22 16:27:44 UTC (rev 149)
+++ Mercury2/src/MercuryMath.cpp 2009-01-22 16:28:56 UTC (rev 150)
@@ -35,7 +35,7 @@
void ZeroFloatRow(FloatRow& r)
{
- Copy4f(&r, (FloatRow){ 0.0f, 0.0f, 0.0f, 0.0f });
+ Copy4f(&r, &gfrZero );
}
void Mul4f(const FloatRow* first, const FloatRow* second, FloatRow* out)
Modified: Mercury2/src/MercuryMath.h
===================================================================
--- Mercury2/src/MercuryMath.h 2009-01-22 16:27:44 UTC (rev 149)
+++ Mercury2/src/MercuryMath.h 2009-01-22 16:28:56 UTC (rev 150)
@@ -55,6 +55,8 @@
void VectorMultiply4f(const FloatRow* matrix, const FloatRow* p, FloatRow* out );
void TransposeMatrix( FloatRow* m );
+const FloatRow gfrZero = { 0.f, 0.f, 0.f, 0.f };
+
#endif
/*
Modified: Mercury2/src/MercuryMatrix.cpp
===================================================================
--- Mercury2/src/MercuryMatrix.cpp 2009-01-22 16:27:44 UTC (rev 149)
+++ Mercury2/src/MercuryMatrix.cpp 2009-01-22 16:28:56 UTC (rev 150)
@@ -33,10 +33,12 @@
void MercuryMatrix::Identity()
{
- Copy4f(&m_matrix[0], (void*)&((FloatRow){ 1.0f, 0.0f, 0.0f, 0.0f }));
- Copy4f(&m_matrix[1], (void*)&((FloatRow){ 0.0f, 1.0f, 0.0f, 0.0f }));
- Copy4f(&m_matrix[2], (void*)&((FloatRow){ 0.0f, 0.0f, 1.0f, 0.0f }));
- Copy4f(&m_matrix[3], (void*)&((FloatRow){ 0.0f, 0.0f, 0.0f, 1.0f }));
+ const static float Identity[16] = {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f };
+ Copy16f(&m_matrix[0], Identity );
/*
(*this)[0][0] = 1;
(*this)[0][1] = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-01-22 16:27:54
|
Revision: 149
http://hgengine.svn.sourceforge.net/hgengine/?rev=149&view=rev
Author: cnlohr
Date: 2009-01-22 16:27:44 +0000 (Thu, 22 Jan 2009)
Log Message:
-----------
We no longer need <sys/time.h> and since <sys/time.h> is not used on Windows, it would otherwise cause a compile error.
Modified Paths:
--------------
Mercury2/src/Mercury2.cpp
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-01-04 19:56:47 UTC (rev 148)
+++ Mercury2/src/Mercury2.cpp 2009-01-22 16:27:44 UTC (rev 149)
@@ -8,8 +8,6 @@
#include <RenderableNode.h>
-#include <sys/time.h>
-
#include <MercuryCrash.h>
#include <MercuryBacktrace.h>
#include <MercuryMessageManager.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Charles L. <cn...@us...> - 2009-01-21 20:12:16
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26159 Modified Files: HGLIB-VC2008.vcproj Win32Window.cpp Log Message: Fix Windows Library (Fix up crash stuff) Index: HGLIB-VC2008.vcproj =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/HGLIB-VC2008.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HGLIB-VC2008.vcproj 23 Oct 2008 05:37:26 -0000 1.2 --- HGLIB-VC2008.vcproj 21 Jan 2009 20:12:09 -0000 1.3 *************** *** 1995,2111 **** > <File ! RelativePath="Crash\archCrash.h" ! > ! </File> ! <File ! RelativePath="Crash\Windows\BACKUPCrash.h" ! > ! </File> ! <File ! RelativePath="Crash\Windows\Crash.cpp" ! > ! <FileConfiguration ! Name="Release|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Debug|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! </File> ! <File ! RelativePath="Crash\Windows\Crash.h" ! > ! </File> ! <File ! RelativePath="Crash\crashDefines.cpp" ! > ! <FileConfiguration ! Name="Release|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Debug|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! </File> ! <File ! RelativePath="Crash\crashDefines.h" ! > ! </File> ! <File ! RelativePath="Crash\Windows\RestartProgram.cpp" ! > ! <FileConfiguration ! Name="Release|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! <FileConfiguration ! Name="Debug|Win32" ! > ! <Tool ! Name="VCCLCompilerTool" ! AdditionalIncludeDirectories="" ! PreprocessorDefinitions="" ! /> ! </FileConfiguration> ! </File> ! <File ! RelativePath="Crash\Windows\RestartProgram.h" > </File> <File ! RelativePath="Crash\StdString.h" > </File> <File ! RelativePath="Crash\Windows\verstub.cpp" > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" - /> - </FileConfiguration> </File> <File ! RelativePath="Crash\Windows\WindowsResources.h" > </File> --- 1995,2011 ---- > <File ! RelativePath=".\Crash\cnbacktrace.c" > </File> <File ! RelativePath=".\Crash\cnbacktrace.h" > </File> <File ! RelativePath=".\Crash\cncrash.c" > </File> <File ! RelativePath=".\Crash\cncrash.h" > </File> Index: Win32Window.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/Win32Window.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Win32Window.cpp 5 Aug 2007 18:33:32 -0000 1.33 --- Win32Window.cpp 21 Jan 2009 20:12:09 -0000 1.34 *************** *** 4,8 **** #include "MercuryLog.h" #include "MercuryINI.h" - #include "crash/crashDefines.h" #include "MercuryInputWin32.h" #include "MercuryDriverRegister.h" --- 4,7 ---- |
|
From: <axl...@us...> - 2009-01-04 19:56:51
|
Revision: 148
http://hgengine.svn.sourceforge.net/hgengine/?rev=148&view=rev
Author: axlecrusher
Date: 2009-01-04 19:56:47 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
updates
Modified Paths:
--------------
Mercury2/adv_set.c
Mercury2/base_set.sh
Mercury2/mercury2.kdevelop
Modified: Mercury2/adv_set.c
===================================================================
--- Mercury2/adv_set.c 2009-01-04 19:10:52 UTC (rev 147)
+++ Mercury2/adv_set.c 2009-01-04 19:56:47 UTC (rev 148)
@@ -9,7 +9,7 @@
src/Texture.cpp src/RawImageData.cpp src/BMPLoader.cpp src/PNGLoader.cpp src/ImageLoader.cpp \
src/MercuryVBO.cpp src/MSemaphore.cpp src/UpdateThreader.cpp src/HGMDLMesh.cpp \
src/HGMDLModel.cpp src/MercuryString.cpp src/MercuryCrash.c src/MercuryBacktrace.c \
- src/MercuryFile.cpp"
+ src/MercuryFile.cpp src/MercuryTimer.cpp src/MercuryMessageManager.cpp"
SOURCES="$SOURCES src/MercuryFileDriverDirect.cpp src/MercuryFileDriverMem.cpp \
Modified: Mercury2/base_set.sh
===================================================================
--- Mercury2/base_set.sh 2009-01-04 19:10:52 UTC (rev 147)
+++ Mercury2/base_set.sh 2009-01-04 19:56:47 UTC (rev 148)
@@ -14,7 +14,7 @@
OPT_libxml=1
DEFINES="WAS_CONFIGURED USE_MSTRING"
-CC_BASE="-O2 -g0 -Wall"
+CC_BASE="-O2 -g0 -Wall -DUSE_SSE"
for i in $*; do
if test $i = "--help"; then
Modified: Mercury2/mercury2.kdevelop
===================================================================
--- Mercury2/mercury2.kdevelop 2009-01-04 19:10:52 UTC (rev 147)
+++ Mercury2/mercury2.kdevelop 2009-01-04 19:56:47 UTC (rev 148)
@@ -2,7 +2,7 @@
<kdevelop>
<general>
<author>Joshua Allen</author>
- <email/>
+ <email></email>
<version>2.0</version>
<projectmanagement>KDevAutoProject</projectmanagement>
<primarylanguage>C++</primarylanguage>
@@ -14,8 +14,8 @@
<projectname>Mercury2</projectname>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
- <description/>
- <defaultencoding/>
+ <description></description>
+ <defaultencoding></defaultencoding>
<versioncontrol/>
</general>
<kdevautoproject>
@@ -26,8 +26,8 @@
<run>
<mainprogram>/home/josh/Mercury2/debug/src/mercury2</mainprogram>
<terminal>false</terminal>
- <programargs/>
- <globaldebugarguments/>
+ <programargs></programargs>
+ <globaldebugarguments></globaldebugarguments>
<globalcwd>/home/josh/Mercury2</globalcwd>
<useglobalprogram>true</useglobalprogram>
<autocompile>false</autocompile>
@@ -41,17 +41,17 @@
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
- <cxxflags>-O2 -g0 -Wall</cxxflags>
+ <cxxflags>-O2 -g -Wall</cxxflags>
<envvars/>
- <configargs/>
- <topsourcedir/>
- <cppflags>-Isrc/ -I/usr/include/libxml2/ -DHGENGINE -DRUN_FROM_START_FOLDER</cppflags>
+ <configargs></configargs>
+ <topsourcedir></topsourcedir>
+ <cppflags>-Isrc/ -I/usr/include/libxml2/ -DHGENGINE -DRUN_FROM_START_FOLDER -DUSE_SSE</cppflags>
<ldflags>-lpthread -lX11 -lGL -lxml2 -lpng</ldflags>
- <ccompilerbinary/>
- <cxxcompilerbinary/>
- <f77compilerbinary/>
- <cflags/>
- <f77flags/>
+ <ccompilerbinary></ccompilerbinary>
+ <cxxcompilerbinary></cxxcompilerbinary>
+ <f77compilerbinary></f77compilerbinary>
+ <cflags>-O2 -g -Wall</cflags>
+ <f77flags></f77flags>
</optimized>
<debug>
<configargs>--enable-debug=full</configargs>
@@ -59,19 +59,33 @@
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevg77options</f77compiler>
- <cxxflags>-O0 -g3 -Wall</cxxflags>
+ <cxxflags>-O2 -g -Wall</cxxflags>
<envvars/>
+ <topsourcedir></topsourcedir>
+ <cppflags>-Isrc/ -I/usr/include/libxml2/ -DHGENGINE -DRUN_FROM_START_FOLDER -DUSE_SSE</cppflags>
+ <ldflags>-lpthread -lX11 -lGL -lxml2 -lpng</ldflags>
+ <ccompilerbinary></ccompilerbinary>
+ <cxxcompilerbinary></cxxcompilerbinary>
+ <f77compilerbinary></f77compilerbinary>
+ <cflags>-O2 -g -Wall</cflags>
+ <f77flags></f77flags>
+ </debug>
+ <default>
+ <envvars/>
+ <configargs/>
+ <builddir/>
<topsourcedir/>
- <cppflags>-Isrc/ -I/usr/include/libxml2/ -DHGENGINE -DRUN_FROM_START_FOLDER</cppflags>
- <ldflags>-lpthread -lX11 -lGL -lxml2 -lpng</ldflags>
+ <cppflags/>
+ <ldflags/>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cflags/>
+ <cxxflags/>
<f77flags/>
- </debug>
- <default>
- <envvars/>
</default>
</configurations>
<make>
@@ -208,7 +222,7 @@
<includePaths>.;</includePaths>
</codecompletion>
<creategettersetter>
- <prefixGet/>
+ <prefixGet></prefixGet>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
@@ -229,11 +243,11 @@
</cppsupportpart>
<kdevdebugger>
<general>
- <gdbpath/>
+ <gdbpath></gdbpath>
<dbgshell>libtool</dbgshell>
- <configGdbScript/>
- <runShellScript/>
- <runGdbScript/>
+ <configGdbScript></configGdbScript>
+ <runShellScript></runShellScript>
+ <runGdbScript></runGdbScript>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-04 19:10:57
|
Revision: 147
http://hgengine.svn.sourceforge.net/hgengine/?rev=147&view=rev
Author: axlecrusher
Date: 2009-01-04 19:10:52 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
move the transpose function out into math
Modified Paths:
--------------
Mercury2/src/MercuryMath.cpp
Mercury2/src/MercuryMath.h
Mercury2/src/MercuryMatrix.cpp
Mercury2/src/MercuryMatrix.h
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-01-04 18:32:00 UTC (rev 146)
+++ Mercury2/src/MercuryMath.cpp 2009-01-04 19:10:52 UTC (rev 147)
@@ -1,5 +1,34 @@
#include "MercuryMath.h"
+//the SSE version of this was really slow, this is quicker
+void TransposeMatrix( FloatRow* m )
+{
+ float tmp;
+ float *_m = (float*)m;
+
+ tmp = _m[1];
+ _m[1] = _m[4];
+ _m[4] = tmp;
+
+ tmp = _m[2];
+ _m[2] = _m[8];
+ _m[8] = tmp;
+ tmp = _m[3];
+ _m[3] = _m[12];
+ _m[12] = tmp;
+
+ tmp = _m[6];
+ _m[6] = _m[9];
+ _m[9] = tmp;
+ tmp = _m[7];
+ _m[7] = _m[13];
+ _m[13] = tmp;
+
+ tmp = _m[11];
+ _m[11] = _m[14];
+ _m[14] = tmp;
+}
+
#ifndef USE_SSE
//Generic Math functions. Compile these if you can not use optimized functions.
Modified: Mercury2/src/MercuryMath.h
===================================================================
--- Mercury2/src/MercuryMath.h 2009-01-04 18:32:00 UTC (rev 146)
+++ Mercury2/src/MercuryMath.h 2009-01-04 19:10:52 UTC (rev 147)
@@ -53,6 +53,7 @@
void Copy16f( void * dest, const void * source );
void MatrixMultiply4f ( const FloatRow* in1, const FloatRow* in2, FloatRow* out );
void VectorMultiply4f(const FloatRow* matrix, const FloatRow* p, FloatRow* out );
+void TransposeMatrix( FloatRow* m );
#endif
Modified: Mercury2/src/MercuryMatrix.cpp
===================================================================
--- Mercury2/src/MercuryMatrix.cpp 2009-01-04 18:32:00 UTC (rev 146)
+++ Mercury2/src/MercuryMatrix.cpp 2009-01-04 19:10:52 UTC (rev 147)
@@ -214,40 +214,6 @@
printf("\n");
}
-void TransposeMatrix( const MercuryMatrix &in, MercuryMatrix &out )
-{
- float tmp;
- const float* _in = (const float*)in.Ptr();
- float* _out = out.Ptr();
-
- //unchanging
- _out[0] = _in[0];
- _out[5] = _in[5];
- _out[10] = _in[10];
- _out[15] = _in[15];
-
- tmp = _in[1];
- _out[1] = _in[4];
- _out[4] = tmp;
- tmp = _in[2];
- _out[2] = _in[8];
- _out[8] = tmp;
- tmp = _in[3];
- _out[3] = _in[12];
- _out[12] = tmp;
-
- tmp = _in[6];
- _out[6] = _in[9];
- _out[9] = tmp;
- tmp = _in[7];
- _out[7] = _in[13];
- _out[13] = tmp;
-
- tmp = _in[11];
- _out[11] = _in[14];
- _out[14] = tmp;
-}
-
/*
* Copyright (c) 2006 Joshua Allen
* All rights reserved.
Modified: Mercury2/src/MercuryMatrix.h
===================================================================
--- Mercury2/src/MercuryMatrix.h 2009-01-04 18:32:00 UTC (rev 146)
+++ Mercury2/src/MercuryMatrix.h 2009-01-04 19:10:52 UTC (rev 147)
@@ -7,9 +7,6 @@
class MercuryMatrix;
-//Matrix in1 will be copied, n2 will not. n2 better never be the same as out
-void TransposeMatrix( const MercuryMatrix& in, MercuryMatrix &out );
-
///General Purpose 4x4 row-major matrix
class MercuryMatrix
{
@@ -38,7 +35,7 @@
void RotateAngAxis( float fAngle, float x, float y, float z );
void Scale(float x, float y, float z);
void Transotale( float tX, float tY, float tZ, float rX, float rY, float rZ, float sX, float sY, float sZ );
- inline void Transpose() { TransposeMatrix(*this, *this); }
+ inline void Transpose() { TransposeMatrix( m_matrix ); }
void Zero();
void Identity();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-04 18:32:07
|
Revision: 146
http://hgengine.svn.sourceforge.net/hgengine/?rev=146&view=rev
Author: axlecrusher
Date: 2009-01-04 18:32:00 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
convert non optimized functions to FloatRow
Modified Paths:
--------------
Mercury2/src/MercuryMath.cpp
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-01-04 18:07:42 UTC (rev 145)
+++ Mercury2/src/MercuryMath.cpp 2009-01-04 18:32:00 UTC (rev 146)
@@ -9,36 +9,36 @@
Copy4f(&r, (FloatRow){ 0.0f, 0.0f, 0.0f, 0.0f });
}
-void Mul4f(const float* first, const float* second, float* out)
+void Mul4f(const FloatRow* first, const FloatRow* second, FloatRow* out)
{
- out[0] = first[0] * second[0];
- out[1] = first[1] * second[1];
- out[2] = first[2] * second[2];
- out[3] = first[3] * second[3];
+ ((float*)out)[0] = ((float*)first)[0] * ((float*)second)[0];
+ ((float*)out)[1] = ((float*)first)[1] * ((float*)second)[1];
+ ((float*)out)[2] = ((float*)first)[2] * ((float*)second)[2];
+ ((float*)out)[3] = ((float*)first)[3] * ((float*)second)[3];
}
-void Div4f(const float* first, const float* second, float* out)
+void Div4f(const FloatRow* first, const FloatRow* second, FloatRow* out)
{
- out[0] = first[0] / second[0];
- out[1] = first[1] / second[1];
- out[2] = first[2] / second[2];
- out[3] = first[3] / second[3];
+ ((float*)out)[0] = ((float*)first)[0] / ((float*)second)[0];
+ ((float*)out)[1] = ((float*)first)[1] / ((float*)second)[1];
+ ((float*)out)[2] = ((float*)first)[2] / ((float*)second)[2];
+ ((float*)out)[3] = ((float*)first)[3] / ((float*)second)[3];
}
-void Add4f(const float* first, const float* second, float* out)
+void Add4f(const FloatRow* first, const FloatRow* second, FloatRow* out)
{
- out[0] = first[0] + second[0];
- out[1] = first[1] + second[1];
- out[2] = first[2] + second[2];
- out[3] = first[3] + second[3];
+ ((float*)out)[0] = ((float*)first)[0] + ((float*)second)[0];
+ ((float*)out)[1] = ((float*)first)[1] + ((float*)second)[1];
+ ((float*)out)[2] = ((float*)first)[2] + ((float*)second)[2];
+ ((float*)out)[3] = ((float*)first)[3] + ((float*)second)[3];
}
-void Sub4f(const float* first, const float* second, float* out)
+void Sub4f(const FloatRow* first, const FloatRow* second, FloatRow* out)
{
- out[0] = first[0] - second[0];
- out[1] = first[1] - second[1];
- out[2] = first[2] - second[2];
- out[3] = first[3] - second[3];
+ ((float*)out)[0] = ((float*)first)[0] - ((float*)second)[0];
+ ((float*)out)[1] = ((float*)first)[1] - ((float*)second)[1];
+ ((float*)out)[2] = ((float*)first)[2] - ((float*)second)[2];
+ ((float*)out)[3] = ((float*)first)[3] - ((float*)second)[3];
}
void Copy4f( void * dest, const void * source )
@@ -215,7 +215,7 @@
for (y = 0; y < 4; ++y)
{
- //load columns
+ //load rows as columns
xmm[3] = _mm_shuffle_ps (in1[y], in1[y], 0xff);
xmm[2] = _mm_shuffle_ps (in1[y], in1[y], 0xaa);
xmm[1] = _mm_shuffle_ps (in1[y], in1[y], 0x55);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-04 18:07:45
|
Revision: 145
http://hgengine.svn.sourceforge.net/hgengine/?rev=145&view=rev
Author: axlecrusher
Date: 2009-01-04 18:07:42 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
improve the vector multiply
Modified Paths:
--------------
Mercury2/src/MercuryMath.cpp
Mercury2/src/MercuryMath.h
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-01-04 17:50:45 UTC (rev 144)
+++ Mercury2/src/MercuryMath.cpp 2009-01-04 18:07:42 UTC (rev 145)
@@ -130,8 +130,11 @@
in1[14] * in2[11] + in1[15] * in2[15];
}
-void VectorMultiply4f( const float * m, float *p, float *out )
+void VectorMultiply4f( const FloatRow* matrix, const FloatRow* pa, FloatRow* outa )
{
+ float *m = (float*)matrix;
+ float *p = (float*)pa;
+ float *out = (float*)outa;
out[0] = p[0] * m[0] + p[1] * m[1] + p[2] * m[2] + p[3] * m[3];
out[1] = p[0] * m[4] + p[1] * m[5] + p[2] * m[6] + p[3] * m[7];
out[2] = p[0] * m[8] + p[1] * m[9] + p[2] * m[10] + p[3] * m[11];
@@ -231,35 +234,25 @@
//This is an SSE matrix vector multiply, see the standard C++ code
//for a clear algorithim. This seems like it works.
-void VectorMultiply4f( const float * m, float *p, float *out )
+void VectorMultiply4f( const FloatRow* matrix, const FloatRow* p, FloatRow* out )
{
- __m128 xmm[5], outxmm[2], tmp;
-
- xmm[0] = _mm_load_ps((float*)p); //the vector
-
- //store the matrix
- xmm[1] = _mm_load_ps((float*)&(m[0]));
- xmm[2] = _mm_load_ps((float*)&(m[4]));
- xmm[3] = _mm_load_ps((float*)&(m[8]));
- xmm[4] = _mm_load_ps((float*)&(m[12]));
-
+ __m128 tmp;
+
//compute term 1 and term 2 and store them in the low order
//of outxmm[0]
- outxmm[0] = Hadd4( _mm_mul_ps( xmm[1], xmm[0] ) );
- tmp = Hadd4( _mm_mul_ps( xmm[2], xmm[0] ) );
- outxmm[0] = _mm_unpacklo_ps(outxmm[0], tmp);
+ out[0] = Hadd4( _mm_mul_ps( matrix[1], *p ) );
+ tmp = Hadd4( _mm_mul_ps( matrix[2], *p ) );
+ out[0] = _mm_unpacklo_ps(out[0], tmp);
//compute term 3 and term 4 and store them in the high order
//of outxmm[1]
- outxmm[1] = Hadd4( _mm_mul_ps( xmm[3], xmm[0] ) );
- tmp = Hadd4( _mm_mul_ps( xmm[4], xmm[0] ) );
- outxmm[1] = _mm_unpacklo_ps(outxmm[1], tmp);
+ out[1] = Hadd4( _mm_mul_ps( matrix[3], *p ) );
+ tmp = Hadd4( _mm_mul_ps( matrix[4], *p ) );
+ out[1] = _mm_unpacklo_ps(out[1], tmp);
//shuffle the low order of outxmm[0] into the loworder of tmp
//and shuffle the low order of outxmm[1] into the high order of tmp
- tmp = _mm_movelh_ps(outxmm[0], outxmm[1]);
-
- _mm_store_ps(out, tmp);
+ *out = _mm_movelh_ps(out[0], out[1]);
}
void ZeroFloatRow(FloatRow& r)
Modified: Mercury2/src/MercuryMath.h
===================================================================
--- Mercury2/src/MercuryMath.h 2009-01-04 17:50:45 UTC (rev 144)
+++ Mercury2/src/MercuryMath.h 2009-01-04 18:07:42 UTC (rev 145)
@@ -52,7 +52,7 @@
void Copy8f( void * dest, const void * source );
void Copy16f( void * dest, const void * source );
void MatrixMultiply4f ( const FloatRow* in1, const FloatRow* in2, FloatRow* out );
-void VectorMultiply4f(const float *m, float *p, float *out );
+void VectorMultiply4f(const FloatRow* matrix, const FloatRow* p, FloatRow* out );
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-04 17:50:50
|
Revision: 144
http://hgengine.svn.sourceforge.net/hgengine/?rev=144&view=rev
Author: axlecrusher
Date: 2009-01-04 17:50:45 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
continuing improvements on the SSE functions
Modified Paths:
--------------
Mercury2/src/MercuryMath.cpp
Mercury2/src/MercuryMath.h
Mercury2/src/MercuryMatrix.cpp
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-01-04 16:37:53 UTC (rev 143)
+++ Mercury2/src/MercuryMath.cpp 2009-01-04 17:50:45 UTC (rev 144)
@@ -85,7 +85,7 @@
((float*)dest)[15] = ((float*)source)[15];
}
-void R_ConcatTransforms4 ( const FloatRow* in1a, const FloatRow* in2a, FloatRow* outa)
+void MatrixMultiply4f ( const FloatRow* in1a, const FloatRow* in2a, FloatRow* outa)
{
float *in1, *in2, *out;
@@ -149,54 +149,24 @@
return _mm_add_ps( x, _mm_shuffle_ps(x, x, _MM_SHUFFLE(1,1,1,1)) );
}
-void Mul4f(const float* first, const float* second, float* out)
+void Mul4f(const FloatRow* first, const FloatRow* second, FloatRow* out)
{
- __m128 xmm[2];
-
- xmm[0] = _mm_load_ps(first);
- xmm[1] = _mm_load_ps(second);
-
- xmm[0] = _mm_mul_ps( xmm[0], xmm[1] );
-
- _mm_store_ps(out, xmm[0]);
+ *out = _mm_mul_ps( *first, *second );
}
-void Div4f(const float* first, const float* second, float* out)
+void Div4f(const FloatRow* first, const FloatRow* second, FloatRow* out)
{
- __m128 xmm[2];
-
- xmm[0] = _mm_load_ps(first);
- xmm[1] = _mm_load_ps(second);
-
- xmm[0] = _mm_div_ps( xmm[0], xmm[1] );
-
- _mm_store_ps(out, xmm[0]);
+ *out = _mm_div_ps( *first, *second );
}
-void Add4f(const float* first, const float* second, float* out)
+void Add4f(const FloatRow* first, const FloatRow* second, FloatRow* out)
{
- __m128 xmm[2];
-
- xmm[0] = _mm_load_ps(first);
- xmm[1] = _mm_load_ps(second);
-
- xmm[0] = _mm_add_ps( xmm[0], xmm[1] );
-
- _mm_store_ps(out, xmm[0]);
-
+ *out = _mm_add_ps( *first, *second );
}
-void Sub4f(const float* first, const float* second, float* out)
+void Sub4f(const FloatRow* first, const FloatRow* second, FloatRow* out)
{
- __m128 xmm[2];
-
- xmm[0] = _mm_load_ps(first);
- xmm[1] = _mm_load_ps(second);
-
- xmm[0] = _mm_sub_ps( xmm[0], xmm[1] );
-
- _mm_store_ps(out, xmm[0]);
-
+ *out = _mm_sub_ps( *first, *second );
}
void Copy4f( void * dest, const void * source )
@@ -235,7 +205,7 @@
_mm_store_ps((float*)&(((float*)dest)[12]), xmm[3]);
}
-void R_ConcatTransforms4 ( const FloatRow* in1, const FloatRow* in2, FloatRow* out)
+void MatrixMultiply4f( const FloatRow* in1, const FloatRow* in2, FloatRow* out)
{
unsigned int y;
__m128 xmm[4];
Modified: Mercury2/src/MercuryMath.h
===================================================================
--- Mercury2/src/MercuryMath.h 2009-01-04 16:37:53 UTC (rev 143)
+++ Mercury2/src/MercuryMath.h 2009-01-04 17:50:45 UTC (rev 144)
@@ -44,15 +44,14 @@
#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])
-void Mul4f(const float* first, const float* second, float* out);
-void Div4f(const float* first, const float* second, float* out);
-void Add4f(const float* first, const float* second, float* out);
-void Sub4f(const float* first, const float* second, float* out);
+void Mul4f(const FloatRow* first, const FloatRow* second, FloatRow* out);
+void Div4f(const FloatRow* first, const FloatRow* second, FloatRow* out);
+void Add4f(const FloatRow* first, const FloatRow* second, FloatRow* out);
+void Sub4f(const FloatRow* first, const FloatRow* second, FloatRow* out);
void Copy4f( void * dest, const void * source );
void Copy8f( void * dest, const void * source );
void Copy16f( void * dest, const void * source );
-//void R_ConcatTransforms4 ( const float* in1, const float* in2, float* out );
-void R_ConcatTransforms4 ( const FloatRow* in1, const FloatRow* in2, FloatRow* out );
+void MatrixMultiply4f ( const FloatRow* in1, const FloatRow* in2, FloatRow* out );
void VectorMultiply4f(const float *m, float *p, float *out );
#endif
Modified: Mercury2/src/MercuryMatrix.cpp
===================================================================
--- Mercury2/src/MercuryMatrix.cpp 2009-01-04 16:37:53 UTC (rev 143)
+++ Mercury2/src/MercuryMatrix.cpp 2009-01-04 17:50:45 UTC (rev 144)
@@ -194,16 +194,14 @@
MercuryMatrix MercuryMatrix::operator*(const MercuryMatrix& m) const
{
MercuryMatrix r(*this);
-// R_ConcatTransforms4 ( (float*)&m_matrix, (float*)&m.m_matrix, (float*)&r.m_matrix);
- R_ConcatTransforms4 ( m_matrix, m.m_matrix, r.m_matrix);
+ MatrixMultiply4f ( m_matrix, m.m_matrix, r.m_matrix);
return r;
}
MercuryMatrix& MercuryMatrix::operator*=(const MercuryMatrix& m)
{
MercuryMatrix r(*this);
-// R_ConcatTransforms4 ( (float*)&r.m_matrix, (float*)&m.m_matrix, (float*)&m_matrix);
- R_ConcatTransforms4 ( r.m_matrix, m.m_matrix, m_matrix);
+ MatrixMultiply4f ( r.m_matrix, m.m_matrix, m_matrix);
return *this;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-04 16:38:05
|
Revision: 143
http://hgengine.svn.sourceforge.net/hgengine/?rev=143&view=rev
Author: axlecrusher
Date: 2009-01-04 16:37:53 +0000 (Sun, 04 Jan 2009)
Log Message:
-----------
First stage of overhauling mercury math so squeeze out a little more speed
Use our own FloatRow to define rows for matrices instead of float arrays.
We can define these differently if we are using SSE or not.
So far this makes matrix multiplies about %14 faster.
Modified Paths:
--------------
Mercury2/src/MercuryMath.cpp
Mercury2/src/MercuryMath.h
Mercury2/src/MercuryMatrix.cpp
Mercury2/src/MercuryMatrix.h
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-01-03 17:50:45 UTC (rev 142)
+++ Mercury2/src/MercuryMath.cpp 2009-01-04 16:37:53 UTC (rev 143)
@@ -4,6 +4,11 @@
//Generic Math functions. Compile these if you can not use optimized functions.
+void ZeroFloatRow(FloatRow& r)
+{
+ Copy4f(&r, (FloatRow){ 0.0f, 0.0f, 0.0f, 0.0f });
+}
+
void Mul4f(const float* first, const float* second, float* out)
{
out[0] = first[0] * second[0];
@@ -80,8 +85,14 @@
((float*)dest)[15] = ((float*)source)[15];
}
-void R_ConcatTransforms4 ( const float* in1, const float* in2, float* out)
+void R_ConcatTransforms4 ( const FloatRow* in1a, const FloatRow* in2a, FloatRow* outa)
{
+ float *in1, *in2, *out;
+
+ in1 = (float*)in1a;
+ in2 = (float*)in2a;
+ out = (float*)outa;
+
out[0] = in1[0] * in2[0] + in1[1] * in2[4] +
in1[2] * in2[8] + in1[3] * in2[12];
out[1] = in1[0] * in2[1] + in1[1] * in2[5] +
@@ -128,9 +139,8 @@
}
#else
-#include <xmmintrin.h>
-inline __m128 Hadd4(__m128 x);
+//inline __m128 Hadd4(__m128 x);
__m128 Hadd4(__m128 x)
{
//add the low and high components of x
@@ -225,33 +235,27 @@
_mm_store_ps((float*)&(((float*)dest)[12]), xmm[3]);
}
-void R_ConcatTransforms4 ( const float* in1, const float* in2, float* out)
+void R_ConcatTransforms4 ( const FloatRow* in1, const FloatRow* in2, FloatRow* out)
{
- unsigned int x, y;
- __m128 xmm[8];
-
- xmm[1] = _mm_load_ps((float*)&(in2[0]));
- xmm[3] = _mm_load_ps((float*)&(in2[4]));
- xmm[5] = _mm_load_ps((float*)&(in2[8]));
- xmm[7] = _mm_load_ps((float*)&(in2[12]));
-
+ unsigned int y;
+ __m128 xmm[4];
+
for (y = 0; y < 4; ++y)
{
- xmm[0] = _mm_set_ps1(in1[(y*4)+0]);
- xmm[2] = _mm_set_ps1(in1[(y*4)+1]);
- xmm[4] = _mm_set_ps1(in1[(y*4)+2]);
- xmm[6] = _mm_set_ps1(in1[(y*4)+3]);
+ //load columns
+ xmm[3] = _mm_shuffle_ps (in1[y], in1[y], 0xff);
+ xmm[2] = _mm_shuffle_ps (in1[y], in1[y], 0xaa);
+ xmm[1] = _mm_shuffle_ps (in1[y], in1[y], 0x55);
+ xmm[0] = _mm_shuffle_ps (in1[y], in1[y], 0x00);
- xmm[0] = _mm_mul_ps( xmm[0], xmm[1] );
- xmm[2] = _mm_mul_ps( xmm[2], xmm[3] );
- xmm[4] = _mm_mul_ps( xmm[4], xmm[5] );
- xmm[6] = _mm_mul_ps( xmm[6], xmm[7] );
+ xmm[0] = _mm_mul_ps( xmm[0], in2[0] );
+ xmm[1] = _mm_mul_ps( xmm[1], in2[1] );
+ xmm[2] = _mm_mul_ps( xmm[2], in2[2] );
+ xmm[3] = _mm_mul_ps( xmm[3], in2[3] );
- xmm[0] = _mm_add_ps( xmm[0], xmm[2] );
- xmm[4] = _mm_add_ps( xmm[4], xmm[6] );
- xmm[0] = _mm_add_ps( xmm[0], xmm[4] );
-
- _mm_store_ps(&(out[(y*4)]), xmm[0]);
+ xmm[0] = _mm_add_ps( xmm[0], xmm[1] );
+ xmm[2] = _mm_add_ps( xmm[2], xmm[3] );
+ out[y] = _mm_add_ps( xmm[0], xmm[2] );
}
}
@@ -288,6 +292,11 @@
_mm_store_ps(out, tmp);
}
+void ZeroFloatRow(FloatRow& r)
+{
+ r = (FloatRow)_mm_setzero_ps();
+}
+
#endif
/*
Modified: Mercury2/src/MercuryMath.h
===================================================================
--- Mercury2/src/MercuryMath.h 2009-01-03 17:50:45 UTC (rev 142)
+++ Mercury2/src/MercuryMath.h 2009-01-04 16:37:53 UTC (rev 143)
@@ -3,6 +3,15 @@
#include <math.h>
+#ifdef USE_SSE
+#include <xmmintrin.h>
+typedef __m128 FloatRow __attribute__((aligned(16)));
+#else
+typedef float FloatRow[4];
+#endif
+
+void ZeroFloatRow(FloatRow& r);
+
#define DEGRAD 0.01745329251994329576f //degree to radian
#define RADDEG 57.2957795130823208767f //radian to degree
#define Q_PI 3.14159265358979323846f
@@ -42,7 +51,8 @@
void Copy4f( void * dest, const void * source );
void Copy8f( void * dest, const void * source );
void Copy16f( void * dest, const void * source );
-void R_ConcatTransforms4 ( const float* in1, const float* in2, float* out );
+//void R_ConcatTransforms4 ( const float* in1, const float* in2, float* out );
+void R_ConcatTransforms4 ( const FloatRow* in1, const FloatRow* in2, FloatRow* out );
void VectorMultiply4f(const float *m, float *p, float *out );
#endif
Modified: Mercury2/src/MercuryMatrix.cpp
===================================================================
--- Mercury2/src/MercuryMatrix.cpp 2009-01-03 17:50:45 UTC (rev 142)
+++ Mercury2/src/MercuryMatrix.cpp 2009-01-04 16:37:53 UTC (rev 143)
@@ -25,56 +25,47 @@
void MercuryMatrix::Zero()
{
- m_matrix[0][0] = 0;
- m_matrix[0][1] = 0;
- m_matrix[0][2] = 0;
- m_matrix[0][3] = 0;
-
- m_matrix[1][0] = 0;
- m_matrix[1][1] = 0;
- m_matrix[1][2] = 0;
- m_matrix[1][3] = 0;
-
- m_matrix[2][0] = 0;
- m_matrix[2][1] = 0;
- m_matrix[2][2] = 0;
- m_matrix[2][3] = 0;
-
- m_matrix[3][0] = 0;
- m_matrix[3][1] = 0;
- m_matrix[3][2] = 0;
- m_matrix[3][3] = 0;
+ ZeroFloatRow( m_matrix[0] );
+ ZeroFloatRow( m_matrix[1] );
+ ZeroFloatRow( m_matrix[2] );
+ ZeroFloatRow( m_matrix[3] );
}
void MercuryMatrix::Identity()
{
- m_matrix[0][0] = 1;
- m_matrix[0][1] = 0;
- m_matrix[0][2] = 0;
- m_matrix[0][3] = 0;
+ Copy4f(&m_matrix[0], (void*)&((FloatRow){ 1.0f, 0.0f, 0.0f, 0.0f }));
+ Copy4f(&m_matrix[1], (void*)&((FloatRow){ 0.0f, 1.0f, 0.0f, 0.0f }));
+ Copy4f(&m_matrix[2], (void*)&((FloatRow){ 0.0f, 0.0f, 1.0f, 0.0f }));
+ Copy4f(&m_matrix[3], (void*)&((FloatRow){ 0.0f, 0.0f, 0.0f, 1.0f }));
+/*
+ (*this)[0][0] = 1;
+ (*this)[0][1] = 0;
+ (*this)[0][2] = 0;
+ (*this)[0][3] = 0;
- m_matrix[1][0] = 0;
- m_matrix[1][1] = 1;
- m_matrix[1][2] = 0;
- m_matrix[1][3] = 0;
+ (*this)[1][0] = 0;
+ (*this)[1][1] = 1;
+ (*this)[1][2] = 0;
+ (*this)[1][3] = 0;
- m_matrix[2][0] = 0;
- m_matrix[2][1] = 0;
- m_matrix[2][2] = 1;
- m_matrix[2][3] = 0;
+ (*this)[2][0] = 0;
+ (*this)[2][1] = 0;
+ (*this)[2][2] = 1;
+ (*this)[2][3] = 0;
- m_matrix[3][0] = 0;
- m_matrix[3][1] = 0;
- m_matrix[3][2] = 0;
- m_matrix[3][3] = 1;
+ (*this)[3][0] = 0;
+ (*this)[3][1] = 0;
+ (*this)[3][2] = 0;
+ (*this)[3][3] = 1;
+ */
}
void MercuryMatrix::Translate(float x, float y, float z)
{
MercuryMatrix m;
- m.m_matrix[0][3] = x;
- m.m_matrix[1][3] = y;
- m.m_matrix[2][3] = z;
+ m[0][3] = x;
+ m[1][3] = y;
+ m[2][3] = z;
*this *= m;
}
@@ -95,25 +86,25 @@
//Row major
//manually transposed
- matrix.m_matrix[0][0] = cy*cz;
- matrix.m_matrix[1][0] = (sx*sy*cz)-(cx*sz);
- matrix.m_matrix[2][0] = (cx*sy*cz)+(sx*sz);
- matrix.m_matrix[3][0] = 0;
+ matrix[0][0] = cy*cz;
+ matrix[1][0] = (sx*sy*cz)-(cx*sz);
+ matrix[2][0] = (cx*sy*cz)+(sx*sz);
+ matrix[3][0] = 0;
- matrix.m_matrix[0][1] = cy*sz;
- matrix.m_matrix[1][1] = (sx*sy*sz)+(cx*cz);
- matrix.m_matrix[2][1] = (cx*sy*sz)-(sx*cz);
- matrix.m_matrix[3][1] = 0;
+ matrix[0][1] = cy*sz;
+ matrix[1][1] = (sx*sy*sz)+(cx*cz);
+ matrix[2][1] = (cx*sy*sz)-(sx*cz);
+ matrix[3][1] = 0;
- matrix.m_matrix[0][2] = -sy;
- matrix.m_matrix[1][2] = sx*cy;
- matrix.m_matrix[2][2] = cx*cy;
- matrix.m_matrix[3][2] = 0;
+ matrix[0][2] = -sy;
+ matrix[1][2] = sx*cy;
+ matrix[2][2] = cx*cy;
+ matrix[3][2] = 0;
- matrix.m_matrix[0][3] = 0;
- matrix.m_matrix[1][3] = 0;
- matrix.m_matrix[2][3] = 0;
- matrix.m_matrix[3][3] = 1;
+ matrix[0][3] = 0;
+ matrix[1][3] = 0;
+ matrix[2][3] = 0;
+ matrix[3][3] = 1;
*this *= matrix;
}
@@ -127,25 +118,25 @@
float y = iy/absin;
float z = iz/absin;
- m_matrix[0][0] = x*x*(1-c)+c;
- m_matrix[0][1] = x*y*(1-c)-z*s;
- m_matrix[0][2] = x*z*(1-c)+y*s;
- m_matrix[0][3] = 0;
+ (*this)[0][0] = x*x*(1-c)+c;
+ (*this)[0][1] = x*y*(1-c)-z*s;
+ (*this)[0][2] = x*z*(1-c)+y*s;
+ (*this)[0][3] = 0;
- m_matrix[1][0] = y*x*(1-c)+z*s;
- m_matrix[1][1] = y*y*(1-c)+c;
- m_matrix[1][2] = y*z*(1-c)-x*s;
- m_matrix[1][3] = 0;
+ (*this)[1][0] = y*x*(1-c)+z*s;
+ (*this)[1][1] = y*y*(1-c)+c;
+ (*this)[1][2] = y*z*(1-c)-x*s;
+ (*this)[1][3] = 0;
- m_matrix[2][0] = x*z*(1-c)-y*s;
- m_matrix[2][1] = y*z*(1-c)+x*s;
- m_matrix[2][2] = z*z*(1-c)+c;
- m_matrix[2][3] = 0;
+ (*this)[2][0] = x*z*(1-c)-y*s;
+ (*this)[2][1] = y*z*(1-c)+x*s;
+ (*this)[2][2] = z*z*(1-c)+c;
+ (*this)[2][3] = 0;
- m_matrix[3][0] = 0;
- m_matrix[3][1] = 0;
- m_matrix[3][2] = 0;
- m_matrix[3][3] = 1;
+ (*this)[3][0] = 0;
+ (*this)[3][1] = 0;
+ (*this)[3][2] = 0;
+ (*this)[3][3] = 1;
}
void MercuryMatrix::Transotale( float tX, float tY, float tZ, float rX, float rY, float rZ, float sX, float sY, float sZ )
@@ -165,25 +156,25 @@
//Row major
//manually transposed
- matrix.m_matrix[0][0] = sX*cy*cz;
- matrix.m_matrix[1][0] = sX*((sx*sy*cz)-(cx*sz));
- matrix.m_matrix[2][0] = sX*((cx*sy*cz)+(sx*sz));
- matrix.m_matrix[3][0] = 0;
+ matrix[0][0] = sX*cy*cz;
+ matrix[1][0] = sX*((sx*sy*cz)-(cx*sz));
+ matrix[2][0] = sX*((cx*sy*cz)+(sx*sz));
+ matrix[3][0] = 0;
- matrix.m_matrix[0][1] = sY*cy*sz;
- matrix.m_matrix[1][1] = sY*((sx*sy*sz)+(cx*cz));
- matrix.m_matrix[2][1] = sY*((cx*sy*sz)-(sx*cz));
- matrix.m_matrix[3][1] = 0;
+ matrix[0][1] = sY*cy*sz;
+ matrix[1][1] = sY*((sx*sy*sz)+(cx*cz));
+ matrix[2][1] = sY*((cx*sy*sz)-(sx*cz));
+ matrix[3][1] = 0;
- matrix.m_matrix[0][2] = sZ*(-sy);
- matrix.m_matrix[1][2] = sZ*sx*cy;
- matrix.m_matrix[2][2] = sZ*cx*cy;
- matrix.m_matrix[3][2] = 0;
+ matrix[0][2] = sZ*(-sy);
+ matrix[1][2] = sZ*sx*cy;
+ matrix[2][2] = sZ*cx*cy;
+ matrix[3][2] = 0;
- matrix.m_matrix[0][3] = tX;
- matrix.m_matrix[1][3] = tY;
- matrix.m_matrix[2][3] = tZ;
- matrix.m_matrix[3][3] = 1;
+ matrix[0][3] = tX;
+ matrix[1][3] = tY;
+ matrix[2][3] = tZ;
+ matrix[3][3] = 1;
*this *= matrix;
}
@@ -193,9 +184,9 @@
{
MercuryMatrix m;
- m.m_matrix[0][0] = x;
- m.m_matrix[1][1] = y;
- m.m_matrix[2][2] = z;
+ m[0][0] = x;
+ m[1][1] = y;
+ m[2][2] = z;
*this *= m;
}
@@ -203,14 +194,16 @@
MercuryMatrix MercuryMatrix::operator*(const MercuryMatrix& m) const
{
MercuryMatrix r(*this);
- R_ConcatTransforms4 ( (float*)&m_matrix, (float*)&m.m_matrix, (float*)&r.m_matrix);
+// R_ConcatTransforms4 ( (float*)&m_matrix, (float*)&m.m_matrix, (float*)&r.m_matrix);
+ R_ConcatTransforms4 ( m_matrix, m.m_matrix, r.m_matrix);
return r;
}
MercuryMatrix& MercuryMatrix::operator*=(const MercuryMatrix& m)
{
MercuryMatrix r(*this);
- R_ConcatTransforms4 ( (float*)&r.m_matrix, (float*)&m.m_matrix, (float*)&m_matrix);
+// R_ConcatTransforms4 ( (float*)&r.m_matrix, (float*)&m.m_matrix, (float*)&m_matrix);
+ R_ConcatTransforms4 ( r.m_matrix, m.m_matrix, m_matrix);
return *this;
}
@@ -218,7 +211,7 @@
{
for (int i = 0; i < 4; ++i)
{
- printf( "%f %f %f %f\n", m_matrix[i][0], m_matrix[i][1], m_matrix[i][2], m_matrix[i][3] );
+ printf( "%f %f %f %f\n", (*this)[i][0], (*this)[i][1], (*this)[i][2], (*this)[i][3] );
}
printf("\n");
}
Modified: Mercury2/src/MercuryMatrix.h
===================================================================
--- Mercury2/src/MercuryMatrix.h 2009-01-03 17:50:45 UTC (rev 142)
+++ Mercury2/src/MercuryMatrix.h 2009-01-04 16:37:53 UTC (rev 143)
@@ -15,13 +15,14 @@
{
private:
///[row][column] (The internal matrix)
- float m_matrix[4][4];
+// float m_matrix[4][4];
+ FloatRow m_matrix[4];
public:
MercuryMatrix();
inline MercuryMatrix(const MercuryMatrix& m) { *this = m; }
- inline float* operator[](unsigned int i) { return m_matrix[i]; }
+ inline float* operator[](unsigned int i) { return (float*)&m_matrix[i]; }
///Allow typecasting to float * for use in APIs
- inline const float* operator[](unsigned int i) const { return m_matrix[i]; }
+ inline const float* operator[](unsigned int i) const { return (float*)&m_matrix[i]; }
const MercuryMatrix& operator=(const MercuryMatrix& m);
const MercuryMatrix& operator=(const float* m);
inline float* Ptr() { return (float*)&m_matrix; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-03 17:50:49
|
Revision: 142
http://hgengine.svn.sourceforge.net/hgengine/?rev=142&view=rev
Author: axlecrusher
Date: 2009-01-03 17:50:45 +0000 (Sat, 03 Jan 2009)
Log Message:
-----------
updates
Modified Paths:
--------------
Mercury2/src/AlignedBuffer.h
Mercury2/src/MercuryTimer.h
Modified: Mercury2/src/AlignedBuffer.h
===================================================================
--- Mercury2/src/AlignedBuffer.h 2009-01-03 17:48:45 UTC (rev 141)
+++ Mercury2/src/AlignedBuffer.h 2009-01-03 17:50:45 UTC (rev 142)
@@ -14,11 +14,11 @@
Free();
}
- void Allocate(unsigned long count)
+ void Allocate(unsigned long count, uint8_t alignment = 32)
{
SAFE_FREE(m_mem);
void * m_memret;
- m_data = (T*)mmemalign(32, sizeof(T)*count, m_memret);
+ m_data = (T*)mmemalign(alignment, sizeof(T)*count, m_memret);
m_mem = (T*)m_memret;
m_length = count;
}
Modified: Mercury2/src/MercuryTimer.h
===================================================================
--- Mercury2/src/MercuryTimer.h 2009-01-03 17:48:45 UTC (rev 141)
+++ Mercury2/src/MercuryTimer.h 2009-01-03 17:50:45 UTC (rev 142)
@@ -19,7 +19,8 @@
float Touch(const MercuryTimer& t);
///time between last last touch and this touch
- inline float Age() { return (m_thisTouch - m_lastTouch)/1000000.0f; }
+ inline float Age() { return MicrosecondAge()/1000000.0f; }
+ inline uint64_t MicrosecondAge() { return m_thisTouch - m_lastTouch; }
void Pause();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-03 17:48:49
|
Revision: 141
http://hgengine.svn.sourceforge.net/hgengine/?rev=141&view=rev
Author: axlecrusher
Date: 2009-01-03 17:48:45 +0000 (Sat, 03 Jan 2009)
Log Message:
-----------
function to check alignedness
Modified Paths:
--------------
Mercury2/src/MercuryUtil.cpp
Mercury2/src/MercuryUtil.h
Modified: Mercury2/src/MercuryUtil.cpp
===================================================================
--- Mercury2/src/MercuryUtil.cpp 2009-01-02 01:45:52 UTC (rev 140)
+++ Mercury2/src/MercuryUtil.cpp 2009-01-03 17:48:45 UTC (rev 141)
@@ -29,6 +29,11 @@
return ptr;
}
+bool isAligned(size_t align, const void* mem)
+{
+ return (uintptr_t(mem) % align) == 0;
+}
+
long FileToString( const MString & sFileName, char * & data )
{
data = 0;
Modified: Mercury2/src/MercuryUtil.h
===================================================================
--- Mercury2/src/MercuryUtil.h 2009-01-02 01:45:52 UTC (rev 140)
+++ Mercury2/src/MercuryUtil.h 2009-01-03 17:48:45 UTC (rev 141)
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <MercuryString.h>
+#include <assert.h>
/*#ifndef NULL
#define NULL 0
@@ -16,11 +17,12 @@
//returns an aligned pointer, mem is the actual (unaligned) pointer for freeing
void* mmemalign(size_t align, size_t size, void*& mem);
+bool isAligned(size_t align, const void* mem);
+#define ASSERT(x) assert(!x)
+
#if defined(__GNUC__)
#define M_ALIGN(n) __attribute__((aligned(n)))
-//#define MMALLOC(n) memalign(32, n)
-//#define MMALLOC(n) malloc(n)
#else
#define M_ALIGN(n)
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-02 02:22:31
|
Revision: 140
http://hgengine.svn.sourceforge.net/hgengine/?rev=140&view=rev
Author: axlecrusher
Date: 2009-01-02 01:45:52 +0000 (Fri, 02 Jan 2009)
Log Message:
-----------
add ability to pause
Modified Paths:
--------------
Mercury2/src/MercuryTimer.cpp
Mercury2/src/MercuryTimer.h
Modified: Mercury2/src/MercuryTimer.cpp
===================================================================
--- Mercury2/src/MercuryTimer.cpp 2009-01-02 01:20:29 UTC (rev 139)
+++ Mercury2/src/MercuryTimer.cpp 2009-01-02 01:45:52 UTC (rev 140)
@@ -15,7 +15,7 @@
}
MercuryTimer::MercuryTimer()
- :m_lastTouch(0), m_thisTouch(0)
+ :m_lastTouch(0), m_thisTouch(0), m_paused(false)
{
if (m_initTime == 0)
m_initTime = GetTimeInMicroSeconds();
@@ -33,6 +33,8 @@
{
m_lastTouch = m_thisTouch;
m_thisTouch = GetTimeInMicroSeconds() - m_initTime;
+
+ if (m_paused) m_lastTouch = m_thisTouch;
return Age();
}
@@ -42,6 +44,11 @@
return Age();
}
+void MercuryTimer::Pause()
+{
+ m_paused = !m_paused;
+}
+
const MercuryTimer& MercuryTimer::operator=(const MercuryTimer& t)
{
m_lastTouch = t.m_lastTouch;
Modified: Mercury2/src/MercuryTimer.h
===================================================================
--- Mercury2/src/MercuryTimer.h 2009-01-02 01:20:29 UTC (rev 139)
+++ Mercury2/src/MercuryTimer.h 2009-01-02 01:45:52 UTC (rev 140)
@@ -21,12 +21,15 @@
///time between last last touch and this touch
inline float Age() { return (m_thisTouch - m_lastTouch)/1000000.0f; }
+ void Pause();
+
const MercuryTimer& operator=(const MercuryTimer& t);
private:
static uint64_t m_initTime;
uint64_t m_lastTouch;
uint64_t m_thisTouch;
+ bool m_paused;
};
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-02 01:20:36
|
Revision: 139
http://hgengine.svn.sourceforge.net/hgengine/?rev=139&view=rev
Author: axlecrusher
Date: 2009-01-02 01:20:29 +0000 (Fri, 02 Jan 2009)
Log Message:
-----------
fix not defined
Modified Paths:
--------------
Mercury2/src/MercuryMath.cpp
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-01-02 01:19:05 UTC (rev 138)
+++ Mercury2/src/MercuryMath.cpp 2009-01-02 01:20:29 UTC (rev 139)
@@ -1,6 +1,6 @@
#include "MercuryMath.h"
-#if !defined( USE_SSE )
+#ifndef USE_SSE
//Generic Math functions. Compile these if you can not use optimized functions.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-02 01:19:09
|
Revision: 138
http://hgengine.svn.sourceforge.net/hgengine/?rev=138&view=rev
Author: axlecrusher
Date: 2009-01-02 01:19:05 +0000 (Fri, 02 Jan 2009)
Log Message:
-----------
fix memory leaks
Modified Paths:
--------------
Mercury2/src/HGMDLMesh.cpp
Mercury2/src/X11Window.cpp
Modified: Mercury2/src/HGMDLMesh.cpp
===================================================================
--- Mercury2/src/HGMDLMesh.cpp 2009-01-02 01:17:34 UTC (rev 137)
+++ Mercury2/src/HGMDLMesh.cpp 2009-01-02 01:19:05 UTC (rev 138)
@@ -13,6 +13,7 @@
hgmdl->Read( name, nameLength );
//fread(name, nameLength, 1, hgmdl);
m_name = name;
+ SAFE_DELETE_ARRAY(name);
}
hgmdl->Read( &m_cachable, sizeof( char ) );
Modified: Mercury2/src/X11Window.cpp
===================================================================
--- Mercury2/src/X11Window.cpp 2009-01-02 01:17:34 UTC (rev 137)
+++ Mercury2/src/X11Window.cpp 2009-01-02 01:19:05 UTC (rev 138)
@@ -78,7 +78,9 @@
X11Window::~X11Window()
{
+ if (m_renderCtx) glXDestroyContext(m_display, m_renderCtx);
if (m_display) XCloseDisplay(m_display);
+ m_renderCtx = NULL;
m_display = NULL;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-02 01:17:39
|
Revision: 137
http://hgengine.svn.sourceforge.net/hgengine/?rev=137&view=rev
Author: axlecrusher
Date: 2009-01-02 01:17:34 +0000 (Fri, 02 Jan 2009)
Log Message:
-----------
enable message pump
Modified Paths:
--------------
Mercury2/src/Mercury2.cpp
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-01-02 01:15:53 UTC (rev 136)
+++ Mercury2/src/Mercury2.cpp 2009-01-02 01:17:34 UTC (rev 137)
@@ -62,7 +62,7 @@
do
{
timer.Touch();
-// MESSAGEMAN::GetInstance().PumpMessages( timer.MicrosecondsSinceInit() );
+ MESSAGEMAN::GetInstance().PumpMessages( timer.MicrosecondsSinceInit() );
root->RecursiveUpdate( timer.Age() ); //comment to use threads
RenderableNode::RecursiveRender(root);
w->SwapBuffers();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-02 01:15:57
|
Revision: 136
http://hgengine.svn.sourceforge.net/hgengine/?rev=136&view=rev
Author: axlecrusher
Date: 2009-01-02 01:15:53 +0000 (Fri, 02 Jan 2009)
Log Message:
-----------
inline age
Modified Paths:
--------------
Mercury2/src/MercuryTimer.cpp
Mercury2/src/MercuryTimer.h
Modified: Mercury2/src/MercuryTimer.cpp
===================================================================
--- Mercury2/src/MercuryTimer.cpp 2009-01-01 17:04:02 UTC (rev 135)
+++ Mercury2/src/MercuryTimer.cpp 2009-01-02 01:15:53 UTC (rev 136)
@@ -42,11 +42,6 @@
return Age();
}
-float MercuryTimer::Age()
-{
- return (m_thisTouch - m_lastTouch)/1000000.0f;
-}
-
const MercuryTimer& MercuryTimer::operator=(const MercuryTimer& t)
{
m_lastTouch = t.m_lastTouch;
Modified: Mercury2/src/MercuryTimer.h
===================================================================
--- Mercury2/src/MercuryTimer.h 2009-01-01 17:04:02 UTC (rev 135)
+++ Mercury2/src/MercuryTimer.h 2009-01-02 01:15:53 UTC (rev 136)
@@ -3,6 +3,8 @@
#include <stdint.h>
+int64_t GetTimeInMicroSeconds();
+
class MercuryTimer
{
public:
@@ -17,7 +19,7 @@
float Touch(const MercuryTimer& t);
///time between last last touch and this touch
- float Age();
+ inline float Age() { return (m_thisTouch - m_lastTouch)/1000000.0f; }
const MercuryTimer& operator=(const MercuryTimer& t);
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-01-01 17:04:06
|
Revision: 135
http://hgengine.svn.sourceforge.net/hgengine/?rev=135&view=rev
Author: axlecrusher
Date: 2009-01-01 17:04:02 +0000 (Thu, 01 Jan 2009)
Log Message:
-----------
use MercuryTimer
Modified Paths:
--------------
Mercury2/src/Mercury2.cpp
Mercury2/src/MercuryUtil.cpp
Mercury2/src/MercuryUtil.h
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-01-01 17:01:48 UTC (rev 134)
+++ Mercury2/src/Mercury2.cpp 2009-01-01 17:04:02 UTC (rev 135)
@@ -13,6 +13,9 @@
#include <MercuryCrash.h>
#include <MercuryBacktrace.h>
#include <MercuryMessageManager.h>
+
+#include <MercuryTimer.h>
+
MSemaphore UpdateLoopGo;
void* UpdateThread(void* node)
{
@@ -37,8 +40,6 @@
int main()
{
unsigned long m_count = 0;
- uint64_t startTime = GetTimeInMicroSeconds();
- uint64_t timeSinceStart = 0;
cnset_execute_on_crash( SignalHandler );
@@ -51,31 +52,29 @@
root->LoadFromXML( r );
SAFE_DELETE(doc);
+
+ MercuryTimer timer;
+ MercuryTimer fpsTimer;
- uint64_t oTime = timeSinceStart;
- uint64_t m_time = oTime;
-
//uncomment the next 2 lines to use threads
// MercuryThread updateThread;
// updateThread.Create( UpdateThread, root, false);
do
{
- timeSinceStart = GetTimeInMicroSeconds() - startTime;
- MESSAGEMAN::GetInstance().PumpMessages( timeSinceStart );
- root->RecursiveUpdate((timeSinceStart-oTime)/1000000.0f); //comment to use threads
+ timer.Touch();
+// MESSAGEMAN::GetInstance().PumpMessages( timer.MicrosecondsSinceInit() );
+ root->RecursiveUpdate( timer.Age() ); //comment to use threads
RenderableNode::RecursiveRender(root);
w->SwapBuffers();
++m_count;
- float seconds = (timeSinceStart-m_time)/1000000.0f;
- if (seconds > 1)
+ fpsTimer.Touch(timer);
+ if (fpsTimer.Age() > 1)
{
- m_time = timeSinceStart;
- printf("FPS: %f\n", m_count/seconds);
+ printf("FPS: %f\n", m_count/fpsTimer.Age());
m_count = 0;
+ fpsTimer = timer;
}
-
- oTime = timeSinceStart;
}
while ( w->PumpMessages() );
Modified: Mercury2/src/MercuryUtil.cpp
===================================================================
--- Mercury2/src/MercuryUtil.cpp 2009-01-01 17:01:48 UTC (rev 134)
+++ Mercury2/src/MercuryUtil.cpp 2009-01-01 17:04:02 UTC (rev 135)
@@ -2,12 +2,6 @@
#include <MercuryFile.h>
#include <stdint.h>
-#ifndef WIN32
-#include <sys/time.h>
-#else
-#include <windows.h>
-#endif
-
MString ToUpper(const MString& s)
{
MString t = s;
@@ -35,15 +29,6 @@
return ptr;
}
-int64_t GetTimeInMicroSeconds()
-{
- struct timeval tv;
- gettimeofday( &tv, 0 );
-
- return (int64_t(tv.tv_sec) * 1000000) + tv.tv_usec;
-
-}
-
long FileToString( const MString & sFileName, char * & data )
{
data = 0;
Modified: Mercury2/src/MercuryUtil.h
===================================================================
--- Mercury2/src/MercuryUtil.h 2009-01-01 17:01:48 UTC (rev 134)
+++ Mercury2/src/MercuryUtil.h 2009-01-01 17:04:02 UTC (rev 135)
@@ -17,8 +17,6 @@
//returns an aligned pointer, mem is the actual (unaligned) pointer for freeing
void* mmemalign(size_t align, size_t size, void*& mem);
-int64_t GetTimeInMicroSeconds();
-
#if defined(__GNUC__)
#define M_ALIGN(n) __attribute__((aligned(n)))
//#define MMALLOC(n) memalign(32, n)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|