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: <axl...@us...> - 2009-05-11 23:45:32
|
Revision: 220
http://hgengine.svn.sourceforge.net/hgengine/?rev=220&view=rev
Author: axlecrusher
Date: 2009-05-11 23:45:21 +0000 (Mon, 11 May 2009)
Log Message:
-----------
Work on windows compile
Modified Paths:
--------------
Mercury2/Mercury2.sln
Mercury2/Mercury2.vcproj
Mercury2/src/AlignedBuffer.h
Mercury2/src/BoundingBox.cpp
Mercury2/src/BoundingBox.h
Mercury2/src/MAutoPtr.h
Mercury2/src/MSemaphore.cpp
Mercury2/src/MSemaphore.h
Mercury2/src/MercuryFileDriverDirect.cpp
Mercury2/src/MercuryMath.cpp
Mercury2/src/MercuryMessageManager.h
Mercury2/src/MercuryTimer.cpp
Mercury2/src/MercuryTimer.h
Mercury2/src/MercuryUtil.cpp
Mercury2/src/MercuryUtil.h
Mercury2/src/MercuryVBO.cpp
Mercury2/src/MercuryVertex.cpp
Mercury2/src/MercuryVertex.h
Mercury2/src/MercuryWindow.h
Mercury2/src/MessageHandler.h
Mercury2/src/PNGLoader.cpp
Mercury2/src/Quad.cpp
Mercury2/src/RenderGraph.cpp
Mercury2/src/RenderableNode.cpp
Mercury2/src/RenderableNode.h
Mercury2/src/Shader.cpp
Mercury2/src/Texture.cpp
Mercury2/src/Texture.h
Mercury2/src/TransformNode.cpp
Mercury2/src/Viewport.cpp
Mercury2/src/Win32Window.cpp
Mercury2/src/Win32Window.h
Added Paths:
-----------
Mercury2/freeglut.dll
Mercury2/freeglut.lib
Mercury2/iconv.dll
Mercury2/libpng.lib
Mercury2/libpng3.dll
Mercury2/libxml2.dll
Mercury2/libxml2.lib
Mercury2/src/GLHeaders.h
Mercury2/src/Mint.h
Mercury2/src/glext.h
Mercury2/src/global.h
Mercury2/src/include/
Mercury2/src/include/freeglut/
Mercury2/src/include/freeglut/freeglut.h
Mercury2/src/include/freeglut/freeglut_ext.h
Mercury2/src/include/freeglut/freeglut_std.h
Mercury2/src/include/freeglut/glut.h
Mercury2/src/include/iconv.h
Mercury2/src/include/libxml/
Mercury2/src/include/libxml/DOCBparser.h
Mercury2/src/include/libxml/HTMLparser.h
Mercury2/src/include/libxml/HTMLtree.h
Mercury2/src/include/libxml/SAX.h
Mercury2/src/include/libxml/SAX2.h
Mercury2/src/include/libxml/c14n.h
Mercury2/src/include/libxml/catalog.h
Mercury2/src/include/libxml/chvalid.h
Mercury2/src/include/libxml/debugXML.h
Mercury2/src/include/libxml/dict.h
Mercury2/src/include/libxml/encoding.h
Mercury2/src/include/libxml/entities.h
Mercury2/src/include/libxml/globals.h
Mercury2/src/include/libxml/hash.h
Mercury2/src/include/libxml/list.h
Mercury2/src/include/libxml/nanoftp.h
Mercury2/src/include/libxml/nanohttp.h
Mercury2/src/include/libxml/parser.h
Mercury2/src/include/libxml/parserInternals.h
Mercury2/src/include/libxml/pattern.h
Mercury2/src/include/libxml/relaxng.h
Mercury2/src/include/libxml/schemasInternals.h
Mercury2/src/include/libxml/schematron.h
Mercury2/src/include/libxml/threads.h
Mercury2/src/include/libxml/tree.h
Mercury2/src/include/libxml/uri.h
Mercury2/src/include/libxml/valid.h
Mercury2/src/include/libxml/xinclude.h
Mercury2/src/include/libxml/xlink.h
Mercury2/src/include/libxml/xmlIO.h
Mercury2/src/include/libxml/xmlautomata.h
Mercury2/src/include/libxml/xmlerror.h
Mercury2/src/include/libxml/xmlexports.h
Mercury2/src/include/libxml/xmlmemory.h
Mercury2/src/include/libxml/xmlmodule.h
Mercury2/src/include/libxml/xmlreader.h
Mercury2/src/include/libxml/xmlregexp.h
Mercury2/src/include/libxml/xmlsave.h
Mercury2/src/include/libxml/xmlschemas.h
Mercury2/src/include/libxml/xmlschemastypes.h
Mercury2/src/include/libxml/xmlstring.h
Mercury2/src/include/libxml/xmlunicode.h
Mercury2/src/include/libxml/xmlversion.h
Mercury2/src/include/libxml/xmlwin32version.h
Mercury2/src/include/libxml/xmlwriter.h
Mercury2/src/include/libxml/xpath.h
Mercury2/src/include/libxml/xpathInternals.h
Mercury2/src/include/libxml/xpointer.h
Mercury2/src/include/png/
Mercury2/src/include/png/libpng12/
Mercury2/src/include/png/libpng12/png.h
Mercury2/src/include/png/libpng12/pngconf.h
Mercury2/src/include/png/png.h
Mercury2/src/include/png/pngconf.h
Mercury2/src/include/zlib/
Mercury2/src/include/zlib/zconf.h
Mercury2/src/include/zlib/zlib.h
Mercury2/zdll.lib
Modified: Mercury2/Mercury2.sln
===================================================================
--- Mercury2/Mercury2.sln 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/Mercury2.sln 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,6 +1,6 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mercury2", "Mercury2.vcproj", "{071CC088-86A7-4A9F-9FEE-50BD69132886}"
EndProject
Global
Modified: Mercury2/Mercury2.vcproj
===================================================================
--- Mercury2/Mercury2.vcproj 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/Mercury2.vcproj 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="Mercury2"
ProjectGUID="{071CC088-86A7-4A9F-9FEE-50BD69132886}"
RootNamespace="Mercury2"
Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@@ -40,8 +41,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="src/"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ AdditionalIncludeDirectories="src/;src/include;src/include/zlib;src/include/png;src/include/libxml2;src/include/freeglut"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HGENGINE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -61,10 +62,12 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="opengl32.lib"
+ AdditionalDependencies="zdll.lib libpng.lib libxml2.lib opengl32.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -86,9 +89,6 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -142,6 +142,8 @@
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -163,9 +165,6 @@
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -179,10 +178,58 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
+ RelativePath=".\src\BMPLoader.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\BoundingBox.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Frustum.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\HGMDLMesh.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\HGMDLModel.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\ImageLoader.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\Mercury2.cpp"
>
</File>
<File
+ RelativePath=".\src\MercuryAsset.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFile.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFileDriverDirect.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFileDriverMem.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFileDriverPacked.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFileDriverZipped.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryMath.cpp"
>
</File>
@@ -191,17 +238,101 @@
>
</File>
<File
+ RelativePath=".\src\MercuryMessageManager.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryNode.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryPlane.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryPoint.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryString.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryThreads.cpp"
>
</File>
<File
+ RelativePath=".\src\MercuryTimer.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryUtil.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryVBO.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryVertex.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryWindow.cpp"
>
</File>
<File
+ RelativePath=".\src\MSemaphore.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\PNGLoader.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Quad.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\RawImageData.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\RenderableNode.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\RenderGraph.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Shader.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Texture.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\TransformNode.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\UpdateThreader.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Viewport.cpp"
+ >
+ </File>
+ <File
RelativePath=".\src\Win32Window.cpp"
>
</File>
+ <File
+ RelativePath=".\src\XMLParser.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Header Files"
@@ -209,14 +340,86 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
+ RelativePath=".\src\AlignedBuffer.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\BoundingBox.h"
+ >
+ </File>
+ <File
RelativePath=".\src\Callback.h"
>
</File>
<File
+ RelativePath=".\src\Frustum.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\glext.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\GLHeaders.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\global.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\HGMDLMesh.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\HGMDLModel.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\ImageLoader.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MAutoPtr.h"
>
</File>
<File
+ RelativePath=".\src\MercuryAsset.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryBacktrace.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryCrash.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFile.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFileDriverDirect.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFileDriverMem.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFileDriverPacked.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryFileDriverZipped.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryList.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryMath.h"
>
</File>
@@ -225,25 +428,117 @@
>
</File>
<File
+ RelativePath=".\src\MercuryMessageManager.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryNode.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryPlane.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryPoint.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryString.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryThreads.h"
>
</File>
<File
+ RelativePath=".\src\MercuryTimer.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryUtil.h"
>
</File>
<File
+ RelativePath=".\src\MercuryVBO.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MercuryVertex.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MercuryWindow.h"
>
</File>
<File
+ RelativePath=".\src\MessageHandler.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Mint.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\MQueue.h"
+ >
+ </File>
+ <File
RelativePath=".\src\MScopedArray.h"
>
</File>
<File
+ RelativePath=".\src\MSemaphore.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\PriorityQueue.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Quad.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\RawImageData.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\RenderableNode.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\RenderGraph.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Shader.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Texture.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\TransformNode.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\UpdateThreader.h"
+ >
+ </File>
+ <File
+ RelativePath=".\src\Viewport.h"
+ >
+ </File>
+ <File
RelativePath=".\src\Win32Window.h"
>
</File>
+ <File
+ RelativePath=".\src\XMLParser.h"
+ >
+ </File>
</Filter>
<Filter
Name="Resource Files"
Added: Mercury2/freeglut.dll
===================================================================
(Binary files differ)
Property changes on: Mercury2/freeglut.dll
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/freeglut.lib
===================================================================
(Binary files differ)
Property changes on: Mercury2/freeglut.lib
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/iconv.dll
===================================================================
(Binary files differ)
Property changes on: Mercury2/iconv.dll
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/libpng.lib
===================================================================
(Binary files differ)
Property changes on: Mercury2/libpng.lib
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/libpng3.dll
===================================================================
(Binary files differ)
Property changes on: Mercury2/libpng3.dll
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/libxml2.dll
===================================================================
(Binary files differ)
Property changes on: Mercury2/libxml2.dll
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: Mercury2/libxml2.lib
===================================================================
(Binary files differ)
Property changes on: Mercury2/libxml2.lib
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: Mercury2/src/AlignedBuffer.h
===================================================================
--- Mercury2/src/AlignedBuffer.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/AlignedBuffer.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,7 +1,7 @@
#ifndef ALIGNEDBUFFER_H
#define ALIGNEDBUFFER_H
-#include <stdint.h>
+#include <Mint.h>
template <typename T>
class AlignedBuffer
Modified: Mercury2/src/BoundingBox.cpp
===================================================================
--- Mercury2/src/BoundingBox.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/BoundingBox.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,5 +1,4 @@
-#include <GL/gl.h>
-#include <GL/glext.h>
+#include <GLHeaders.h>
#include <BoundingBox.h>
#include <string.h>
#include <Viewport.h>
Modified: Mercury2/src/BoundingBox.h
===================================================================
--- Mercury2/src/BoundingBox.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/BoundingBox.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -5,7 +5,7 @@
#include <MercuryVertex.h>
#include <MercuryMatrix.h>
#include <Frustum.h>
-#include <stdint.h>
+#include <Mint.h>
#include <MercuryPlane.h>
class BoundingVolume
Added: Mercury2/src/GLHeaders.h
===================================================================
--- Mercury2/src/GLHeaders.h (rev 0)
+++ Mercury2/src/GLHeaders.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -0,0 +1,18 @@
+#ifndef GLHEADERS_H
+#define GLHEADERS_H
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#include <GL/gl.h>
+
+#ifdef WIN32
+#include <glext.h>
+#else
+#include <GL/glext.h>
+#endif
+
+#include <glut.h>
+
+#endif
\ No newline at end of file
Modified: Mercury2/src/MAutoPtr.h
===================================================================
--- Mercury2/src/MAutoPtr.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MAutoPtr.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -2,6 +2,7 @@
#define MAUTOPTR_H
#include <MercuryThreads.h>
+#include <stdlib.h>
class RefBase
{
Modified: Mercury2/src/MSemaphore.cpp
===================================================================
--- Mercury2/src/MSemaphore.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MSemaphore.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,94 +1,162 @@
-#include <MSemaphore.h>
-
-MSemaphore::MSemaphore()
- :m_counter(0)
-{
-}
-
-unsigned long MSemaphore::Read()
-{
- return __sync_or_and_fetch(&m_counter, 0);
-}
-
-unsigned long MSemaphore::ReadAndClear()
-{
- return __sync_fetch_and_and(&m_counter, 0);
-}
-
-unsigned long MSemaphore::Decrement()
-{
- return __sync_sub_and_fetch(&m_counter, 1);
-}
-
-unsigned long MSemaphore::Increment()
-{
- return __sync_add_and_fetch(&m_counter, 1);
-}
-
-void MSemaphore::WaitAndSet(unsigned long value, unsigned long newVal)
-{
- while ( !__sync_bool_compare_and_swap(&m_counter, value, newVal) );
-}
-
-MSemaphoreLock::MSemaphoreLock(MSemaphore* s)
- :m_s(s)
-{
- m_s->WaitAndSet(0,1);
-}
-
-MSemaphoreLock::~MSemaphoreLock()
-{
- m_s->WaitAndSet(1,0);
-}
-
-MSemaphoreIncOnDestroy::MSemaphoreIncOnDestroy(MSemaphore* s)
- :m_s(s)
-{
-}
-
-MSemaphoreIncOnDestroy::~MSemaphoreIncOnDestroy()
-{
- m_s->Increment();
-}
-
-MSemaphoreDecOnDestroy::MSemaphoreDecOnDestroy(MSemaphore* s)
- :m_s(s)
-{
-}
-
-MSemaphoreDecOnDestroy::~MSemaphoreDecOnDestroy()
-{
- m_s->Decrement();
-}
-
-/****************************************************************************
- * Copyright (C) 2008 by Joshua Allen *
- * *
- * *
- * All rights reserved. *
- * *
- * Redistribution and use in source and binary forms, with or without *
- * modification, are permitted provided that the following conditions *
- * are met: *
- * * Redistributions of source code must retain the above copyright *
- * notice, this list of conditions and the following disclaimer. *
- * * Redistributions in binary form must reproduce the above *
- * copyright notice, this list of conditions and the following *
- * disclaimer in the documentation and/or other materials provided *
- * with the distribution. *
- * * Neither the name of the Mercury Engine nor the names of its *
- * contributors may be used to endorse or promote products derived *
- * from this software without specific prior written permission. *
- * *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
- ***************************************************************************/
+#include <MSemaphore.h>
+
+MSemaphore::MSemaphore()
+ :m_counter(0)
+{
+}
+#ifndef WIN32
+
+unsigned long MSemaphore::Read()
+{
+ return __sync_or_and_fetch(&m_counter, 0);
+}
+
+unsigned long MSemaphore::ReadAndClear()
+{
+ return __sync_fetch_and_and(&m_counter, 0);
+}
+
+unsigned long MSemaphore::Decrement()
+{
+ return __sync_sub_and_fetch(&m_counter, 1);
+}
+
+unsigned long MSemaphore::Increment()
+{
+ return __sync_add_and_fetch(&m_counter, 1);
+}
+
+void MSemaphore::WaitAndSet(unsigned long value, unsigned long newVal)
+{
+ while ( !__sync_bool_compare_and_swap(&m_counter, value, newVal) );
+}
+
+#else
+
+//These functions seem to be missing from x86 WinBase
+FORCEINLINE
+LONG
+MyInterlockedOr (
+ __inout LONG volatile *Destination,
+ __in LONG Value
+ )
+{
+ LONG Old;
+
+ do {
+ Old = *Destination;
+ } while (InterlockedCompareExchange(Destination,
+ Old | Value,
+ Old) != Old);
+
+ return Old;
+}
+
+FORCEINLINE
+LONG
+MyInterlockedAnd (
+ __inout LONG volatile *Destination,
+ __in LONG Value
+ )
+{
+ LONG Old;
+
+ do {
+ Old = *Destination;
+ } while (InterlockedCompareExchange(Destination,
+ Old & Value,
+ Old) != Old);
+
+ return Old;
+}
+
+unsigned long MSemaphore::Read()
+{
+ return MyInterlockedOr(&m_counter, 0);
+}
+
+unsigned long MSemaphore::ReadAndClear()
+{
+ return MyInterlockedAnd(&m_counter, 0);
+}
+
+unsigned long MSemaphore::Decrement()
+{
+ return InterlockedDecrement(&m_counter);
+}
+
+unsigned long MSemaphore::Increment()
+{
+ return InterlockedIncrement(&m_counter);
+}
+
+void MSemaphore::WaitAndSet(unsigned long value, unsigned long newVal)
+{
+ InterlockedCompareExchange(&m_counter, newVal, value);
+// while ( !__sync_bool_compare_and_swap(&m_counter, value, newVal) );
+}
+
+#endif
+
+MSemaphoreLock::MSemaphoreLock(MSemaphore* s)
+ :m_s(s)
+{
+ m_s->WaitAndSet(0,1);
+}
+
+MSemaphoreLock::~MSemaphoreLock()
+{
+ m_s->WaitAndSet(1,0);
+}
+
+MSemaphoreIncOnDestroy::MSemaphoreIncOnDestroy(MSemaphore* s)
+ :m_s(s)
+{
+}
+
+MSemaphoreIncOnDestroy::~MSemaphoreIncOnDestroy()
+{
+ m_s->Increment();
+}
+
+MSemaphoreDecOnDestroy::MSemaphoreDecOnDestroy(MSemaphore* s)
+ :m_s(s)
+{
+}
+
+MSemaphoreDecOnDestroy::~MSemaphoreDecOnDestroy()
+{
+ m_s->Decrement();
+}
+
+/****************************************************************************
+ * Copyright (C) 2008 by Joshua Allen *
+ * *
+ * *
+ * All rights reserved. *
+ * *
+ * Redistribution and use in source and binary forms, with or without *
+ * modification, are permitted provided that the following conditions *
+ * are met: *
+ * * Redistributions of source code must retain the above copyright *
+ * notice, this list of conditions and the following disclaimer. *
+ * * Redistributions in binary form must reproduce the above *
+ * copyright notice, this list of conditions and the following *
+ * disclaimer in the documentation and/or other materials provided *
+ * with the distribution. *
+ * * Neither the name of the Mercury Engine nor the names of its *
+ * contributors may be used to endorse or promote products derived *
+ * from this software without specific prior written permission. *
+ * *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
+ ***************************************************************************/
Modified: Mercury2/src/MSemaphore.h
===================================================================
--- Mercury2/src/MSemaphore.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MSemaphore.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,6 +1,12 @@
#ifndef MSEMAPHORE_H
#define MSEMAPHORE_H
+#include <global.h>
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
class MSemaphore
{
public:
@@ -13,7 +19,12 @@
void WaitAndSet(unsigned long value, unsigned long newVal);
private:
- unsigned long m_counter;
+
+#ifndef WIN32
+ int32_t m_counter;
+#else
+ volatile LONG m_counter;
+#endif
};
class MSemaphoreLock
Modified: Mercury2/src/MercuryFileDriverDirect.cpp
===================================================================
--- Mercury2/src/MercuryFileDriverDirect.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryFileDriverDirect.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,11 +1,13 @@
#include "MercuryFileDriverDirect.h"
-#if !defined(WIN32)
+#ifndef WIN32
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#else
+#include <windows.h>
#endif
#if defined(_EE)
@@ -169,7 +171,7 @@
if( !m_fF )
return 0;
#if defined(WIN32)
- HANDLE hFile = CreateFile( m_sPath.c_str(), GENERIC_READ, FILE_SHARE_READ,
+ HANDLE hFile = CreateFile( (LPCWSTR)(m_sPath.c_str()), GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
if( !hFile )
return 0;
@@ -203,7 +205,7 @@
char buffer[1024];
char * path_end;
int retcode = 0;
- if( ( retcode = GetModuleFileName( NULL, buffer, 1024 ) ) < 0 )
+ if( ( retcode = GetModuleFileName( NULL, (LPWCH)buffer, 1024 ) ) < 0 )
{
fprintf( stderr, "WARNING: Could not change path of program to path of executable! Faild to get it with response: %d\n", retcode );
}
@@ -213,7 +215,7 @@
fprintf( stderr, "WARNING: Could not change path of program to path of executable! Path retreived: \"%s\".\n", buffer );
}
*path_end = 0;
- if( !SetCurrentDirectory( buffer ) )
+ if( !SetCurrentDirectory( (LPCWSTR)buffer ) )
{
fprintf( stderr, "WARNING: Could not set operational folder.", buffer );
}
@@ -256,7 +258,7 @@
{
#if defined(WIN32)
WIN32_FIND_DATA fd;
- HANDLE hFind = ::FindFirstFile( sPath, &fd );
+ HANDLE hFind = ::FindFirstFile( (LPCWSTR)(sPath.c_str()), &fd );
if( INVALID_HANDLE_VALUE == hFind ) // no files found
return;
do
@@ -267,7 +269,7 @@
if( (!bDirsOnly) && (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
continue; // skip
- MString sDirName( fd.cFileName );
+ MString sDirName( ((char*)fd.cFileName) );
if( sDirName == "." || sDirName == ".." )
continue;
Modified: Mercury2/src/MercuryMath.cpp
===================================================================
--- Mercury2/src/MercuryMath.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryMath.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <Mint.h>
#include "MercuryMath.h"
//the SSE version of this was really slow, this is quicker
Modified: Mercury2/src/MercuryMessageManager.h
===================================================================
--- Mercury2/src/MercuryMessageManager.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryMessageManager.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -7,7 +7,7 @@
#include <PriorityQueue.h>
#include <MercuryString.h>
#include <MercuryUtil.h>
-#include <stdint.h>
+#include <Mint.h>
/* This message system uses absolute integer time values to fire off events.
This ensures accuarate firing times while eliminating floating point error.
Modified: Mercury2/src/MercuryTimer.cpp
===================================================================
--- Mercury2/src/MercuryTimer.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryTimer.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -4,14 +4,19 @@
#include <sys/time.h>
#else
#include <windows.h>
+
+
#endif
int64_t GetTimeInMicroSeconds()
{
+#ifndef WIN32
struct timeval tv;
gettimeofday( &tv, 0 );
-
return (int64_t(tv.tv_sec) * 1000000) + tv.tv_usec;
+#else
+ return timeGetTime() * uint64_t(1000);
+#endif
}
MercuryTimer::MercuryTimer()
Modified: Mercury2/src/MercuryTimer.h
===================================================================
--- Mercury2/src/MercuryTimer.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryTimer.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,7 +1,7 @@
#ifndef MERCURYTIMER_H
#define MERCURYTIMER_H
-#include <stdint.h>
+#include <Mint.h>
int64_t GetTimeInMicroSeconds();
Modified: Mercury2/src/MercuryUtil.cpp
===================================================================
--- Mercury2/src/MercuryUtil.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryUtil.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,6 +1,6 @@
#include <MercuryUtil.h>
#include <MercuryFile.h>
-#include <stdint.h>
+#include <Mint.h>
MString ToUpper(const MString& s)
{
@@ -21,6 +21,12 @@
return x;
}
+int32_t StrToInt(const MString & s, int32_t d)
+{
+ int32_t x = d;
+ if ( s.length() > 0) sscanf(s.c_str(), "%d", &x);
+ return x;
+}
void* mmemalign(size_t align, size_t size, void*& mem)
{
uintptr_t mask = ~(uintptr_t)(align - 1);
Modified: Mercury2/src/MercuryUtil.h
===================================================================
--- Mercury2/src/MercuryUtil.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryUtil.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <MercuryString.h>
#include <assert.h>
+#include <global.h>
/*#ifndef NULL
#define NULL 0
@@ -30,15 +31,16 @@
MString ToUpper(const MString & s);
float StrToFloat(const MString & s, float d = 0);
+int32_t StrToInt(const MString & s, int32_t d = 0);
template<typename T>
-const T& max(const T& t1, const T& t2)
+const T& MAX(const T& t1, const T& t2)
{
return t1>t2?t1:t2;
}
template<typename T>
-const T& min(const T& t1, const T& t2)
+const T& MIN(const T& t1, const T& t2)
{
return t1<t2?t1:t2;
}
Modified: Mercury2/src/MercuryVBO.cpp
===================================================================
--- Mercury2/src/MercuryVBO.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryVBO.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -2,9 +2,9 @@
#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
+#include <GLHeaders.h>
+
#include <Texture.h>
#define BUFFER_OFFSET(i) ((char*)NULL + (i))
@@ -45,7 +45,7 @@
++m_vboBinds;
}
- //apply all the active textures
+ //apply all the active Textures
for (uint8_t i = 0; i < numTextures; ++i)
{
glActiveTexture( GL_TEXTURE0+i );
Modified: Mercury2/src/MercuryVertex.cpp
===================================================================
--- Mercury2/src/MercuryVertex.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryVertex.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -51,8 +51,8 @@
float MercuryVertex::GetBiggestElement() const
{
float tmp = (*this)[0];
- tmp = max<float>(tmp, (*this)[1]);
- return max<float>(tmp, (*this)[2]);
+ tmp = MAX<float>(tmp, (*this)[1]);
+ return MAX<float>(tmp, (*this)[2]);
}
const MercuryVertex& MercuryVertex::operator *= (const MercuryVertex& p)
Modified: Mercury2/src/MercuryVertex.h
===================================================================
--- Mercury2/src/MercuryVertex.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryVertex.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -3,7 +3,11 @@
#include <MercuryMath.h>
-# define __inline__ __inline__ __attribute__((always_inline))
+#ifndef WIN32
+#define __inline__ __inline__ __attribute__((always_inline))
+#else
+#define __inline__ inline
+#endif
class MercuryVertex
{
Modified: Mercury2/src/MercuryWindow.h
===================================================================
--- Mercury2/src/MercuryWindow.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MercuryWindow.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,6 +1,7 @@
#ifndef MERCURYWINDOW_H
#define MERCURYWINDOW_H
+#include <global.h>
#include <MercuryUtil.h>
#include <list>
#include <Callback.h>
@@ -36,7 +37,8 @@
static MercuryWindow* m_windowInstance;
MString m_title;
- int m_width, m_height, m_bits, m_depthBits;
+ int m_width, m_height;
+ uint8_t m_bits, m_depthBits;
bool m_fullscreen;
};
Modified: Mercury2/src/MessageHandler.h
===================================================================
--- Mercury2/src/MessageHandler.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/MessageHandler.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -2,6 +2,7 @@
#define MESSAGEHANDLER_H
#include <MercuryString.h>
+#include <global.h>
class MessageHandler
{
Added: Mercury2/src/Mint.h
===================================================================
--- Mercury2/src/Mint.h (rev 0)
+++ Mercury2/src/Mint.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -0,0 +1,17 @@
+#ifndef MINT_H
+#define MINT_H
+
+#ifdef WIN32
+typedef __int8 int8_t;
+typedef __int16 int16_t;
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <stdint.h>
+#endif
+
+#endif
\ No newline at end of file
Modified: Mercury2/src/PNGLoader.cpp
===================================================================
--- Mercury2/src/PNGLoader.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/PNGLoader.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -171,4 +171,4 @@
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+ */
\ No newline at end of file
Modified: Mercury2/src/Quad.cpp
===================================================================
--- Mercury2/src/Quad.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/Quad.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -2,9 +2,9 @@
#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
+#include <GLHeaders.h>
+
REGISTER_ASSET_TYPE(Quad);
Quad::Quad()
Modified: Mercury2/src/RenderGraph.cpp
===================================================================
--- Mercury2/src/RenderGraph.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/RenderGraph.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,7 +1,7 @@
#include <MercuryMatrix.h>
#include <RenderGraph.h>
-#include <GL/gl.h>
+#include <GLHeaders.h>
void RenderGraphEntry::Render()
{
Modified: Mercury2/src/RenderableNode.cpp
===================================================================
--- Mercury2/src/RenderableNode.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/RenderableNode.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,8 +1,8 @@
#include <RenderableNode.h>
#include <assert.h>
-#include <GL/gl.h>
+#include <GLHeaders.h>
#include <TransformNode.h>
-#include <unistd.h>
+//#include <unistd.h>
#include <Viewport.h>
using namespace std;
@@ -67,8 +67,11 @@
MercuryNode* n = NULL;
TransformNode* tn;
for (n = Parent(); n; n = n->Parent())
- if ( (tn = TransformNode::Cast(n)) )
+ {
+ tn = TransformNode::Cast(n);
+ if ( tn )
return tn->GetGlobalMatrix();
+ }
return MercuryMatrix::Identity();
}
Modified: Mercury2/src/RenderableNode.h
===================================================================
--- Mercury2/src/RenderableNode.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/RenderableNode.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -6,7 +6,7 @@
#include <MercuryAsset.h>
#include <MercuryMatrix.h>
#include <MSemaphore.h>
-#include <stdint.h>
+#include <Mint.h>
#define MCHECKASSETS
Modified: Mercury2/src/Shader.cpp
===================================================================
--- Mercury2/src/Shader.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/Shader.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -4,9 +4,9 @@
#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
+#include <GLHeaders.h>
+
#include <string.h>
using namespace std;
@@ -47,8 +47,8 @@
void Shader::Init(MercuryNode* node)
{
MercuryAsset::Init( node );
- RenderableNode* rn;
- if ( (rn=RenderableNode::Cast( node )) )
+ RenderableNode* rn = RenderableNode::Cast( node );
+ if ( rn )
rn->AddPostRender( this );
}
@@ -84,7 +84,7 @@
void Shader::LoadFromXML(const XMLNode& node)
{
sShaderName = node.Attribute("file");
- fPriority = atof( node.Attribute("priority").c_str() );
+ fPriority = StrToFloat( node.Attribute("priority").c_str() );
LoadShader( );
}
Modified: Mercury2/src/Texture.cpp
===================================================================
--- Mercury2/src/Texture.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/Texture.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -4,10 +4,7 @@
#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
-#include <GL/glu.h>
-
+#include <GLHeaders.h>
using namespace std;
REGISTER_ASSET_TYPE(Texture);
@@ -36,8 +33,8 @@
{
MercuryAsset::Init( node );
- RenderableNode* rn;
- if ( (rn=RenderableNode::Cast( node )) )
+ RenderableNode* rn = RenderableNode::Cast( node );
+ if ( rn )
rn->AddPostRender( this );
}
@@ -106,7 +103,7 @@
void Texture::LoadFromXML(const XMLNode& node)
{
- LoadImage( node.Attribute("file") );
+ LoadImagePath( node.Attribute("file") );
}
void Texture::BindTexture()
@@ -131,7 +128,7 @@
--m_activeTextures;
}
-void Texture::LoadImage(const MString& path)
+void Texture::LoadImagePath(const MString& path)
{
if (m_isInstanced) return;
if ( !path.empty() )
@@ -165,12 +162,12 @@
{
MAutoPtr< MercuryAsset > t( AssetFactory::GetInstance().Generate("Texture", path) );
Texture *a = (Texture*)t.Ptr();
- a->LoadImage( path );
+ a->LoadImagePath( path );
return a;
}
bool Texture::m_initTextureSuccess = false;
-unsigned short Texture::m_activeTextures = 0;
+uint8_t Texture::m_activeTextures = 0;
uint32_t Texture::m_textureBinds = 0;
/***************************************************************************
Modified: Mercury2/src/Texture.h
===================================================================
--- Mercury2/src/Texture.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/Texture.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -19,7 +19,7 @@
void LoadFromRaw();
- inline static unsigned short NumberActiveTextures() { return m_activeTextures; }
+ inline static uint8_t NumberActiveTextures() { return m_activeTextures; }
inline static uint32_t ReadAndResetBindCount() { uint32_t t = m_textureBinds; m_textureBinds = 0; return t; }
static Texture* Generate();
@@ -27,7 +27,7 @@
void SetRawData(RawImageData* raw);
private:
- void LoadImage(const MString& path);
+ void LoadImagePath(const MString& path);
void BindTexture();
void UnbindTexture();
@@ -37,7 +37,7 @@
unsigned int m_textureResource;
static bool m_initTextureSuccess;
- static unsigned short m_activeTextures;
+ static uint8_t m_activeTextures;
static uint32_t m_textureBinds;
// MString m_filename;
Modified: Mercury2/src/TransformNode.cpp
===================================================================
--- Mercury2/src/TransformNode.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/TransformNode.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -67,7 +67,9 @@
const TransformNode* tn;
while (n)
{
- if ( (tn = TransformNode::Cast( n )) ) return tn->GetGlobalMatrix();
+ tn = TransformNode::Cast( n );
+ tn = TransformNode::Cast( n );
+ if ( tn ) return tn->GetGlobalMatrix();
n = n->Parent();
}
@@ -83,7 +85,8 @@
for (i = m_children.begin(); i != m_children.end(); ++i )
{
- if ( (tn = TransformNode::Cast(*i)) )
+ tn = TransformNode::Cast(*i);
+ if ( tn )
tn->SetTaint( true );
}
}
@@ -135,7 +138,8 @@
TransformNode* tn;
while (n)
{
- if ( (tn = TransformNode::Cast( n )) )
+ tn = TransformNode::Cast( n );
+ if ( tn )
{
tn->RippleTaintDown();
return;
Modified: Mercury2/src/Viewport.cpp
===================================================================
--- Mercury2/src/Viewport.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/Viewport.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -1,5 +1,5 @@
#include <Viewport.h>
-#include <GL/gl.h>
+#include <GLHeaders.h>
#include <MercuryWindow.h>
REGISTER_NODE_TYPE(Viewport);
@@ -15,7 +15,7 @@
FRUSTUM = &m_frustum;
MercuryWindow* w = MercuryWindow::GetCurrentWindow();
- glViewport(m_minx, m_miny, w->Width()*m_xFactor, w->Height()*m_yFactor);
+ glViewport(m_minx, m_miny, (GLsizei)(w->Width()*m_xFactor), (GLsizei)(w->Height()*m_yFactor));
glMatrixMode(GL_PROJECTION);
@@ -34,8 +34,8 @@
{
m_xFactor = StrToFloat(node.Attribute("xfactor"), 1.0f);
m_yFactor = StrToFloat(node.Attribute("yfactor"), 1.0f);
- m_minx = StrToFloat(node.Attribute("minx"), 0);
- m_miny = StrToFloat(node.Attribute("miny"), 0);
+ m_minx = StrToInt(node.Attribute("minx"), 0);
+ m_miny = StrToInt(node.Attribute("miny"), 0);
MercuryWindow* w = MercuryWindow::GetCurrentWindow();
Modified: Mercury2/src/Win32Window.cpp
===================================================================
--- Mercury2/src/Win32Window.cpp 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/Win32Window.cpp 2009-05-11 23:45:21 UTC (rev 220)
@@ -195,6 +195,16 @@
return true;
}
+void* Win32Window::GetProcAddress(const MString& x)
+{
+ return NULL;
+}
+
+void Win32Window::Clear()
+{
+}
+
+
LRESULT CALLBACK WindowCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
Modified: Mercury2/src/Win32Window.h
===================================================================
--- Mercury2/src/Win32Window.h 2009-04-26 16:46:17 UTC (rev 219)
+++ Mercury2/src/Win32Window.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -15,6 +15,8 @@
virtual bool PumpMessages();
static MercuryWindow* GenWin32Window();
+ virtual void* GetProcAddress(const MString& x);
+ virtual void Clear();
private:
void GenWindow();
Added: Mercury2/src/glext.h
===================================================================
--- Mercury2/src/glext.h (rev 0)
+++ Mercury2/src/glext.h 2009-05-11 23:45:21 UTC (rev 220)
@@ -0,0 +1,8782 @@
+#ifndef __glext_h_
+#define __glext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2009 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glext.h last updated $Date: 2009-05-05 15:27:42 -0700 (Tue, 05 May 2009) $ */
+/* Current version at http://www.opengl.org/registry/ */
+#define GL_GLEXT_VERSION 52
+
+/* Function declaration macros - to move into glplatform.h */
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_TEXTURE_BINDING_3D 0x806A
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#endif
+
+#ifndef GL_VERSION_1_2_DEPRECATED
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#endif
+
+#ifndef GL_ARB_imaging
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+#define GL_FUNC_ADD 0x8006
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_BLEND_EQUATION 0x8009
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#endif
+
+#ifndef GL_ARB_imaging_DEPRECATED
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_CLAMP_TO_BORDER 0x812D
+#endif
+
+#ifndef GL_VERSION_1_3_DEPRECATED
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+#define GL_MULTISAMPLE_BIT 0x20000000
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_DEPTH_COMPONENT24 0x81A6
+#define GL_DEPTH_COMPONENT32 0x81A7
+#define GL_MIRRORED_REPEAT 0x8370
+#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
+#define GL_TEXTURE_LOD_BIAS 0x8501
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+#define GL_TEXTURE_DEPTH_SIZE 0x884A
+#define GL_TEXTURE_COMPARE_MODE 0x884C
+#define GL_TEXTURE_COMPARE_FUNC 0x884D
+#endif
+
+#ifndef GL_VERSION_1_4_DEPRECATED
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_GENERATE_MIPMAP 0x8191
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#define GL_FOG_COORDINATE_SOURCE 0x8450
+#define GL_FOG_COORDINATE 0x8451
+#define GL_FRAGMENT_DEPTH 0x8452
+#define GL_CURRENT_FOG_COORDINATE 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
+#define GL_FOG_COORDINATE_ARRAY 0x8457
+#define GL_COLOR_SUM 0x8458
+#define GL_CURRENT_SECONDARY_COLOR 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
+#define GL_SECONDARY_COLOR_ARRAY 0x845E
+#define GL_TEXTURE_FILTER_CONTROL 0x8500
+#define GL_DEPTH_TEXTURE_MODE 0x884B
+#define GL_COMPARE_R_TO_TEXTURE 0x884E
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_QUERY_COUNTER_BITS 0x8864
+#define GL_CURRENT_QUERY 0x8865
+#define GL_QUERY_RESULT 0x8866
+#define GL_QUERY_RESULT_AVAILABLE 0x8867
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY 0x88B8
+#define GL_WRITE_ONLY 0x88B9
+#define GL_READ_WRITE 0x88BA
+#define GL_BUFFER_ACCESS 0x88BB
+#define GL_BUFFER_MAPPED 0x88BC
+#define GL_BUFFER_MAP_POINTER 0x88BD
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STREAM_READ 0x88E1
+#define GL_STREAM_COPY 0x88E2
+#define GL_STATIC_DRAW 0x88E4
+#define GL_STATIC_READ 0x88E5
+#define GL_STATIC_COPY 0x88E6
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_DYNAMIC_READ 0x88E9
+#define GL_DYNAMIC_COPY 0x88EA
+#define GL_SAMPLES_PASSED 0x8914
+#endif
+
+#ifndef GL_VERSION_1_5_DEPRECATED
+#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING...
[truncated message content] |
|
From: Charles L. <cn...@us...> - 2009-05-08 08:29:54
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5040 Modified Files: MercurySuffixEffects.cpp MercurySuffixEffects.h MercuryDisplay.cpp MercuryDisplay.h Log Message: Enable the suffix effects to be run at the ACTUAL end Index: MercuryDisplay.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryDisplay.cpp,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** MercuryDisplay.cpp 26 Nov 2008 06:48:36 -0000 1.169 --- MercuryDisplay.cpp 8 May 2009 08:29:43 -0000 1.170 *************** *** 396,399 **** --- 396,410 ---- } + void MercuryDisplay::AddTranslucentObjectDepth(MercuryObject* obj, float d) + { + //sort furthest to nearest + TranslucentPair p; + p.dist = d; + p.obj = obj; + m_translucentObjects.push_back(p); + + TSortDrawOrder(m_translucentObjects); + } + MercuryPoint PointToScreenCoord(const MercuryMatrix& proj, const MercuryMatrix& view, const MercuryPoint& p, const DisplayDimensions& bd) { Index: MercuryDisplay.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryDisplay.h,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** MercuryDisplay.h 23 Nov 2008 19:27:37 -0000 1.176 --- MercuryDisplay.h 8 May 2009 08:29:43 -0000 1.177 *************** *** 159,162 **** --- 159,163 ---- void AddTranslucentObject(MercuryObject* obj); + void AddTranslucentObjectDepth(MercuryObject* obj, float d); virtual void RenderTranslucentObject() = 0; Index: MercurySuffixEffects.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercurySuffixEffects.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MercurySuffixEffects.h 21 Aug 2007 00:33:03 -0000 1.1 --- MercurySuffixEffects.h 8 May 2009 08:29:43 -0000 1.2 *************** *** 11,16 **** --- 11,18 ---- virtual void Init(); virtual void Render(); + virtual void CustomRender(); CLASS_RTTI( MercurySuffixEffects, MercuryObject ); TextureID * m_suffixTexture; + bool bInRender; }; Index: MercurySuffixEffects.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercurySuffixEffects.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MercurySuffixEffects.cpp 11 Sep 2007 15:26:24 -0000 1.2 --- MercurySuffixEffects.cpp 8 May 2009 08:29:42 -0000 1.3 *************** *** 13,16 **** --- 13,21 ---- void MercurySuffixEffects::Render() { + DISPLAY->AddTranslucentObjectDepth(this,100000.); + } + + void MercurySuffixEffects::CustomRender() + { DisplayDimensions d = DISPLAY->GetDimensions(); if( !m_suffixTexture ) *************** *** 18,22 **** if( m_suffixTexture ) DISPLAY->StripFromScreen( m_suffixTexture->m_ID, 0, 0, 0, (int)d.width, (int)d.height ); ! MercuryObject::Render(); } --- 23,34 ---- if( m_suffixTexture ) DISPLAY->StripFromScreen( m_suffixTexture->m_ID, 0, 0, 0, (int)d.width, (int)d.height ); ! ! MDequeIterator<ParentHoldPair> child = m_objects.begin(); ! while (child != m_objects.end()) ! (child++)->pObject->Render(); ! ! MercuryObject::CustomRender(); ! ! // } } |
|
From: <axl...@us...> - 2009-04-26 16:46:21
|
Revision: 219
http://hgengine.svn.sourceforge.net/hgengine/?rev=219&view=rev
Author: axlecrusher
Date: 2009-04-26 16:46:17 +0000 (Sun, 26 Apr 2009)
Log Message:
-----------
more improvements to threaded loading
HGMDL now thread loading
Modified Paths:
--------------
Mercury2/src/HGMDLModel.cpp
Mercury2/src/HGMDLModel.h
Mercury2/src/ImageLoader.cpp
Mercury2/src/ImageLoader.h
Mercury2/src/MercuryAsset.cpp
Mercury2/src/MercuryAsset.h
Mercury2/src/RenderableNode.h
Mercury2/src/Texture.cpp
Mercury2/src/Texture.h
Modified: Mercury2/src/HGMDLModel.cpp
===================================================================
--- Mercury2/src/HGMDLModel.cpp 2009-04-26 15:37:56 UTC (rev 218)
+++ Mercury2/src/HGMDLModel.cpp 2009-04-26 16:46:17 UTC (rev 219)
@@ -21,7 +21,7 @@
LoadHGMDL( path );
}
-void HGMDLModel::LoadModel(MercuryFile* hgmdl)
+void HGMDLModel::LoadModel(MercuryFile* hgmdl, HGMDLModel* model)
{
char fingerPrint[5];
fingerPrint[4] = 0;
@@ -54,14 +54,15 @@
{
MAutoPtr< HGMDLMesh > mesh( new HGMDLMesh() );
mesh->LoadFromFile( hgmdl );
- m_meshes.push_back(mesh);
+ model->m_meshes.push_back(mesh);
}
}
void HGMDLModel::Render(const MercuryNode* node)
{
- for(uint16_t i = 0; i < m_meshes.size(); ++i)
- m_meshes[i]->Render(node);
+ if ( GetLoadState() != LOADING )
+ for(uint16_t i = 0; i < m_meshes.size(); ++i)
+ m_meshes[i]->Render(node);
}
void HGMDLModel::LoadHGMDL( const MString& path )
@@ -69,16 +70,14 @@
if ( m_isInstanced ) return;
if ( !path.empty() )
{
+ SetLoadState(LOADING);
ADD_ASSET_INSTANCE(HGMDLModel, path, this);
m_path = path;
- MercuryFile * f = FILEMAN.Open( path );
- if( !f )
- {
- printf( "Could not open file: \"%s\" for model\n", path.c_str() );
- return;
- }
- LoadModel( f );
- delete f;
+
+ LoaderThreadData* ltd = new LoaderThreadData( this );
+ MercuryThread loaderThread;
+ loaderThread.HaltOnDestroy(false);
+ loaderThread.Create( LoaderThread, ltd );
}
}
@@ -88,6 +87,29 @@
return new HGMDLModel();
}
+void* HGMDLModel::LoaderThread(void* d)
+{
+ LoaderThreadData *pd = (LoaderThreadData*)d;
+ LoaderThreadData data = *pd;
+ delete pd;
+
+ HGMDLModel *model = (HGMDLModel*)data.asset.Ptr();
+
+ MercuryFile * f = FILEMAN.Open( model->m_path );
+ if( !f )
+ {
+ printf( "Could not open file: \"%s\" for model\n", model->m_path.c_str() );
+ return 0;
+ }
+
+ LoadModel(f, model);
+
+ delete f;
+
+ model->LoadedCallback();
+ return 0;
+}
+
/****************************************************************************
* Copyright (C) 2008 by Joshua Allen *
* *
Modified: Mercury2/src/HGMDLModel.h
===================================================================
--- Mercury2/src/HGMDLModel.h 2009-04-26 15:37:56 UTC (rev 218)
+++ Mercury2/src/HGMDLModel.h 2009-04-26 16:46:17 UTC (rev 219)
@@ -15,18 +15,20 @@
virtual void LoadFromXML(const XMLNode& node);
- void LoadModel(MercuryFile* hgmdl);
+ static void LoadModel(MercuryFile* hgmdl, HGMDLModel* model);
static HGMDLModel* Generate();
virtual void Render(const MercuryNode* node);
private:
void LoadHGMDL( const MString& path );
+ static void* LoaderThread(void* d);
- MString m_path;
std::vector< MAutoPtr< HGMDLMesh > > m_meshes;
};
+
+
#endif
/****************************************************************************
Modified: Mercury2/src/ImageLoader.cpp
===================================================================
--- Mercury2/src/ImageLoader.cpp 2009-04-26 15:37:56 UTC (rev 218)
+++ Mercury2/src/ImageLoader.cpp 2009-04-26 16:46:17 UTC (rev 219)
@@ -6,11 +6,12 @@
void* ImageLoader::ImageLoaderThread(void* d)
{
- ThreadData *pd = (ThreadData*)d;
- ThreadData data = *pd;
+ LoaderThreadData *pd = (LoaderThreadData*)d;
+ LoaderThreadData data = *pd;
+ delete pd;
+
Texture *texture = (Texture*)data.asset.Ptr();
- delete pd;
- RawImageData* imageData = data.imageloader->LoadImage( data.filename );
+ RawImageData* imageData = GetInstance().LoadImage( data.asset->Path() );
texture->SetRawData(imageData);
data.asset->LoadedCallback();
return 0;
@@ -62,9 +63,9 @@
return NULL;
}
-void ImageLoader::LoadImageThreaded(MercuryAsset* t, const MString& filename)
+void ImageLoader::LoadImageThreaded(MercuryAsset* t)
{
- ThreadData* data = new ThreadData(this, t, filename);
+ LoaderThreadData* data = new LoaderThreadData(t);
MercuryThread loaderThread;
loaderThread.HaltOnDestroy(false);
loaderThread.Create( ImageLoader::ImageLoaderThread, data, true );
Modified: Mercury2/src/ImageLoader.h
===================================================================
--- Mercury2/src/ImageLoader.h 2009-04-26 15:37:56 UTC (rev 218)
+++ Mercury2/src/ImageLoader.h 2009-04-26 16:46:17 UTC (rev 219)
@@ -15,29 +15,13 @@
static ImageLoader& GetInstance();
bool RegisterFactoryCallback(const MString& type, Callback1R< MercuryFile *, RawImageData* >);
RawImageData* LoadImage(const MString& filename);
- void LoadImageThreaded(MercuryAsset* t, const MString& filename);
+ void LoadImageThreaded(MercuryAsset* t);
private:
static void* ImageLoaderThread(void* d);
- std::list< std::pair< MString, Callback1R< MercuryFile*, RawImageData* > > > m_factoryCallbacks;
+ std::list< std::pair< MString, Callback1R< MercuryFile*, RawImageData* > > > m_factoryCallbacks;
};
-class ThreadData
-{
- public:
- ThreadData(ImageLoader* il, MercuryAsset* a, const MString& f)
- {
- asset = a;
- filename = f;
- imageloader = il;
- }
-
- //use and autoptr here to prevent crashes if asset is removed during load
- MAutoPtr< MercuryAsset > asset;
- MString filename;
- ImageLoader* imageloader;
-};
-
static InstanceCounter<ImageLoader> ILcounter("ImageLoader");
#define REGISTER_IMAGE_TYPE(fingerprint,functor)\
Modified: Mercury2/src/MercuryAsset.cpp
===================================================================
--- Mercury2/src/MercuryAsset.cpp 2009-04-26 15:37:56 UTC (rev 218)
+++ Mercury2/src/MercuryAsset.cpp 2009-04-26 16:46:17 UTC (rev 219)
@@ -2,7 +2,7 @@
#include <RenderableNode.h>
MercuryAsset::MercuryAsset()
- :m_isInstanced(false), m_boundingVolume(NULL)
+ :m_isInstanced(false), m_boundingVolume(NULL), m_loadState(NONE)
{
}
@@ -30,6 +30,10 @@
return m_loadState;
}
+void MercuryAsset::LoadedCallback()
+{
+ SetLoadState( LOADED );
+}
AssetFactory& AssetFactory::GetInstance()
{
Modified: Mercury2/src/MercuryAsset.h
===================================================================
--- Mercury2/src/MercuryAsset.h 2009-04-26 15:37:56 UTC (rev 218)
+++ Mercury2/src/MercuryAsset.h 2009-04-26 16:46:17 UTC (rev 219)
@@ -16,6 +16,9 @@
NONE
};
+/* Assets are stored in renderable nodes with MAuto pointers.
+The renderable nodes handle the memory management
+*/
class MercuryAsset : public RefBase, MessageHandler
{
public:
@@ -31,22 +34,36 @@
///Loads an asset from an XMLAsset representing itself
virtual void LoadFromXML(const XMLNode& node) {};
- virtual void LoadedCallback() {};
+ virtual void LoadedCallback(); //thread safe
inline void IsInstanced(bool b) { m_isInstanced = b; }
inline const BoundingVolume* GetBoundingVolume() const { return m_boundingVolume; }
+ inline const MString& Path() const { return m_path; }
protected:
- void SetLoadState(LoadState ls);
- LoadState GetLoadState();
+ void SetLoadState(LoadState ls); //thread safe
+ LoadState GetLoadState(); //thread safe
bool m_isInstanced;
BoundingVolume* m_boundingVolume;
+ MString m_path;
private:
LoadState m_loadState;
MSemaphore m_lock;
};
+class LoaderThreadData
+{
+ public:
+ LoaderThreadData(MercuryAsset* a)
+ {
+ asset = a;
+ }
+
+ //use and autoptr here to prevent crashes if asset is removed during load
+ MAutoPtr< MercuryAsset > asset;
+};
+
class AssetFactory
{
public:
@@ -62,6 +79,7 @@
std::list< std::pair< MString, Callback0R< MAutoPtr<MercuryAsset> > > > m_factoryCallbacks;
+ //the actual storage point is in renderable nodes
static std::map<MString, MercuryAsset*> m_assetInstances;
};
Modified: Mercury2/src/RenderableNode.h
===================================================================
--- Mercury2/src/RenderableNode.h 2009-04-26 15:37:56 UTC (rev 218)
+++ Mercury2/src/RenderableNode.h 2009-04-26 16:46:17 UTC (rev 219)
@@ -40,9 +40,10 @@
bool m_hidden;
private:
bool IsInAssetList(MercuryAsset* asset) const;
-
- std::list< MAutoPtr< MercuryAsset > > m_assets; ///serves as a holder for memory
+ //The asset is actually stored here
+ std::list< MAutoPtr< MercuryAsset > > m_assets;
+
//we will just use normal pointers here because we don't want to waste too much time
//dereferencing the autopointer. As a precaution when assets are added to these lists,
//they must exist in m_assets.
Modified: Mercury2/src/Texture.cpp
===================================================================
--- Mercury2/src/Texture.cpp 2009-04-26 15:37:56 UTC (rev 218)
+++ Mercury2/src/Texture.cpp 2009-04-26 16:46:17 UTC (rev 219)
@@ -24,7 +24,7 @@
Texture::~Texture()
{
- REMOVE_ASSET_INSTANCE(TEXTURE, m_filename);
+ REMOVE_ASSET_INSTANCE(TEXTURE, m_path);
if (m_textureID) glDeleteTextures(1, &m_textureID);
m_textureID = 0;
@@ -136,13 +136,13 @@
if (m_isInstanced) return;
if ( !path.empty() )
{
- ADD_ASSET_INSTANCE(Texture, path, this);
- m_filename = path;
SetLoadState(LOADING);
+ ADD_ASSET_INSTANCE(Texture, path, this);
+ m_path = path;
- MercuryThread loaderThread;
+// MercuryThread loaderThread;
// ImageLoader::LoadImageThreaded(this, m_filename );
- ImageLoader::GetInstance().LoadImageThreaded(this, m_filename );
+ ImageLoader::GetInstance().LoadImageThreaded(this);
// LoadFromRaw();
// RawImageData* d = ImageLoader::GetInstance().LoadImage( m_filename );
// if (d) LoadFromRaw( d );
@@ -150,12 +150,6 @@
}
}
-void Texture::LoadedCallback()
-{
- printf("loaded!!!!!\n");
- SetLoadState(LOADED);
-}
-
void Texture::SetRawData(RawImageData* raw)
{
SAFE_DELETE(m_raw);
@@ -170,7 +164,7 @@
MAutoPtr< Texture > Texture::LoadFromFile(const MString& path)
{
MAutoPtr< MercuryAsset > t( AssetFactory::GetInstance().Generate("Texture", path) );
- Texture *a = (Texture*)&(*t);
+ Texture *a = (Texture*)t.Ptr();
a->LoadImage( path );
return a;
}
Modified: Mercury2/src/Texture.h
===================================================================
--- Mercury2/src/Texture.h 2009-04-26 15:37:56 UTC (rev 218)
+++ Mercury2/src/Texture.h 2009-04-26 16:46:17 UTC (rev 219)
@@ -18,7 +18,6 @@
virtual void LoadFromXML(const XMLNode& node);
void LoadFromRaw();
- virtual void LoadedCallback();
inline static unsigned short NumberActiveTextures() { return m_activeTextures; }
inline static uint32_t ReadAndResetBindCount() { uint32_t t = m_textureBinds; m_textureBinds = 0; return t; }
@@ -41,7 +40,7 @@
static unsigned short m_activeTextures;
static uint32_t m_textureBinds;
- MString m_filename;
+// MString m_filename;
};
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-04-26 15:37:58
|
Revision: 218
http://hgengine.svn.sourceforge.net/hgengine/?rev=218&view=rev
Author: axlecrusher
Date: 2009-04-26 15:37:56 +0000 (Sun, 26 Apr 2009)
Log Message:
-----------
use auto pointer to protect against deleting objects while loading
Modified Paths:
--------------
Mercury2/src/ImageLoader.cpp
Mercury2/src/ImageLoader.h
Mercury2/src/MAutoPtr.h
Modified: Mercury2/src/ImageLoader.cpp
===================================================================
--- Mercury2/src/ImageLoader.cpp 2009-04-25 21:01:43 UTC (rev 217)
+++ Mercury2/src/ImageLoader.cpp 2009-04-26 15:37:56 UTC (rev 218)
@@ -8,9 +8,10 @@
{
ThreadData *pd = (ThreadData*)d;
ThreadData data = *pd;
+ Texture *texture = (Texture*)data.asset.Ptr();
delete pd;
RawImageData* imageData = data.imageloader->LoadImage( data.filename );
- ((Texture*)data.asset)->SetRawData(imageData);
+ texture->SetRawData(imageData);
data.asset->LoadedCallback();
return 0;
}
Modified: Mercury2/src/ImageLoader.h
===================================================================
--- Mercury2/src/ImageLoader.h 2009-04-25 21:01:43 UTC (rev 217)
+++ Mercury2/src/ImageLoader.h 2009-04-26 15:37:56 UTC (rev 218)
@@ -31,7 +31,9 @@
filename = f;
imageloader = il;
}
- MercuryAsset* asset;
+
+ //use and autoptr here to prevent crashes if asset is removed during load
+ MAutoPtr< MercuryAsset > asset;
MString filename;
ImageLoader* imageloader;
};
Modified: Mercury2/src/MAutoPtr.h
===================================================================
--- Mercury2/src/MAutoPtr.h 2009-04-25 21:01:43 UTC (rev 217)
+++ Mercury2/src/MAutoPtr.h 2009-04-26 15:37:56 UTC (rev 218)
@@ -114,6 +114,8 @@
inline operator const T*() const { return m_ptr; }
inline bool IsValid() { return m_ptr != NULL; } //true if valid
+
+ inline T* Ptr() { return m_ptr; }
private:
void IncrementReference() //not thread safe, must guard
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-04-25 21:01:58
|
Revision: 217
http://hgengine.svn.sourceforge.net/hgengine/?rev=217&view=rev
Author: axlecrusher
Date: 2009-04-25 21:01:43 +0000 (Sat, 25 Apr 2009)
Log Message:
-----------
Many updates focused on threaded loading.
Modified Paths:
--------------
Mercury2/src/ImageLoader.cpp
Mercury2/src/ImageLoader.h
Mercury2/src/MSemaphore.cpp
Mercury2/src/MSemaphore.h
Mercury2/src/MercuryAsset.cpp
Mercury2/src/MercuryAsset.h
Mercury2/src/MercuryNode.cpp
Mercury2/src/MercuryNode.h
Mercury2/src/MercuryString.h
Mercury2/src/Texture.cpp
Mercury2/src/Texture.h
Modified: Mercury2/src/ImageLoader.cpp
===================================================================
--- Mercury2/src/ImageLoader.cpp 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/ImageLoader.cpp 2009-04-25 21:01:43 UTC (rev 217)
@@ -1,8 +1,20 @@
#include <ImageLoader.h>
#include <MercuryUtil.h>
+#include <Texture.h>
using namespace std;
+void* ImageLoader::ImageLoaderThread(void* d)
+{
+ ThreadData *pd = (ThreadData*)d;
+ ThreadData data = *pd;
+ delete pd;
+ RawImageData* imageData = data.imageloader->LoadImage( data.filename );
+ ((Texture*)data.asset)->SetRawData(imageData);
+ data.asset->LoadedCallback();
+ return 0;
+}
+
ImageLoader& ImageLoader::GetInstance()
{
static ImageLoader* instance = NULL;
@@ -24,7 +36,7 @@
MercuryFile* f = FILEMAN.Open( filename );
char fingerprint[4];
fingerprint[3] = 0;
-
+
if( !f )
{
printf( "Error opening image: %s\n", filename.c_str() );
@@ -49,6 +61,14 @@
return NULL;
}
+void ImageLoader::LoadImageThreaded(MercuryAsset* t, const MString& filename)
+{
+ ThreadData* data = new ThreadData(this, t, filename);
+ MercuryThread loaderThread;
+ loaderThread.HaltOnDestroy(false);
+ loaderThread.Create( ImageLoader::ImageLoaderThread, data, true );
+}
+
/****************************************************************************
* Copyright (C) 2008 by Joshua Allen *
* *
Modified: Mercury2/src/ImageLoader.h
===================================================================
--- Mercury2/src/ImageLoader.h 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/ImageLoader.h 2009-04-25 21:01:43 UTC (rev 217)
@@ -7,17 +7,35 @@
#include <list>
#include <MercuryUtil.h>
+#include <MercuryAsset.h>
+
class ImageLoader
{
public:
static ImageLoader& GetInstance();
bool RegisterFactoryCallback(const MString& type, Callback1R< MercuryFile *, RawImageData* >);
RawImageData* LoadImage(const MString& filename);
-
+ void LoadImageThreaded(MercuryAsset* t, const MString& filename);
+
private:
+ static void* ImageLoaderThread(void* d);
std::list< std::pair< MString, Callback1R< MercuryFile*, RawImageData* > > > m_factoryCallbacks;
};
+class ThreadData
+{
+ public:
+ ThreadData(ImageLoader* il, MercuryAsset* a, const MString& f)
+ {
+ asset = a;
+ filename = f;
+ imageloader = il;
+ }
+ MercuryAsset* asset;
+ MString filename;
+ ImageLoader* imageloader;
+};
+
static InstanceCounter<ImageLoader> ILcounter("ImageLoader");
#define REGISTER_IMAGE_TYPE(fingerprint,functor)\
Modified: Mercury2/src/MSemaphore.cpp
===================================================================
--- Mercury2/src/MSemaphore.cpp 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/MSemaphore.cpp 2009-04-25 21:01:43 UTC (rev 217)
@@ -25,6 +25,22 @@
return __sync_add_and_fetch(&m_counter, 1);
}
+void MSemaphore::WaitAndSet(unsigned long value, unsigned long newVal)
+{
+ while ( !__sync_bool_compare_and_swap(&m_counter, value, newVal) );
+}
+
+MSemaphoreLock::MSemaphoreLock(MSemaphore* s)
+ :m_s(s)
+{
+ m_s->WaitAndSet(0,1);
+}
+
+MSemaphoreLock::~MSemaphoreLock()
+{
+ m_s->WaitAndSet(1,0);
+}
+
MSemaphoreIncOnDestroy::MSemaphoreIncOnDestroy(MSemaphore* s)
:m_s(s)
{
Modified: Mercury2/src/MSemaphore.h
===================================================================
--- Mercury2/src/MSemaphore.h 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/MSemaphore.h 2009-04-25 21:01:43 UTC (rev 217)
@@ -10,11 +10,21 @@
unsigned long ReadAndClear();
unsigned long Decrement();
unsigned long Increment();
+ void WaitAndSet(unsigned long value, unsigned long newVal);
private:
unsigned long m_counter;
};
+class MSemaphoreLock
+{
+ public:
+ MSemaphoreLock(MSemaphore* s);
+ ~MSemaphoreLock();
+ private:
+ MSemaphore* m_s;
+};
+
class MSemaphoreIncOnDestroy
{
public:
Modified: Mercury2/src/MercuryAsset.cpp
===================================================================
--- Mercury2/src/MercuryAsset.cpp 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/MercuryAsset.cpp 2009-04-25 21:01:43 UTC (rev 217)
@@ -18,6 +18,19 @@
rn->AddRender(this);
}
+void MercuryAsset::SetLoadState(LoadState ls)
+{
+ MSemaphoreLock lock( &m_lock );
+ m_loadState = ls;
+}
+
+LoadState MercuryAsset::GetLoadState()
+{
+ MSemaphoreLock lock( &m_lock );
+ return m_loadState;
+}
+
+
AssetFactory& AssetFactory::GetInstance()
{
static AssetFactory* instance = NULL;
Modified: Mercury2/src/MercuryAsset.h
===================================================================
--- Mercury2/src/MercuryAsset.h 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/MercuryAsset.h 2009-04-25 21:01:43 UTC (rev 217)
@@ -7,7 +7,15 @@
#include <map>
#include <MercuryMatrix.h>
#include <BoundingBox.h>
+#include <MSemaphore.h>
+enum LoadState
+{
+ LOADING,
+ LOADED,
+ NONE
+};
+
class MercuryAsset : public RefBase, MessageHandler
{
public:
@@ -23,12 +31,20 @@
///Loads an asset from an XMLAsset representing itself
virtual void LoadFromXML(const XMLNode& node) {};
+ virtual void LoadedCallback() {};
+
inline void IsInstanced(bool b) { m_isInstanced = b; }
inline const BoundingVolume* GetBoundingVolume() const { return m_boundingVolume; }
protected:
+ void SetLoadState(LoadState ls);
+ LoadState GetLoadState();
+
bool m_isInstanced;
BoundingVolume* m_boundingVolume;
+ private:
+ LoadState m_loadState;
+ MSemaphore m_lock;
};
class AssetFactory
Modified: Mercury2/src/MercuryNode.cpp
===================================================================
--- Mercury2/src/MercuryNode.cpp 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/MercuryNode.cpp 2009-04-25 21:01:43 UTC (rev 217)
@@ -110,6 +110,7 @@
void MercuryNode::LoadFromXML(const XMLNode& node)
{
+ SetName( node.Attribute("name") );
//Not much to do here except run through all the children nodes
for (XMLNode child = node.Child(); child.IsValid(); child = child.NextNode())
{
Modified: Mercury2/src/MercuryNode.h
===================================================================
--- Mercury2/src/MercuryNode.h 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/MercuryNode.h 2009-04-25 21:01:43 UTC (rev 217)
@@ -41,7 +41,7 @@
const std::list< MercuryNode* >& Children() const { return m_children; }
virtual void Update(float dTime) {};
- void RecursiveUpdate(float dTime);
+ virtual void RecursiveUpdate(float dTime);
void ThreadedUpdate(float dTime);
///Run on parent when a child is added
@@ -62,7 +62,9 @@
GENRTTI(MercuryNode);
inline static bool NeedsRebuild() { bool t=m_rebuildRenderGraph; m_rebuildRenderGraph = false; return t; }
-
+ inline void SetName(const MString& name) { m_name = name; }
+ inline MString GetName() const { return m_name; }
+
protected:
std::list< MercuryNode* > m_children; //These nodes are unique, not instanced
MercuryNode* m_parent;
@@ -70,6 +72,7 @@
MercuryNode* m_nextSibling;
static bool m_rebuildRenderGraph;
+ MString m_name;
};
Modified: Mercury2/src/MercuryString.h
===================================================================
--- Mercury2/src/MercuryString.h 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/MercuryString.h 2009-04-25 21:01:43 UTC (rev 217)
@@ -32,7 +32,7 @@
inline const char * c_str() const { return m_sCur; }
inline unsigned long length() const { return m_iLen; }
inline unsigned long size() const { return m_iLen; }
- inline bool empty() const { return m_iLen == 0; }
+ inline bool empty() const { return m_iLen <= 0; }
void append( const MString & app );
void append( const char app );
Modified: Mercury2/src/Texture.cpp
===================================================================
--- Mercury2/src/Texture.cpp 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/Texture.cpp 2009-04-25 21:01:43 UTC (rev 217)
@@ -41,11 +41,12 @@
rn->AddPostRender( this );
}
-void Texture::LoadFromRaw(const RawImageData* raw)
+void Texture::LoadFromRaw()
{
+ if ( !m_raw ) return;
if ( !m_textureID ) glGenTextures(1, &m_textureID);
- m_raw = raw;
+// m_raw = raw;
int ByteType;
switch (m_raw->m_ColorByteType)
@@ -90,6 +91,11 @@
void Texture::Render(const MercuryNode* node)
{
+ if (GetLoadState() == LOADED)
+ {
+ LoadFromRaw();
+ SetLoadState(NONE);
+ }
BindTexture();
}
@@ -100,7 +106,7 @@
void Texture::LoadFromXML(const XMLNode& node)
{
- LoadImage( node.Attribute("file") );
+ LoadImage( node.Attribute("file") );
}
void Texture::BindTexture()
@@ -132,11 +138,30 @@
{
ADD_ASSET_INSTANCE(Texture, path, this);
m_filename = path;
- RawImageData* d = ImageLoader::GetInstance().LoadImage( m_filename );
- if (d) LoadFromRaw( d );
+ SetLoadState(LOADING);
+
+ MercuryThread loaderThread;
+// ImageLoader::LoadImageThreaded(this, m_filename );
+ ImageLoader::GetInstance().LoadImageThreaded(this, m_filename );
+// LoadFromRaw();
+// RawImageData* d = ImageLoader::GetInstance().LoadImage( m_filename );
+// if (d) LoadFromRaw( d );
+// m_raw = d;
}
}
+void Texture::LoadedCallback()
+{
+ printf("loaded!!!!!\n");
+ SetLoadState(LOADED);
+}
+
+void Texture::SetRawData(RawImageData* raw)
+{
+ SAFE_DELETE(m_raw);
+ m_raw = raw;
+}
+
Texture* Texture::Generate()
{
return new Texture();
Modified: Mercury2/src/Texture.h
===================================================================
--- Mercury2/src/Texture.h 2009-04-25 14:20:15 UTC (rev 216)
+++ Mercury2/src/Texture.h 2009-04-25 21:01:43 UTC (rev 217)
@@ -17,13 +17,16 @@
virtual void LoadFromXML(const XMLNode& node);
- void LoadFromRaw(const RawImageData* raw);
+ void LoadFromRaw();
+ virtual void LoadedCallback();
inline static unsigned short NumberActiveTextures() { return m_activeTextures; }
inline static uint32_t ReadAndResetBindCount() { uint32_t t = m_textureBinds; m_textureBinds = 0; return t; }
static Texture* Generate();
static MAutoPtr< Texture > LoadFromFile(const MString& path);
+
+ void SetRawData(RawImageData* raw);
private:
void LoadImage(const MString& path);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-04-25 14:20:17
|
Revision: 216
http://hgengine.svn.sourceforge.net/hgengine/?rev=216&view=rev
Author: axlecrusher
Date: 2009-04-25 14:20:15 +0000 (Sat, 25 Apr 2009)
Log Message:
-----------
update method for clearing frame buffer
Modified Paths:
--------------
Mercury2/src/Mercury2.cpp
Mercury2/src/MercuryWindow.h
Mercury2/src/Viewport.cpp
Mercury2/src/X11Window.cpp
Mercury2/src/X11Window.h
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-04-24 02:03:21 UTC (rev 215)
+++ Mercury2/src/Mercury2.cpp 2009-04-25 14:20:15 UTC (rev 216)
@@ -73,7 +73,7 @@
renderGraph.Build(root);
}
-
+ w->Clear();
renderGraph.Render();
// RenderableNode::RecursiveRender(root);
w->SwapBuffers();
Modified: Mercury2/src/MercuryWindow.h
===================================================================
--- Mercury2/src/MercuryWindow.h 2009-04-24 02:03:21 UTC (rev 215)
+++ Mercury2/src/MercuryWindow.h 2009-04-25 14:20:15 UTC (rev 216)
@@ -26,6 +26,8 @@
virtual void* GetProcAddress(const MString& x) = 0;
+ virtual void Clear() = 0;
+
inline int Width() const { return m_width; }
inline int Height() const { return m_height; }
Modified: Mercury2/src/Viewport.cpp
===================================================================
--- Mercury2/src/Viewport.cpp 2009-04-24 02:03:21 UTC (rev 215)
+++ Mercury2/src/Viewport.cpp 2009-04-25 14:20:15 UTC (rev 216)
@@ -17,7 +17,6 @@
MercuryWindow* w = MercuryWindow::GetCurrentWindow();
glViewport(m_minx, m_miny, w->Width()*m_xFactor, w->Height()*m_yFactor);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
MercuryMatrix f = m_frustum.GetMatrix();
Modified: Mercury2/src/X11Window.cpp
===================================================================
--- Mercury2/src/X11Window.cpp 2009-04-24 02:03:21 UTC (rev 215)
+++ Mercury2/src/X11Window.cpp 2009-04-25 14:20:15 UTC (rev 216)
@@ -156,6 +156,11 @@
return true;
}
+void X11Window::Clear()
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+}
+
void* X11Window::GetProcAddress(const MString& x)
{
return NULL;
Modified: Mercury2/src/X11Window.h
===================================================================
--- Mercury2/src/X11Window.h 2009-04-24 02:03:21 UTC (rev 215)
+++ Mercury2/src/X11Window.h 2009-04-25 14:20:15 UTC (rev 216)
@@ -18,6 +18,8 @@
virtual bool PumpMessages();
virtual void* GetProcAddress(const MString& x);
+
+ virtual void Clear();
private:
Display* m_display;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2009-04-24 02:03:30
|
Revision: 215
http://hgengine.svn.sourceforge.net/hgengine/?rev=215&view=rev
Author: cnlohr
Date: 2009-04-24 02:03:21 +0000 (Fri, 24 Apr 2009)
Log Message:
-----------
oops forgot to commit
Modified Paths:
--------------
Mercury2/adv_set.c
Mercury2/base_set.sh
Modified: Mercury2/adv_set.c
===================================================================
--- Mercury2/adv_set.c 2009-04-18 13:44:00 UTC (rev 214)
+++ Mercury2/adv_set.c 2009-04-24 02:03:21 UTC (rev 215)
@@ -10,7 +10,7 @@
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/MercuryTimer.cpp src/MercuryMessageManager.cpp src/MercuryVertex.cpp \
- src/MercuryPlane.cpp src/BoundingBox.cpp src/Shader.cpp src/RenderGraph.cpp"
+ src/MercuryPlane.cpp src/BoundingBox.cpp src/Shader.cpp src/RenderGraph.cpp src/Frustum.cpp"
SOURCES="$SOURCES src/MercuryFileDriverDirect.cpp src/MercuryFileDriverMem.cpp \
src/MercuryFileDriverPacked.cpp src/MercuryFileDriverZipped.cpp"
Modified: Mercury2/base_set.sh
===================================================================
--- Mercury2/base_set.sh 2009-04-18 13:44:00 UTC (rev 214)
+++ Mercury2/base_set.sh 2009-04-24 02:03:21 UTC (rev 215)
@@ -63,10 +63,10 @@
if test $OPT_OGL = 1; then
NEED_H="GL/gl.h"
- NEED_L="$NEED_L GL"
+ NEED_L="$NEED_L GL GLU"
fi
-if test $OPT_ss = 1; then
+if test $OPT_sse = 1; then
DEFINES="$DEFINES USE_SSE"
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Charles L. <cn...@us...> - 2009-04-22 06:42:27
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4319 Modified Files: BetaBetaMari.cpp Log Message: fix "pow" ambiguity on Windows Index: BetaBetaMari.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/BetaBetaMari.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** BetaBetaMari.cpp 22 Apr 2009 06:01:33 -0000 1.27 --- BetaBetaMari.cpp 22 Apr 2009 06:42:24 -0000 1.28 *************** *** 40,44 **** //Generate the new ball collision object ! m_pSph = dCreateSphere( m_oSpace, pow( fMariSize, 0.56)*1.1+1 ); dGeomSetData( m_pSph, this ); dGeomSetBody( m_pSph, m_oBody ); --- 40,44 ---- //Generate the new ball collision object ! m_pSph = dCreateSphere( m_oSpace, pow( fMariSize, 0.56f)*1.1f+1 ); dGeomSetData( m_pSph, this ); dGeomSetBody( m_pSph, m_oBody ); *************** *** 48,52 **** { //Generate the ball itself, and attach it to the local space ! m_pSph = dCreateSphere( m_oSpace, pow( fMariSize, 0.56 )+1 ); dGeomSetBody( m_pSph, m_oBody ); dGeomSetData( m_pSph, this ); --- 48,52 ---- { //Generate the ball itself, and attach it to the local space ! m_pSph = dCreateSphere( m_oSpace, pow( fMariSize, 0.56f )+1 ); dGeomSetBody( m_pSph, m_oBody ); dGeomSetData( m_pSph, this ); *************** *** 184,188 **** // LOG.Log( ssprintf( "minsize: %f", pow( fMariSize, 0.56 ) / 2.9 ) ); //Make sure we're allowed to suck it up ! if ( fSizeHit == 0 || fSizeHit > pow( fMariSize, 0.56 ) / 2.9 ) return true; --- 184,188 ---- // LOG.Log( ssprintf( "minsize: %f", pow( fMariSize, 0.56 ) / 2.9 ) ); //Make sure we're allowed to suck it up ! if ( fSizeHit == 0 || fSizeHit > pow( fMariSize, 0.56f ) / 2.9f ) return true; |
|
From: Charles L. <cn...@us...> - 2009-04-22 06:23:37
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2633 Modified Files: MercuryThreads.cpp Log Message: Unicode is OFF in HG1 Index: MercuryThreads.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryThreads.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** MercuryThreads.cpp 17 Apr 2009 11:21:38 -0000 1.23 --- MercuryThreads.cpp 22 Apr 2009 06:23:33 -0000 1.24 *************** *** 187,191 **** p->bInheritHandle = true; p->lpSecurityDescriptor = NULL; ! m_mutex = CreateMutex( p, true, (LPCWSTR)m_name.c_str() ); free( p ); return (int)m_mutex; --- 187,191 ---- p->bInheritHandle = true; p->lpSecurityDescriptor = NULL; ! m_mutex = CreateMutex( p, true, (LPCSTR)m_name.c_str() ); free( p ); return (int)m_mutex; |
|
From: Charles L. <cn...@us...> - 2009-04-22 06:22:29
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2543/src Modified Files: ScreenODETest.cpp ScreenODETest.h Log Message: better beta Index: ScreenODETest.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/ScreenODETest.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ScreenODETest.cpp 5 Sep 2007 00:49:36 -0000 1.36 --- ScreenODETest.cpp 22 Apr 2009 06:22:26 -0000 1.37 *************** *** 55,58 **** --- 55,59 ---- DISPLAY->AddLight(&m_light); + m_pLastAt = MercuryPoint( 0, 0, 0 ); m_bFirstUpdate=true; } *************** *** 60,63 **** --- 61,83 ---- void ScreenODETest::Update( const float dTime ) { + MercuryODEObject * c = m_pWorld.GetODEObjectByName( "Control" ); + + int x, y; + INPUTMAN->GetCursorPosition(x, y); + m_pCamera->Tweening.StopTweening(); + + //The tween adjusts the eye, up never changes, and center is always the control object + m_pCamera->Tweening.AddCommand( ssprintf( "linear,0.4;x,%f;y,%f;z,%f;", + c->GetX()+COS(float(x)/300)*70, + c->GetY()+SIN(float(x)/300)*70, + c->GetZ()+(float(y)/300)*70) ); + + //Tricky - we want to slosh around some. Mix last frame's at with this frame's + float dt = (dTime > 0.2)?0.2:dTime; + dt *= 5.; + m_pLastAt = m_pLastAt * (1.-dt) + c->GetPosition() * dt; + m_pCamera->SetTarget(m_pLastAt); + + MercuryScreen::Update( dTime ); if ( m_bFirstUpdate ) *************** *** 89,110 **** dBodySetForce( z->GetBody(), COS(RealAngle)*Amplitude,SIN(RealAngle)*Amplitude,0); - MercuryODEObject * c = m_pWorld.GetODEObjectByName( "Control" ); - - int x, y; - INPUTMAN->GetCursorPosition(x, y); - m_pCamera->Tweening.StopTweening(); - - //The tween adjusts the eye, up never changes, and center is always the control object - m_pCamera->Tweening.AddCommand( ssprintf( "linear,0.4;x,%f;y,%f;z,%f;", - c->GetX()+COS(float(x)/300)*70, - c->GetY()+SIN(float(x)/300)*70, - c->GetZ()+(float(y)/300)*70) ); - m_pCamera->SetTarget(c->GetPosition()); } ! void ScreenODETest::Draw() { ! ! MercuryScreen::Draw(); } --- 109,117 ---- dBodySetForce( z->GetBody(), COS(RealAngle)*Amplitude,SIN(RealAngle)*Amplitude,0); } ! void ScreenODETest::Render() { ! MercuryScreen::Render(); } Index: ScreenODETest.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/ScreenODETest.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ScreenODETest.h 5 Nov 2006 06:21:47 -0000 1.15 --- ScreenODETest.h 22 Apr 2009 06:22:26 -0000 1.16 *************** *** 17,21 **** virtual void Init(); virtual void Update( const float dTime ); ! virtual void Draw(); void SendInfo( const MString & name ); --- 17,21 ---- virtual void Init(); virtual void Update( const float dTime ); ! virtual void Render(); void SendInfo( const MString & name ); *************** *** 24,27 **** --- 24,28 ---- MercuryLight m_light; MercuryODEWorld m_pWorld; + MercuryPoint m_pLastAt; MercuryShape m_shpGround; bool m_bFirstUpdate; |
|
From: Charles L. <cn...@us...> - 2009-04-22 06:01:39
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1194 Modified Files: BetaBetaMari.cpp Log Message: tweak direction Index: BetaBetaMari.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/BetaBetaMari.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** BetaBetaMari.cpp 20 Apr 2009 21:37:49 -0000 1.26 --- BetaBetaMari.cpp 22 Apr 2009 06:01:33 -0000 1.27 *************** *** 138,143 **** --- 138,147 ---- DX = DXO; + //Move it in some. + DX *= 0.95; //Set the position of the newly attached object dGeomSetPosition( pHit2->m_vAllTransforms[i], DX.x, DX.y,DX.z ); + pHit2->SetRotX( rand()%360 ); + pHit2->SetRotY( rand()%360 ); } *************** *** 177,182 **** float fSizeHit = pHit->GetParameter( "Size" ).GetValueF(); ! if( fSizeHit != 0 ) ! LOG.Log( ssprintf( "minsize: %f", pow( fMariSize, 0.56 ) / 2.9 ) ); //Make sure we're allowed to suck it up if ( fSizeHit == 0 || fSizeHit > pow( fMariSize, 0.56 ) / 2.9 ) --- 181,186 ---- float fSizeHit = pHit->GetParameter( "Size" ).GetValueF(); ! // if( fSizeHit != 0 ) ! // LOG.Log( ssprintf( "minsize: %f", pow( fMariSize, 0.56 ) / 2.9 ) ); //Make sure we're allowed to suck it up if ( fSizeHit == 0 || fSizeHit > pow( fMariSize, 0.56 ) / 2.9 ) |
|
From: Charles L. <cn...@us...> - 2009-04-21 06:36:45
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24503 Modified Files: MercuryLoadableModel.h Log Message: Add handle acquition to loadable Models Index: MercuryLoadableModel.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryLoadableModel.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** MercuryLoadableModel.h 7 Sep 2007 05:55:33 -0000 1.15 --- MercuryLoadableModel.h 21 Apr 2009 06:36:32 -0000 1.16 *************** *** 32,35 **** --- 32,38 ---- ///Retrieve all animation states into a vector void GetAllAnimationStates( MVector < LoadableModelAnimationInfo > & AnimationInfos ) { AnimationInfos = m_vAnimationInfos; } + + inline MVector< LoadableModelAnimationInfo > * GetAnimationHandle() { return &m_vAnimationInfos; } + CLASS_RTTI( MercuryLoadableModel, MercuryModel ); private: |
|
From: Charles L. <cn...@us...> - 2009-04-21 05:06:35
|
Update of /cvsroot/hgengine/Mercury/Util/ModelOptimizer In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16703 Modified Files: ModelContainer.h main.cpp Added Files: Makefile smoother.cpp Removed Files: compile.sh Log Message: update and add smoother ---------------------------------------------------------------------- Index: ModelContainer.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/Util/ModelOptimizer/ModelContainer.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ModelContainer.h 29 Sep 2008 20:59:23 -0000 1.6 --- ModelContainer.h 21 Apr 2009 05:06:23 -0000 1.7 *************** *** 12,15 **** --- 12,28 ---- struct Vert { + bool operator < ( const Vert & rhs ) const + { + if( pPosition.z != rhs.pPosition.z ) + return pPosition.z < rhs.pPosition.z; + if( pPosition.y != rhs.pPosition.y ) + return pPosition.y < rhs.pPosition.y; + if( pPosition.x != rhs.pPosition.x ) + return pPosition.x < rhs.pPosition.x; + if( uv[0] != rhs.uv[0] ) + return uv[0] < uv[0]; + return uv[1] < uv[1]; + } + float uv[2]; MercuryPoint pNormal; --- NEW FILE: Makefile --- all : optimizer smoother CXXFLAGS:=-g -I../../src optimizer : ModelContainer.o main.o StripAndFanner.o ../../src/MercuryMath.o ../../src/MercuryMatrix.o ../../src/MercuryTypes.o g++ -o $@ $^ $(CXXFLAGS) smoother : ModelContainer.o smoother.o StripAndFanner.o ../../src/MercuryMath.o ../../src/MercuryMatrix.o ../../src/MercuryTypes.o g++ -o $@ $^ $(CXXFLAGS) clean : rm -f *.o *~ optimizer smoother --- NEW FILE: smoother.cpp --- #include "ModelContainer.h" #include "StripAndFanner.h" #include <vector> #include <map> using namespace std; #define MINIMUM_WEIGHT 0.001 #define MINIMUM_TO_CREATE_STATIC_MESH 16 #define MINIMUM_TO_CREATE_BONE_MESH 9 //Model optimizer by Charles Lohr. /* The purpose of this application is to take an existing model, in hgmdl format and then figure out the best way to minimize the noncached faces and verticies. There's a bit of stuff left to do: 1: Allow creation of static meshes. Currently, it only uncaches bones. 2: Allow destruction of entire meshes, once they're empty. 3: Pay attention to materials more closely. */ struct IntegerPair { IntegerPair() { A = -1; B = -1; } IntegerPair( int a, int b ) { A = a; B = b; } int A; int B; bool operator == ( const IntegerPair & rhs ) { return (rhs.A == A)&&(rhs.B == B ); } }; int main( int argc, char ** argv ) { Model c; unsigned i,j,k,l; int iTotalVerts = 0; int iTotalFaces = 0; int iTotalAssignments = 0; if ( argc != 3 ) { printf( "Usage: smoother <infile> <outfile>\n" ); return -1; } printf( "Loading Model.\n" ); c.LoadModel( argv[1] ); for( i = 0; i < c.vBones.size(); i++ ) iTotalAssignments += c.vBones[i].vAssignments.size(); printf( "Model Loaded.\n" ); printf( " Animations: %d\n", c.vAnimations.size() ); for( i = 0; i < c.vAnimations.size(); i++ ) printf( " %02d: %s %f\n", i, c.vAnimations[i].sName.c_str(), c.vAnimations[i].fDuration ); printf( " Bones: %d\n", c.vBones.size() ); printf( " Assignments:%d\n", iTotalAssignments ); printf( " Materials: %d\n", c.vMaterials.size() ); printf( " Meshes: %d\n", c.vMeshes.size() ); for( i = 0; i < c.vMeshes.size(); i++ ) { printf( " %03d: [%d] [%d] [%d] [%d] [%d]\n", i, c.vMeshes[i].vTriangles.size(), c.vMeshes[i].vVerticies.size(), c.vMeshes[i].bCache, c.vMeshes[i].iMaterialNumber, c.vMeshes[i].iBoneAttached ); iTotalVerts += c.vMeshes[i].vVerticies.size(); iTotalFaces += c.vMeshes[i].vTriangles.size(); } printf( " Faces: %d\n", iTotalFaces ); printf( " Verts: %d\n", iTotalVerts ); for( i = 0; i < c.vMeshes.size(); i++ ) { vector< int > m_vAllMap; map< Vert, int > m_mAllVerts; vector< Vert > m_vNewVerts; m_mAllVerts.clear(); Mesh & m = c.vMeshes[i]; m_vAllMap.resize( m.vVerticies.size() ); int curVert = 0; for( int j = 0; j < m.vVerticies.size(); j++ ) { Vert v = m.vVerticies[j]; if( m_mAllVerts.find( v ) == m_mAllVerts.end() ) { m_mAllVerts[v] = curVert; m_vAllMap[j] = curVert; m_vNewVerts.push_back( v ); curVert++; } else { m_vAllMap[j] = m_mAllVerts[v]; } } //Now we have a map of all condensed vertices. //Update all bones who use this vertex. for( int j = 0; j < c.vBones.size(); j++ ) { Bone & b = c.vBones[j]; //Skip meshes that are exclusive if( b.iAssociatedMesh != -1 ) continue; vector< BoneAssignment > vNewAssignments; map< int, int > mHitAssignment; for( int k = 0; k < b.vAssignments.size(); k++ ) { BoneAssignment & ba = b.vAssignments[k]; //If it's not in our mesh, keep looking. if( ba.iMesh != i ) { vNewAssignments.push_back( ba ); continue; } //Already hit. if( mHitAssignment[ba.iVertex] != 0 ) continue; ba.iVertex = m_vAllMap[ba.iVertex]; vNewAssignments.push_back( ba ); } b.vAssignments = vNewAssignments; } //Update my triangles for( int j = 0; j < m.vTriangles.size(); j++ ) { Triangle & t = m.vTriangles[j]; for( int k = 0; k < 3; k++ ) { t.iFace[k] = m_vAllMap[t.iFace[k]]; } } printf( " %02d: %d -> %d\n", i, m.vVerticies.size(), m_vNewVerts.size() ); //Update the output vertices. m.vVerticies = m_vNewVerts; } printf( "Saving Model.\n" ); c.SaveModel( argv[2] ); printf( "Model Saved. Exiting.\n" ); return 0; } /* * (c) 2006 Charles Lohr * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, and/or sell copies of the Software, and to permit persons to * whom the Software is furnished to do so, provided that the above * copyright notice(s) and this permission notice appear in all copies of * the Software and that both the above copyright notice(s) and this * permission notice appear in supporting documentation. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ --- compile.sh DELETED --- Index: main.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/Util/ModelOptimizer/main.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** main.cpp 21 Apr 2009 03:41:23 -0000 1.11 --- main.cpp 21 Apr 2009 05:06:23 -0000 1.12 *************** *** 52,61 **** c.LoadModel( argv[1] ); - // StripAndFanner F; - // F.AttachToMesh( &c.vMeshes[0], 0 ); - // F.Go(); - - // return 0; - for( i = 0; i < c.vBones.size(); i++ ) --- 52,55 ---- |
|
From: Charles L. <cn...@us...> - 2009-04-21 04:05:26
|
Update of /cvsroot/hgengine/Mercury/Util/B3DToHG In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv14164/B3DToHG Modified Files: Makefile anims.txt main.cpp Log Message: Fix up B3D Exporter Index: anims.txt =================================================================== RCS file: /cvsroot/hgengine/Mercury/Util/B3DToHG/anims.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** anims.txt 29 Sep 2008 21:00:43 -0000 1.1 --- anims.txt 21 Apr 2009 04:05:15 -0000 1.2 *************** *** 1,2 **** ! CROSS 7 114 5 ! WALK 210 234 2 --- 1,3 ---- ! overhand 1 35 1.5 ! walk 45 62 1.5 ! swipe 65 94 2 Index: main.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/Util/B3DToHG/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cpp 29 Sep 2008 21:00:45 -0000 1.1 --- main.cpp 21 Apr 2009 04:05:15 -0000 1.2 *************** *** 2,5 **** --- 2,7 ---- #include <map> #include <math.h> + #include <stdlib.h> + #include <string.h> FILE * fout; *************** *** 424,427 **** --- 426,435 ---- void WriteMats() { + if( gB3D.Textures.size() == 0 ) + { + printf( "0 textures were found. Making a fake one.\n" ); + gB3D.Textures.resize( 1 ); + gB3D.Textures[0].name = outputfname + ".png"; + } Write( gB3D.Textures.size() ); for( int i = 0; i < gB3D.Textures.size(); i++ ) Index: Makefile =================================================================== RCS file: /cvsroot/hgengine/Mercury/Util/B3DToHG/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 29 Sep 2008 21:00:42 -0000 1.1 --- Makefile 21 Apr 2009 04:05:15 -0000 1.2 *************** *** 5,7 **** clean : ! rm *.o *~ -rf --- 5,12 ---- clean : ! rm *.o *~ -rf b3dtest ! ! export : ! ./b3dtest ../3ds_gunther/guntherAnimationsAll.b3d gunther_anim.hgmdl objdefault anims.txt ! cp gunther_anim.hgmdl ../../game/Themes/default/Models/ ! # cp gunther_anim.hgmdl0.ini ../../game/Themes/default/Models/ |
|
From: Charles L. <cn...@us...> - 2009-04-21 03:41:35
|
Update of /cvsroot/hgengine/Mercury/Util/ModelOptimizer In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10511 Modified Files: compile.sh main.cpp Log Message: fix model optimizer Index: main.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/Util/ModelOptimizer/main.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** main.cpp 29 Sep 2008 20:59:23 -0000 1.10 --- main.cpp 21 Apr 2009 03:41:23 -0000 1.11 *************** *** 6,10 **** using namespace std; ! #define MINIMUM_WEIGHT 0.0005 #define MINIMUM_TO_CREATE_STATIC_MESH 16 #define MINIMUM_TO_CREATE_BONE_MESH 9 --- 6,10 ---- using namespace std; ! #define MINIMUM_WEIGHT 0.001 #define MINIMUM_TO_CREATE_STATIC_MESH 16 #define MINIMUM_TO_CREATE_BONE_MESH 9 *************** *** 58,66 **** // return 0; - for( i = 0; i < c.vMeshes.size(); i++ ) - { - iTotalVerts += c.vMeshes[i].vVerticies.size(); - iTotalFaces += c.vMeshes[i].vTriangles.size(); - } for( i = 0; i < c.vBones.size(); i++ ) --- 58,61 ---- *************** *** 69,76 **** --- 64,79 ---- printf( "Model Loaded.\n" ); printf( " Animations: %d\n", c.vAnimations.size() ); + for( i = 0; i < c.vAnimations.size(); i++ ) + printf( " %02d: %s %f\n", i, c.vAnimations[i].sName.c_str(), c.vAnimations[i].fDuration ); printf( " Bones: %d\n", c.vBones.size() ); printf( " Assignments:%d\n", iTotalAssignments ); printf( " Materials: %d\n", c.vMaterials.size() ); printf( " Meshes: %d\n", c.vMeshes.size() ); + for( i = 0; i < c.vMeshes.size(); i++ ) + { + printf( " %03d: [%d] [%d] [%d] [%d] [%d]\n", i, c.vMeshes[i].vTriangles.size(), c.vMeshes[i].vVerticies.size(), c.vMeshes[i].bCache, c.vMeshes[i].iMaterialNumber, c.vMeshes[i].iBoneAttached ); + iTotalVerts += c.vMeshes[i].vVerticies.size(); + iTotalFaces += c.vMeshes[i].vTriangles.size(); + } printf( " Faces: %d\n", iTotalFaces ); printf( " Verts: %d\n", iTotalVerts ); *************** *** 244,248 **** for( k = 0; k < 3; k++ ) { ! for( int l = 0; l < vBoneExclusiveVertexCounts[iThisBone].size(); l++ ) if( vBoneExclusiveVertexCounts[iThisBone][l] == IntegerPair( i, c.vMeshes[i].vTriangles[j].iFace[k] ) ) break; --- 247,252 ---- for( k = 0; k < 3; k++ ) { ! int l; ! for( l = 0; l < vBoneExclusiveVertexCounts[iThisBone].size(); l++ ) if( vBoneExclusiveVertexCounts[iThisBone][l] == IntegerPair( i, c.vMeshes[i].vTriangles[j].iFace[k] ) ) break; Index: compile.sh =================================================================== RCS file: /cvsroot/hgengine/Mercury/Util/ModelOptimizer/compile.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** compile.sh 29 Sep 2008 20:59:23 -0000 1.1 --- compile.sh 21 Apr 2009 03:41:23 -0000 1.2 *************** *** 1 **** ! g++ ModelContainer.cpp StripAndFanner.cpp main.cpp -I../../src -o optimizer ../../src/MercuryMath.cpp ../../src/MercuryMatrix.cpp ../../src/MercuryTypes.cpp --- 1 ---- ! g++ ModelContainer.cpp StripAndFanner.cpp main.cpp -I../../src -o optimizer ../../src/MercuryMath.cpp ../../src/MercuryMatrix.cpp ../../src/MercuryTypes.cpp -g |
|
From: Charles L. <cn...@us...> - 2009-04-20 21:38:02
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19703 Modified Files: BetabetaMari.h BetaBetaMari.cpp Log Message: fix up Index: BetabetaMari.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/BetabetaMari.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** BetabetaMari.h 5 Sep 2007 01:10:20 -0000 1.10 --- BetabetaMari.h 20 Apr 2009 21:37:49 -0000 1.11 *************** *** 25,28 **** --- 25,30 ---- //Is this the first update? bool m_bFirstUpdate; + MercuryPoint pLastGood; + MQuaternion qLastGood; }; Index: BetaBetaMari.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/BetaBetaMari.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** BetaBetaMari.cpp 5 Sep 2007 01:10:20 -0000 1.25 --- BetaBetaMari.cpp 20 Apr 2009 21:37:49 -0000 1.26 *************** *** 2,5 **** --- 2,6 ---- #include "MercuryMath.h" #include "MercuryTheme.h" + #include "MercuryLog.h" #define MC_INPUTMAPPED 1 //convention: MESSAGE CODE *************** *** 39,43 **** //Generate the new ball collision object ! m_pSph = dCreateSphere( m_oSpace, SQRT( fMariSize )+1 ); dGeomSetData( m_pSph, this ); dGeomSetBody( m_pSph, m_oBody ); --- 40,44 ---- //Generate the new ball collision object ! m_pSph = dCreateSphere( m_oSpace, pow( fMariSize, 0.56)*1.1+1 ); dGeomSetData( m_pSph, this ); dGeomSetBody( m_pSph, m_oBody ); *************** *** 47,51 **** { //Generate the ball itself, and attach it to the local space ! m_pSph = dCreateSphere( m_oSpace, SQRT( fMariSize ) + 1 ); dGeomSetBody( m_pSph, m_oBody ); dGeomSetData( m_pSph, this ); --- 48,52 ---- { //Generate the ball itself, and attach it to the local space ! m_pSph = dCreateSphere( m_oSpace, pow( fMariSize, 0.56 )+1 ); dGeomSetBody( m_pSph, m_oBody ); dGeomSetData( m_pSph, this ); *************** *** 57,60 **** --- 58,81 ---- } + const float * fPos = dBodyGetPosition( GetBody() ); + if( fPos[0] > -1500 && fPos[0] < 1500 && ( fPos[0]>0 || fPos[0]<0 )&& !( fPos[0]>0&&fPos[0]<=0) ) + { + pLastGood = MercuryPoint( fPos ); + qLastGood = MQuaternion( (float*) dBodyGetQuaternion( GetBody() ) ); + dBodySetFiniteRotationMode( GetBody(), false ); + } + else + { + pLastGood.z += 0.1; + dBodySetPosition( GetBody(), pLastGood.x, pLastGood.y, pLastGood.z ); + qLastGood.x += 0.1; qLastGood.y += 0.01; + qLastGood = qLastGood.normalize(); + dBodySetQuaternion( GetBody(), &qLastGood.w ); + dBodySetFiniteRotationMode( GetBody(), true ); + + dBodySetLinearVel( GetBody(), 0, 0, 0 ); + dBodySetAngularVel( GetBody(), 0, 0, 0 ); + } + //Continue update cycle MercuryODEObjectLoadable::Update( dTime ); *************** *** 67,71 **** MercuryODEObjectLoadable* pHit2 = (MercuryODEObjectLoadable*)data.PeekItem(5).GetValueV(); MercuryODEWorld* pWorld = (MercuryODEWorld*)data.PeekItem(4).GetValueV(); - fMariSize += data.PeekItem().GetValueF(); //Increase the size of our mari MercuryPoint DX(data.PeekItem(3).GetValueF(), --- 88,91 ---- *************** *** 73,84 **** data.PeekItem(1).GetValueF()); //Get the position of the contact DX = DX - GetPosition(); //And find the relative position - //Verify that we didn't get a bogus hit. - if( (SQRT( fMariSize )+1) * 1.1 < DX.Magnitude() ) - return; - // stick->Play(); //Begin dismantling the hit object --- 93,111 ---- data.PeekItem(1).GetValueF()); + + //Verify that we didn't get a bogus hit. //this doesn't seem to work + // if( (pow( fMariSize, 0.56 )+1) * 1.1 < DX.Magnitude() ) + // return; + + fMariSize += data.PeekItem().GetValueF(); //Increase the size of our mari + //Get the position of the contact DX = DX - GetPosition(); //And find the relative position // stick->Play(); + //Destroy it's body information + if (pHit2->GetBody()) + dBodyDestroy( pHit2->GetBody() ); + //Begin dismantling the hit object *************** *** 125,132 **** pHit2->m_bBodied = false; - //Destroy it's body information - if (pHit2->GetBody()) - dBodyDestroy( pHit2->GetBody() ); - //Clean out the old object pHit2->m_vAllGeoms.clear(); --- 152,155 ---- *************** *** 140,145 **** MercuryODEObjectLoadable * pHit2 = (MercuryODEObjectLoadable*)pHit; ! if ( !pHit2->m_bBodied ) //Make sure what we are colliding with has a body, otherwise act normally ! return true; if ( pHit == this ) //If we're colliding with part of ourself, ignore. return false; --- 163,168 ---- MercuryODEObjectLoadable * pHit2 = (MercuryODEObjectLoadable*)pHit; ! // if ( !pHit2->m_bBodied ) //Make sure what we are colliding with has a body, otherwise act normally ! // return true; if ( pHit == this ) //If we're colliding with part of ourself, ignore. return false; *************** *** 154,159 **** float fSizeHit = pHit->GetParameter( "Size" ).GetValueF(); //Make sure we're allowed to suck it up ! if ( fSizeHit == 0 || fSizeHit > SQRT( fMariSize ) / 2.9 ) return true; --- 177,184 ---- float fSizeHit = pHit->GetParameter( "Size" ).GetValueF(); + if( fSizeHit != 0 ) + LOG.Log( ssprintf( "minsize: %f", pow( fMariSize, 0.56 ) / 2.9 ) ); //Make sure we're allowed to suck it up ! if ( fSizeHit == 0 || fSizeHit > pow( fMariSize, 0.56 ) / 2.9 ) return true; |
|
From: <axl...@us...> - 2009-04-18 13:47:12
|
Revision: 214
http://hgengine.svn.sourceforge.net/hgengine/?rev=214&view=rev
Author: axlecrusher
Date: 2009-04-18 13:44:00 +0000 (Sat, 18 Apr 2009)
Log Message:
-----------
search up parent tree first, then down
Modified Paths:
--------------
Mercury2/src/XMLParser.cpp
Mercury2/src/XMLParser.h
Modified: Mercury2/src/XMLParser.cpp
===================================================================
--- Mercury2/src/XMLParser.cpp 2009-04-14 01:04:54 UTC (rev 213)
+++ Mercury2/src/XMLParser.cpp 2009-04-18 13:44:00 UTC (rev 214)
@@ -117,12 +117,24 @@
if (d)
{
- //start searching at the root
- XMLNode root( xmlDocGetRootElement(m_doc), m_doc );
+ MString path((const char*)d);
+
+ int pos = path.find(".");
+ MString name = pos<=0?path:path.substr(0, pos);
+ MString rpath = pos<=0?"":path.substr(pos+1); //skip the period
+
+ XMLNode parent = FindParentWithName( name );
+ if ( !parent.IsValid() )
+ {
+ //nothing found, do search down from root
+ parent = XMLNode( xmlDocGetRootElement(m_doc), m_doc );
+ rpath = path;
+ }
+
//prevent infinite recursion on self
- if ( root.m_node != m_node )
+ if ( parent.m_node != m_node )
{
- n = root.RecursiveFindFallbackNode( MString((const char*)d) );
+ n = parent.RecursiveFindFallbackNode( rpath );
}
xmlFree(d);
}
@@ -130,6 +142,19 @@
return n;
}
+XMLNode XMLNode::FindParentWithName(const MString& name) const
+{
+ if ( (!name.empty()) && (m_node->parent) )
+ {
+ XMLNode parent(m_node->parent, m_doc);
+ if (parent.Attribute("name") == name)
+ return parent;
+ return parent.FindParentWithName( name );
+ }
+ return XMLNode();
+}
+
+
XMLNode XMLNode::RecursiveFindFallbackNode(const MString& path) const
{
if ( !IsValid() ) return XMLNode();
Modified: Mercury2/src/XMLParser.h
===================================================================
--- Mercury2/src/XMLParser.h 2009-04-14 01:04:54 UTC (rev 213)
+++ Mercury2/src/XMLParser.h 2009-04-18 13:44:00 UTC (rev 214)
@@ -37,6 +37,7 @@
const XMLNode& operator=(const XMLNode& n);
private:
XMLNode RecursiveFindFallbackNode(const MString& path) const;
+ XMLNode FindParentWithName(const MString& name) const;
xmlNode* m_node;
xmlDoc* m_doc; //parent doc, don't free
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Charles L. <cn...@us...> - 2009-04-17 17:33:30
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31290/src Modified Files: ImageLoaders.cpp Log Message: Force use of RGBA over RGB. There's enough systems that have serious trouble with this so we are going to have to scrap it. This converts all images to RGBA before handing them off to the rest of the engine. Index: ImageLoaders.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/ImageLoaders.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ImageLoaders.cpp 6 Aug 2007 20:25:46 -0000 1.13 --- ImageLoaders.cpp 17 Apr 2009 17:33:19 -0000 1.14 *************** *** 105,112 **** png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); ! if (color_type & PNG_COLOR_MASK_ALPHA) ! image->attrs.m_ColorByteType = RGBA; ! else ! image->attrs.m_ColorByteType = RGB; // SAFE_DELETE(texture->m_data); --- 105,109 ---- png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); ! image->attrs.m_ColorByteType = RGBA; // SAFE_DELETE(texture->m_data); *************** *** 114,120 **** image->data = new unsigned char[sizeof(unsigned char) * image->attrs.m_height * image->attrs.m_width * 4]; ! switch (image->attrs.m_ColorByteType) { - case RGBA: for ( y=0; y < (unsigned)image->attrs.m_height; ++y) { png_byte* row = row_pointers[y]; --- 111,116 ---- image->data = new unsigned char[sizeof(unsigned char) * image->attrs.m_height * image->attrs.m_width * 4]; ! if( color_type & PNG_COLOR_MASK_ALPHA ) { for ( y=0; y < (unsigned)image->attrs.m_height; ++y) { png_byte* row = row_pointers[y]; *************** *** 127,146 **** } } ! break; ! case RGB: for ( y=0; y < (unsigned)image->attrs.m_height; y++) { png_byte* row = row_pointers[y]; for (int x=0; x<image->attrs.m_width; x++) { png_byte* ptr = &(row[x * 3]); ! image->data[(x + y * image->attrs.m_width) * 3] = ptr[0]; ! image->data[(x + y * image->attrs.m_width) * 3 + 1] = ptr[1]; ! image->data[(x + y * image->attrs.m_width) * 3 + 2] = ptr[2]; } } - break; - default: - LOG.Warn("Invalid color byte type for PNG."); - SAFE_DELETE_ARRAY( image ); - return false; } --- 123,139 ---- } } ! } ! else ! { for ( y=0; y < (unsigned)image->attrs.m_height; y++) { png_byte* row = row_pointers[y]; for (int x=0; x<image->attrs.m_width; x++) { png_byte* ptr = &(row[x * 3]); ! image->data[(x + y * image->attrs.m_width) * 4] = ptr[0]; ! image->data[(x + y * image->attrs.m_width) * 4 + 1] = ptr[1]; ! image->data[(x + y * image->attrs.m_width) * 4 + 2] = ptr[2]; ! image->data[(x + y * image->attrs.m_width) * 4 + 3] = 255; } } } *************** *** 263,267 **** //Allocate space SAFE_DELETE_ARRAY(image->data); ! image->data = new unsigned char[rawlength]; memset(image->data, 0, rawlength); --- 256,260 ---- //Allocate space SAFE_DELETE_ARRAY(image->data); ! image->data = new unsigned char[image->attrs.m_width * image->attrs.m_height * 4]; memset(image->data, 0, rawlength); *************** *** 269,273 **** //Get raw data and convert BGR->RGB file->Seek(offset); ! for (unsigned int x = 0; !file->Eof(); x += 3) { memset(b, 0, sizeof(unsigned char) * 3); --- 262,266 ---- //Get raw data and convert BGR->RGB file->Seek(offset); ! for (unsigned int x = 0; !file->Eof(); x += 4) { memset(b, 0, sizeof(unsigned char) * 3); *************** *** 277,282 **** image->data[x+1] = b[1]; image->data[x+2] = b[0]; } ! image->attrs.m_ColorByteType = RGB; SAFE_DELETE_ARRAY(tmp); LOG.Info( "BMP Load End" ); --- 270,276 ---- image->data[x+1] = b[1]; image->data[x+2] = b[0]; + image->data[x+3] = 255; //full alpha } ! image->attrs.m_ColorByteType = RGBA; SAFE_DELETE_ARRAY(tmp); LOG.Info( "BMP Load End" ); |
|
From: Charles L. <cn...@us...> - 2009-04-17 17:17:10
|
Update of /cvsroot/hgengine/Mercury/src/linuxlib In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29672 Modified Files: libode-x86_64.a Log Message: general update Index: libode-x86_64.a =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/linuxlib/libode-x86_64.a,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsNPzrGt and /tmp/cvsEikqwC differ |
|
From: Josh A. <axl...@us...> - 2009-04-17 11:21:43
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3356 Modified Files: MercuryThreads.h MercuryThreads.cpp Log Message: update to mercury 2 threads Index: MercuryThreads.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryThreads.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** MercuryThreads.h 1 Sep 2007 23:55:51 -0000 1.15 --- MercuryThreads.h 17 Apr 2009 11:21:38 -0000 1.16 *************** *** 2,6 **** #define _MERCURY_THREADS_H ! #include "MercuryString.h" #if !defined(WIN32) --- 2,7 ---- #define _MERCURY_THREADS_H ! #include <MercuryString.h> ! #if !defined(WIN32) *************** *** 23,27 **** ///Create a thread of function fn and pass it data *data. ! int Create( void * (*fn)(void *), void *data ); ///Wait for the thread to complete. --- 24,28 ---- ///Create a thread of function fn and pass it data *data. ! int Create( void * (*fn)(void *), void *data, bool detach = true ); ///Wait for the thread to complete. *************** *** 37,43 **** --- 38,47 ---- void Close( ); + // inline void Exit() { pthread_exit(NULL); } + inline void HaltOnDestroy(bool t) { m_haltOnDestroy = t; } private: MString m_name; + bool m_haltOnDestroy; #if defined(WIN32) StartThreadData *mkThreadData; Index: MercuryThreads.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryThreads.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** MercuryThreads.cpp 2 Sep 2007 00:12:52 -0000 1.22 --- MercuryThreads.cpp 17 Apr 2009 11:21:38 -0000 1.23 *************** *** 1,4 **** ! #include "global.h" ! #include "MercuryThreads.h" #if defined( WIN32 ) --- 1,3 ---- ! #include <MercuryThreads.h> #if defined( WIN32 ) *************** *** 9,13 **** MercuryThread::MercuryThread() ! :m_name("(null)"), m_thread(0) { #if defined( WIN32 ) --- 8,12 ---- MercuryThread::MercuryThread() ! :m_name("(null)"), m_haltOnDestroy(true), m_thread(0) { #if defined( WIN32 ) *************** *** 17,21 **** MercuryThread::MercuryThread( const MString &name ) ! :m_name(name), m_thread(0) { #if defined( WIN32 ) --- 16,20 ---- MercuryThread::MercuryThread( const MString &name ) ! :m_name(name), m_haltOnDestroy(true), m_thread(0) { #if defined( WIN32 ) *************** *** 46,50 **** #endif ! int MercuryThread::Create( void * (*fn)(void *), void *data ) { #if defined( WIN32 ) --- 45,49 ---- #endif ! int MercuryThread::Create( void * (*fn)(void *), void *data, bool detach ) { #if defined( WIN32 ) *************** *** 60,64 **** --- 59,67 ---- return false; else + { + if (detach) + pthread_detach( m_thread ); //reclaim memory on thread destruction return true; + } #endif } *************** *** 74,79 **** return SuspendThread( m_thread ); #else ! pthread_detach( m_thread ); //reclaim memory on thread destruction ! pthread_cancel( m_thread ); #endif } --- 77,83 ---- return SuspendThread( m_thread ); #else ! // pthread_detach( m_thread ); //reclaim memory on thread destruction ! if (pthread_equal(pthread_self(), m_thread) != 0) { pthread_exit(NULL); } ! else { pthread_cancel( m_thread ); } #endif } *************** *** 102,110 **** void MercuryThread::Close( ) { ! if ( m_thread ) { Halt( true ); #if defined( WIN32 ) ! SAFE_DELETE( mkThreadData ); CloseHandle( m_thread ); m_thread = NULL; --- 106,116 ---- void MercuryThread::Close( ) { ! if ( m_thread && m_haltOnDestroy) { Halt( true ); #if defined( WIN32 ) ! delete mkThreadData; ! mkThreadData = NULL; ! // SAFE_DELETE( mkThreadData ); CloseHandle( m_thread ); m_thread = NULL; *************** *** 164,167 **** --- 170,174 ---- { // printf("Unlocked %s\n", m_name.c_str()); + --iLockCount; #if defined( WIN32 ) return ReleaseMutex( m_mutex ); *************** *** 180,184 **** p->bInheritHandle = true; p->lpSecurityDescriptor = NULL; ! m_mutex = CreateMutex( p, true, m_name.c_str() ); free( p ); return (int)m_mutex; --- 187,191 ---- p->bInheritHandle = true; p->lpSecurityDescriptor = NULL; ! m_mutex = CreateMutex( p, true, (LPCWSTR)m_name.c_str() ); free( p ); return (int)m_mutex; |
|
From: Charles L. <cn...@us...> - 2009-04-17 05:56:14
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17790/src Modified Files: MercurySoundDriverWin32.cpp Log Message: fix: Windows Vista and 7 require a properly formatted block alignment Index: MercurySoundDriverWin32.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercurySoundDriverWin32.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MercurySoundDriverWin32.cpp 23 Oct 2008 05:28:03 -0000 1.5 --- MercurySoundDriverWin32.cpp 17 Apr 2009 05:55:55 -0000 1.6 *************** *** 61,65 **** waveFormat.nSamplesPerSec = m_rate; waveFormat.wBitsPerSample = 16; ! waveFormat.nBlockAlign = 1; waveFormat.nAvgBytesPerSec = 0; m_bEnableOutput = true; --- 61,65 ---- waveFormat.nSamplesPerSec = m_rate; waveFormat.wBitsPerSample = 16; ! waveFormat.nBlockAlign = 4; waveFormat.nAvgBytesPerSec = 0; m_bEnableOutput = true; |
|
From: Charles L. <cn...@us...> - 2009-04-16 07:16:27
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv23770/src Modified Files: MercurySoundDriverSDL.cpp Log Message: We really need this to be the default - when it fails, there's no sound, at least we don't crash. Index: MercurySoundDriverSDL.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercurySoundDriverSDL.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MercurySoundDriverSDL.cpp 24 Oct 2008 18:05:07 -0000 1.3 --- MercurySoundDriverSDL.cpp 16 Apr 2009 07:16:11 -0000 1.4 *************** *** 8,12 **** #include "MercuryMath.h" ! REGISTER_DRIVER( MercurySoundDriverSDL, MercurySoundDriver, 15 ); MercurySoundDriverSDL::MercurySoundDriverSDL() --- 8,12 ---- #include "MercuryMath.h" ! REGISTER_DRIVER( MercurySoundDriverSDL, MercurySoundDriver, 9 ); MercurySoundDriverSDL::MercurySoundDriverSDL() |
|
From: <axl...@us...> - 2009-04-14 01:05:01
|
Revision: 213
http://hgengine.svn.sourceforge.net/hgengine/?rev=213&view=rev
Author: axlecrusher
Date: 2009-04-14 01:04:54 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
updates to viewport calculations
Modified Paths:
--------------
Mercury2/src/MercuryUtil.cpp
Mercury2/src/MercuryUtil.h
Mercury2/src/MercuryWindow.h
Mercury2/src/Viewport.cpp
Mercury2/src/Viewport.h
Mercury2/src/X11Window.cpp
Modified: Mercury2/src/MercuryUtil.cpp
===================================================================
--- Mercury2/src/MercuryUtil.cpp 2009-04-13 10:51:03 UTC (rev 212)
+++ Mercury2/src/MercuryUtil.cpp 2009-04-14 01:04:54 UTC (rev 213)
@@ -14,10 +14,10 @@
return t;
}
-float StrToFloat(const MString & s)
+float StrToFloat(const MString & s, float d)
{
- float x;
- sscanf(s.c_str(), "%f", &x);
+ float x = d;
+ if ( s.length() > 0) sscanf(s.c_str(), "%f", &x);
return x;
}
Modified: Mercury2/src/MercuryUtil.h
===================================================================
--- Mercury2/src/MercuryUtil.h 2009-04-13 10:51:03 UTC (rev 212)
+++ Mercury2/src/MercuryUtil.h 2009-04-14 01:04:54 UTC (rev 213)
@@ -29,7 +29,7 @@
MString ToUpper(const MString & s);
-float StrToFloat(const MString & s);
+float StrToFloat(const MString & s, float d = 0);
template<typename T>
const T& max(const T& t1, const T& t2)
Modified: Mercury2/src/MercuryWindow.h
===================================================================
--- Mercury2/src/MercuryWindow.h 2009-04-13 10:51:03 UTC (rev 212)
+++ Mercury2/src/MercuryWindow.h 2009-04-14 01:04:54 UTC (rev 213)
@@ -25,6 +25,9 @@
}
virtual void* GetProcAddress(const MString& x) = 0;
+
+ inline int Width() const { return m_width; }
+ inline int Height() const { return m_height; }
protected:
static Callback0R< MercuryWindow* > genWindowClbk;
Modified: Mercury2/src/Viewport.cpp
===================================================================
--- Mercury2/src/Viewport.cpp 2009-04-13 10:51:03 UTC (rev 212)
+++ Mercury2/src/Viewport.cpp 2009-04-14 01:04:54 UTC (rev 213)
@@ -1,13 +1,22 @@
#include <Viewport.h>
#include <GL/gl.h>
+#include <MercuryWindow.h>
REGISTER_NODE_TYPE(Viewport);
const Frustum* FRUSTUM;
+Viewport::Viewport()
+ :m_xFactor(1), m_yFactor(0.5), m_minx(0), m_miny(0)
+{
+}
+
void Viewport::Render(const MercuryMatrix& matrix)
{
FRUSTUM = &m_frustum;
+ MercuryWindow* w = MercuryWindow::GetCurrentWindow();
+ glViewport(m_minx, m_miny, w->Width()*m_xFactor, w->Height()*m_yFactor);
+
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
@@ -24,11 +33,19 @@
void Viewport::LoadFromXML(const XMLNode& node)
{
+ m_xFactor = StrToFloat(node.Attribute("xfactor"), 1.0f);
+ m_yFactor = StrToFloat(node.Attribute("yfactor"), 1.0f);
+ m_minx = StrToFloat(node.Attribute("minx"), 0);
+ m_miny = StrToFloat(node.Attribute("miny"), 0);
+
+ MercuryWindow* w = MercuryWindow::GetCurrentWindow();
+
m_frustum.SetPerspective( StrToFloat(node.Attribute("fov")),
- StrToFloat(node.Attribute("aspect")),
+ (w->Width()*m_xFactor)/(w->Height()*m_yFactor),
+// StrToFloat(node.Attribute("aspect")),
StrToFloat(node.Attribute("near")),
StrToFloat(node.Attribute("far")));
-
+
m_frustum.LookAt(MercuryVertex(), MercuryVertex(0,0,1), MercuryVertex(0,1,0));
RenderableNode::LoadFromXML(node);
Modified: Mercury2/src/Viewport.h
===================================================================
--- Mercury2/src/Viewport.h 2009-04-13 10:51:03 UTC (rev 212)
+++ Mercury2/src/Viewport.h 2009-04-14 01:04:54 UTC (rev 213)
@@ -12,6 +12,7 @@
class Viewport : public RenderableNode
{
public:
+ Viewport();
virtual void Render(const MercuryMatrix& matrix);
virtual void LoadFromXML(const XMLNode& node);
@@ -19,6 +20,8 @@
GENRTTI(Viewport);
private:
Frustum m_frustum;
+ float m_xFactor, m_yFactor;
+ int m_minx, m_miny;
};
#endif
Modified: Mercury2/src/X11Window.cpp
===================================================================
--- Mercury2/src/X11Window.cpp 2009-04-13 10:51:03 UTC (rev 212)
+++ Mercury2/src/X11Window.cpp 2009-04-14 01:04:54 UTC (rev 213)
@@ -145,7 +145,8 @@
case ConfigureNotify:
{
XConfigureEvent* e = (XConfigureEvent*)&event;
- glViewport(0,0, e->width, e->height);
+ m_width = e->width;
+ m_height = e->height;
break;
}
default:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-04-13 10:51:13
|
Revision: 212
http://hgengine.svn.sourceforge.net/hgengine/?rev=212&view=rev
Author: axlecrusher
Date: 2009-04-13 10:51:03 +0000 (Mon, 13 Apr 2009)
Log Message:
-----------
enable window resizing
Modified Paths:
--------------
Mercury2/src/X11Window.cpp
Modified: Mercury2/src/X11Window.cpp
===================================================================
--- Mercury2/src/X11Window.cpp 2009-04-12 23:37:04 UTC (rev 211)
+++ Mercury2/src/X11Window.cpp 2009-04-13 10:51:03 UTC (rev 212)
@@ -142,7 +142,12 @@
XMotionEvent* e = (XMotionEvent*)&event;
break;
}
-
+ case ConfigureNotify:
+ {
+ XConfigureEvent* e = (XConfigureEvent*)&event;
+ glViewport(0,0, e->width, e->height);
+ break;
+ }
default:
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <axl...@us...> - 2009-04-12 23:37:14
|
Revision: 211
http://hgengine.svn.sourceforge.net/hgengine/?rev=211&view=rev
Author: axlecrusher
Date: 2009-04-12 23:37:04 +0000 (Sun, 12 Apr 2009)
Log Message:
-----------
use glu mipmaps
Modified Paths:
--------------
Mercury2/src/Mercury2.cpp
Mercury2/src/MercuryVBO.cpp
Mercury2/src/MercuryVBO.h
Mercury2/src/Texture.cpp
Modified: Mercury2/src/Mercury2.cpp
===================================================================
--- Mercury2/src/Mercury2.cpp 2009-04-12 22:24:37 UTC (rev 210)
+++ Mercury2/src/Mercury2.cpp 2009-04-12 23:37:04 UTC (rev 211)
@@ -83,8 +83,9 @@
if (fpsTimer.Age() > 1)
{
float batches = MercuryVBO::ResetBatchCount()/(float)m_count;
- float binds = Texture::ReadAndResetBindCount()/(float)m_count;
- printf("FPS: %f, VBO batches %f, TBinds %f\n", m_count/fpsTimer.Age(), batches, binds);
+ float VBinds = MercuryVBO::ResetBindCount()/(float)m_count;
+ float Tbinds = Texture::ReadAndResetBindCount()/(float)m_count;
+ printf("FPS: %f, VBO batches %f, TBinds %f, VBinds %f\n", m_count/fpsTimer.Age(), batches, Tbinds, VBinds);
m_count = 0;
fpsTimer = timer;
}
Modified: Mercury2/src/MercuryVBO.cpp
===================================================================
--- Mercury2/src/MercuryVBO.cpp 2009-04-12 22:24:37 UTC (rev 210)
+++ Mercury2/src/MercuryVBO.cpp 2009-04-12 23:37:04 UTC (rev 211)
@@ -40,7 +40,10 @@
InitVBO();
if ( this != m_lastVBOrendered)
+ {
glVertexPointer(3, GL_FLOAT, stride, BUFFER_OFFSET(sizeof(float)*5));
+ ++m_vboBinds;
+ }
//apply all the active textures
for (uint8_t i = 0; i < numTextures; ++i)
@@ -87,6 +90,7 @@
void* MercuryVBO::m_lastVBOrendered = NULL;
uint32_t MercuryVBO::m_vboBatches;
+uint32_t MercuryVBO::m_vboBinds;
/****************************************************************************
* Copyright (C) 2008 by Joshua Allen *
Modified: Mercury2/src/MercuryVBO.h
===================================================================
--- Mercury2/src/MercuryVBO.h 2009-04-12 22:24:37 UTC (rev 210)
+++ Mercury2/src/MercuryVBO.h 2009-04-12 23:37:04 UTC (rev 211)
@@ -20,6 +20,7 @@
static uint32_t BatchCount() { return m_vboBatches; }
static uint32_t ResetBatchCount() { uint32_t t = m_vboBatches; m_vboBatches = 0; return t; }
+ static uint32_t ResetBindCount() { uint32_t t = m_vboBinds; m_vboBinds = 0; return t; }
private:
virtual void InitVBO();
@@ -33,6 +34,7 @@
AlignedBuffer<uint16_t> m_indexData;
static uint32_t m_vboBatches;
+ static uint32_t m_vboBinds;
};
#endif
Modified: Mercury2/src/Texture.cpp
===================================================================
--- Mercury2/src/Texture.cpp 2009-04-12 22:24:37 UTC (rev 210)
+++ Mercury2/src/Texture.cpp 2009-04-12 23:37:04 UTC (rev 211)
@@ -6,6 +6,7 @@
#include <GL/gl.h>
#include <GL/glext.h>
+#include <GL/glu.h>
using namespace std;
@@ -62,6 +63,7 @@
}
glBindTexture(GL_TEXTURE_2D, m_textureID);
+/*
glTexImage2D(GL_TEXTURE_2D,
0,
ByteType,
@@ -71,8 +73,10 @@
ByteType,
GL_UNSIGNED_BYTE,
m_raw->m_data);
+*/
+ gluBuild2DMipmaps( GL_TEXTURE_2D, 3, m_raw->m_width, m_raw->m_height, ByteType, GL_UNSIGNED_BYTE, m_raw->m_data );
- glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
// glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
@@ -80,6 +84,8 @@
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+// gluBuild2DMipmaps( GL_TEXTURE_2D, 3, m_raw->m_width, m_raw->m_height, ByteType, GL_UNSIGNED_BYTE, m_raw->m_data );
+
};
void Texture::Render(const MercuryNode* node)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|