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: Josh A. <axl...@us...> - 2005-12-23 21:36:50
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14904/src Modified Files: MercuryModel.cpp MercuryModel.h Log Message: Can render materials with Sphere Mapping Index: MercuryModel.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryModel.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** MercuryModel.h 18 Dec 2005 07:56:18 -0000 1.26 --- MercuryModel.h 23 Dec 2005 21:36:40 -0000 1.27 *************** *** 74,77 **** --- 74,78 ---- bool BubbleIntercept( MercuryPoint start, MercuryPoint direction, float radius, MercuryPoint & bounce, float &t, MercuryPoint BubbleScale = MercuryPoint(1,1,1) ); + vector<MercuryMaterial*> m_materials; protected: *************** *** 89,93 **** Meshes contain an unsigned int value of which material is theirs. */ ! vector<MercuryMaterial*> m_materials; }; --- 90,94 ---- Meshes contain an unsigned int value of which material is theirs. */ ! // vector<MercuryMaterial*> m_materials; }; Index: MercuryModel.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryModel.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** MercuryModel.cpp 18 Dec 2005 07:56:18 -0000 1.33 --- MercuryModel.cpp 23 Dec 2005 21:36:40 -0000 1.34 *************** *** 47,51 **** --- 47,59 ---- if (m_meshes[i]->GetMaterial() >= 0) + { + + //Maybe mterials should be responsible for drawing themselves + //since some display values have to be set for them. + if (m_materials[m_meshes[i]->GetMaterial()]->m_diffuse_texture.IsSphereMap()) + DISPLAY->SetSphereMapping(true); + DISPLAY->SetMaterial(m_materials[m_meshes[i]->GetMaterial()]); + } else LOG.Warn(" No Materials set."); *************** *** 55,58 **** --- 63,69 ---- m_meshes[i]->Draw(); DISPLAY->EndDrawing(); + + if (m_materials[m_meshes[i]->GetMaterial()]->m_diffuse_texture.IsSphereMap()) + DISPLAY->SetSphereMapping(false); } } |
|
From: Josh A. <axl...@us...> - 2005-12-23 21:31:21
|
Update of /cvsroot/hgengine/Mercury/Themes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14267/Themes Modified Files: _missing.png Log Message: Old one was... ew... this one isn't much better Index: _missing.png =================================================================== RCS file: /cvsroot/hgengine/Mercury/Themes/_missing.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsaBex5s and /tmp/cvsX1eTXz differ |
|
From: Josh A. <axl...@us...> - 2005-12-23 21:29:46
|
Update of /cvsroot/hgengine/Mercury/Themes/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13927/Themes/default Modified Files: metrics.ini Log Message: Title screen Index: metrics.ini =================================================================== RCS file: /cvsroot/hgengine/Mercury/Themes/default/metrics.ini,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** metrics.ini 17 Dec 2005 23:03:52 -0000 1.3 --- metrics.ini 23 Dec 2005 21:29:38 -0000 1.4 *************** *** 1,9 **** [Common] ! InitialScreen=ScreenExample2DSS [ScreenExample2DSS] Class=ScreenExample2DSS Man=man.txt ! Background=Background.png Title=Title.png Map=map.txt --- 1,9 ---- [Common] ! InitialScreen=ScreenHgTitle [ScreenExample2DSS] Class=ScreenExample2DSS Man=man.txt ! Background=Clouds.png Title=Title.png Map=map.txt *************** *** 13,15 **** Class=ScreenHelloWorld HelloImage=HelloWorld.png ! InfoComment=This is in Info. \ No newline at end of file --- 13,21 ---- Class=ScreenHelloWorld HelloImage=HelloWorld.png ! InfoComment=This is in Info. ! ! [ScreenHgTitle] ! Class=ScreenHgTitle ! InfoComment=This is in Info. ! Mercury=Mercury.txt ! sprite=Test.png \ No newline at end of file |
|
From: Josh A. <axl...@us...> - 2005-12-23 21:27:09
|
Update of /cvsroot/hgengine/Mercury/Themes/default/Models In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11192/Themes/default/Models Added Files: Mercury.txt MoltenMetal.bmp Log Message: Model and texture for Title Screen --- NEW FILE: Mercury.txt --- // MilkShape 3D ASCII Frames: 30 Frame: 1 Meshes: 2 "default" 1 0 0 0 0 "Blob" 1 0 1082 1 2.830683 2.363397 2.299145 1.000000 0.000000 -1 1 4.366323 2.166277 1.202745 0.961332 0.000000 -1 1 4.365162 2.139917 0.845025 0.961332 0.021852 -1 1 2.830683 2.363397 2.299145 1.000000 0.543040 -1 1 -0.440717 2.471397 1.738705 0.961332 0.543040 -1 1 -0.226838 2.453957 2.125625 0.961332 0.558231 -1 1 2.830683 2.363397 2.299145 1.000000 0.741736 -1 [...4043 lines suppressed...] 1 1078 1065 1069 1008 999 1002 1 1 2 1078 1076 2 1008 1007 1 1 1 1079 1078 1 201 1008 1 Materials: 1 "Material01" 0.200000 0.200000 0.200000 1.000000 0.800000 0.800000 0.800000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 1.000000 "MoltenMetal.bmp" "" Bones: 0 GroupComments: 0 MaterialComments: 0 BoneComments: 0 ModelComment: 0 --- NEW FILE: MoltenMetal.bmp --- (This appears to be a binary file; contents omitted.) |
|
From: Charles L. <cn...@us...> - 2005-12-18 07:56:29
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8238 Modified Files: MercuryFiles.cpp MercuryFiles.h MercuryMilkshapeModel.cpp MercuryModel.cpp MercuryModel.h MercuryTexture.cpp Log Message: Move everything to the new file system. Index: MercuryFiles.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryFiles.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MercuryFiles.cpp 18 Dec 2005 07:24:08 -0000 1.2 --- MercuryFiles.cpp 18 Dec 2005 07:56:18 -0000 1.3 *************** *** 21,24 **** --- 21,47 ---- } + bool MercuryFile::ReadLine( CString & data ) + { + data = ""; + char b1[1]; + bool Success; + while ( Success = ( Read( b1, 1 ) > 0 ) ) + { + if ( ( b1[0] == '\r' ) || ( b1[0] == '\n' ) ) + break; + data += b1[0]; + } + + //We're using windows, check to make sure we don't have an extra \n. + if ( b1[0] == '\r' ) + { + unsigned long loc = Tell(); + Read( b1, 1 ); + if ( b1[0] != '\n' ) + Seek(loc); + } + + return Success; + } MercuryFileObjectDirect::MercuryFileObjectDirect( ): Index: MercuryMilkshapeModel.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryMilkshapeModel.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MercuryMilkshapeModel.cpp 30 Nov 2005 02:56:59 -0000 1.7 --- MercuryMilkshapeModel.cpp 18 Dec 2005 07:56:18 -0000 1.8 *************** *** 17,21 **** void MercuryMilkshapeModel::LoadModel() { ! if (!m_file.is_open()) { LOG.Warn("File not opened."); --- 17,21 ---- void MercuryMilkshapeModel::LoadModel() { ! if (m_file==NULL) { LOG.Warn("File not opened."); *************** *** 23,29 **** } ! while (!m_file.eof()) { ! getline(m_file, m_line); FrameLoader(); --- 23,29 ---- } ! while (!m_file->Eof()) { ! m_file->ReadLine( m_line ); FrameLoader(); *************** *** 34,38 **** } ! m_file.close(); // m_model = NULL; } --- 34,38 ---- } ! SAFE_DELETE( m_file ); // m_model = NULL; } *************** *** 66,71 **** for (m_iMesh = 0; m_iMesh < numMeshes; m_iMesh++) { ! if(!m_file.eof()) ! getline(m_file, m_line); else throw; --- 66,71 ---- for (m_iMesh = 0; m_iMesh < numMeshes; m_iMesh++) { ! if(!m_file->Eof()) ! m_file->ReadLine( m_line ); else throw; *************** *** 112,117 **** float uv[2]; ! if(!m_file.eof()) ! getline(m_file, m_line); else throw; --- 112,117 ---- float uv[2]; ! if(!m_file->Eof()) ! m_file->ReadLine( m_line ); else throw; *************** *** 123,128 **** for (unsigned int i = 0; i < m_numVerts; i++) { ! if(!m_file.eof()) ! getline(m_file, m_line); else throw; --- 123,128 ---- for (unsigned int i = 0; i < m_numVerts; i++) { ! if(!m_file->Eof()) ! m_file->ReadLine( m_line ); else throw; *************** *** 148,153 **** float x,y,z; ! if(!m_file.eof()) ! getline(m_file, m_line); else throw; --- 148,153 ---- float x,y,z; ! if(!m_file->Eof()) ! m_file->ReadLine(m_line); else throw; *************** *** 165,170 **** for (unsigned int i = 0; i < nNumNormals; i++) { ! if(!m_file.eof()) ! getline(m_file, m_line); else throw; --- 165,170 ---- for (unsigned int i = 0; i < nNumNormals; i++) { ! if(!m_file->Eof()) ! m_file->ReadLine(m_line); else throw; *************** *** 190,195 **** int flag, index; ! if(!m_file.eof()) ! getline(m_file, m_line); else throw; --- 190,195 ---- int flag, index; ! if(!m_file->Eof()) ! m_file->ReadLine(m_line); else throw; *************** *** 200,205 **** for (unsigned int i = 0; i < numTri; i++) { ! if(!m_file.eof()) ! getline(m_file, m_line); else throw; --- 200,205 ---- for (unsigned int i = 0; i < numTri; i++) { ! if(!m_file->Eof()) ! m_file->ReadLine(m_line); else throw; *************** *** 252,261 **** material = new MercuryMaterial; { ! getline(m_file, m_line); material->m_name = m_line.substr(1,m_line.find("\"", 1)-1); if (material->m_name.size() <= 0) throw CString("Texture has no name"); ! std::getline(m_file, m_line); if (sscanf (m_line, "%f %f %f %f", &r, &g, &b, &a) != 4) throw CString(m_line); --- 252,261 ---- material = new MercuryMaterial; { ! m_file->ReadLine(m_line); material->m_name = m_line.substr(1,m_line.find("\"", 1)-1); if (material->m_name.size() <= 0) throw CString("Texture has no name"); ! m_file->ReadLine(m_line); if (sscanf (m_line, "%f %f %f %f", &r, &g, &b, &a) != 4) throw CString(m_line); *************** *** 266,270 **** material->m_ambient.SetA(a); ! std::getline(m_file, m_line); if (sscanf (m_line, "%f %f %f %f", &r, &g, &b, &a) != 4) throw CString(m_line); --- 266,270 ---- material->m_ambient.SetA(a); ! m_file->ReadLine(m_line); if (sscanf (m_line, "%f %f %f %f", &r, &g, &b, &a) != 4) throw CString(m_line); *************** *** 275,279 **** material->m_diffuse.SetA(a); ! std::getline(m_file, m_line); if (sscanf (m_line, "%f %f %f %f", &r, &g, &b, &a) != 4) throw CString(m_line); --- 275,279 ---- material->m_diffuse.SetA(a); ! m_file->ReadLine(m_line); if (sscanf (m_line, "%f %f %f %f", &r, &g, &b, &a) != 4) throw CString(m_line); *************** *** 284,288 **** material->m_specular.SetA(a); ! std::getline(m_file, m_line); if (sscanf (m_line, "%f %f %f %f", &r, &g, &b, &a) != 4) throw CString(m_line); --- 284,288 ---- material->m_specular.SetA(a); ! m_file->ReadLine(m_line); if (sscanf (m_line, "%f %f %f %f", &r, &g, &b, &a) != 4) throw CString(m_line); *************** *** 293,311 **** material->m_emissive.SetA(a); ! std::getline(m_file, m_line); if (sscanf (m_line, "%f", &material->m_shininess) != 1) throw CString(m_line); ! std::getline(m_file, m_line); if (sscanf (m_line, "%f", &material->m_alpha) != 1) throw CString(m_line); //The two images ! std::getline(m_file, m_line); material->m_difftext = m_path.c_str() + m_line.substr(1,m_line.find("\"", 1)-1); if (m_line.substr(1,m_line.find("\"", 1)-1).length() > 0) material->m_diffuse_texture.LoadBMP(material->m_difftext); ! std::getline(m_file, m_line); material->m_alphatext = m_path.c_str() + m_line.substr(1,m_line.find("\"", 1)-1); if (m_line.substr(1,m_line.find("\"", 1)-1).length() > 0) --- 293,311 ---- material->m_emissive.SetA(a); ! m_file->ReadLine(m_line); if (sscanf (m_line, "%f", &material->m_shininess) != 1) throw CString(m_line); ! m_file->ReadLine(m_line); if (sscanf (m_line, "%f", &material->m_alpha) != 1) throw CString(m_line); //The two images ! m_file->ReadLine(m_line); material->m_difftext = m_path.c_str() + m_line.substr(1,m_line.find("\"", 1)-1); if (m_line.substr(1,m_line.find("\"", 1)-1).length() > 0) material->m_diffuse_texture.LoadBMP(material->m_difftext); ! m_file->ReadLine(m_line); material->m_alphatext = m_path.c_str() + m_line.substr(1,m_line.find("\"", 1)-1); if (m_line.substr(1,m_line.find("\"", 1)-1).length() > 0) Index: MercuryTexture.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryTexture.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** MercuryTexture.cpp 18 Dec 2005 07:24:08 -0000 1.23 --- MercuryTexture.cpp 18 Dec 2005 07:56:18 -0000 1.24 *************** *** 50,56 **** m_path = path; ! ifstream file; ! file.open(path.c_str(), ios::binary); ! if (!file.is_open()) { LOG.Warn("Could not open BMP \"" + path + "\""); --- 50,55 ---- m_path = path; ! MercuryFile * file = FILEMAN.Open( path ); ! if (file==NULL) { LOG.Warn("Could not open BMP \"" + path + "\""); *************** *** 61,65 **** //Get the type of file and test memset(tmp, 0, 4); ! file.read(tmp, sizeof(char)*2); CString type(tmp); --- 60,64 ---- //Get the type of file and test memset(tmp, 0, 4); ! file->Read(tmp, sizeof(char)*2); CString type(tmp); *************** *** 71,89 **** } //Offset of bitmap data. ! file.seekg(10); ! file.read(tmp, 4); memcpy(&offset, tmp, 4); //width & width ! file.seekg(18); ! file.read(tmp, sizeof(int)); memcpy(&m_width, tmp, sizeof(int)); ! file.read(tmp, sizeof(int)); memcpy(&m_height, tmp, sizeof(int)); //bits per pixel memset(tmp, 0, sizeof(int)); ! file.seekg(28); ! file.read(tmp, sizeof(int)); memcpy(&bitsapix, tmp, sizeof(int)); --- 70,88 ---- } //Offset of bitmap data. ! file->Seek(10); ! file->Read(tmp, 4); memcpy(&offset, tmp, 4); //width & width ! file->Seek(18); ! file->Read(tmp, sizeof(int)); memcpy(&m_width, tmp, sizeof(int)); ! file->Read(tmp, sizeof(int)); memcpy(&m_height, tmp, sizeof(int)); //bits per pixel memset(tmp, 0, sizeof(int)); ! file->Seek(28); ! file->Read(tmp, sizeof(int)); memcpy(&bitsapix, tmp, sizeof(int)); *************** *** 96,101 **** //compression ! file.seekg(30); ! file.read(tmp, sizeof(int)); memcpy(&compression, tmp, sizeof(int)); --- 95,100 ---- //compression ! file->Seek(30); ! file->Read(tmp, sizeof(int)); memcpy(&compression, tmp, sizeof(int)); *************** *** 109,120 **** //pix/m X memset(tmp, 0, sizeof(int)); ! file.seekg(38); ! file.read(tmp, sizeof(int)); memcpy(&res_x, tmp, sizeof(int)); //pix/m Y memset(tmp, 0, sizeof(int)); ! file.seekg(42); ! file.read(tmp, sizeof(int)); memcpy(&res_y, tmp, sizeof(int)); --- 108,119 ---- //pix/m X memset(tmp, 0, sizeof(int)); ! file->Seek(38); ! file->Read(tmp, sizeof(int)); memcpy(&res_x, tmp, sizeof(int)); //pix/m Y memset(tmp, 0, sizeof(int)); ! file->Seek(42); ! file->Read(tmp, sizeof(int)); memcpy(&res_y, tmp, sizeof(int)); *************** *** 130,135 **** //Get the file length ! file.seekg(0, ios::end); ! length = file.tellg(); rawlength = (length) - (offset-1); //Remember to subtract 1 from the offset. --- 129,133 ---- //Get the file length ! length = file->Length(); rawlength = (length) - (offset-1); //Remember to subtract 1 from the offset. *************** *** 139,147 **** //Get raw data and convert BGR->RGB ! file.seekg(offset); ! for (unsigned int x = 0; !file.eof(); x += 3) { memset(b, 0, sizeof(unsigned char)*3); ! file.read((char*)&b, sizeof(unsigned char)*3); m_data[x] = b[2]; --- 137,145 ---- //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); ! file->Read((char*)&b, sizeof(unsigned char)*3); m_data[x] = b[2]; *************** *** 149,153 **** m_data[x+2] = b[0]; } ! file.close(); m_alpha = false; --- 147,151 ---- m_data[x+2] = b[0]; } ! file->Close(); m_alpha = false; Index: MercuryModel.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryModel.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** MercuryModel.h 30 Nov 2005 02:38:45 -0000 1.25 --- MercuryModel.h 18 Dec 2005 07:56:18 -0000 1.26 *************** *** 8,11 **** --- 8,12 ---- #include "MercuryMaterial.h" #include "MercuryTypes.h" + #include "MercuryFiles.h" #if defined(_MSC_VER) && (_MSC_VER > 1100) *************** *** 76,82 **** protected: void OpenFile(const CString path); ! void CloseFile() { m_file.close(); } virtual void LoadModel() = 0; ! ifstream m_file; CString m_path; --- 77,83 ---- protected: void OpenFile(const CString path); ! void CloseFile() { SAFE_DELETE( m_file ); } virtual void LoadModel() = 0; ! MercuryFile * m_file; CString m_path; Index: MercuryFiles.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryFiles.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MercuryFiles.h 18 Dec 2005 07:24:08 -0000 1.2 --- MercuryFiles.h 18 Dec 2005 07:56:18 -0000 1.3 *************** *** 32,35 **** --- 32,37 ---- /** Returns the number of bytes read */ virtual unsigned long Read( void * data, unsigned long length ) = 0; + /** Reads one line from the file. */ + virtual bool ReadLine( CString & data ); /** Returns non-zero value if there's an error */ virtual bool Check() = 0; Index: MercuryModel.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryModel.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** MercuryModel.cpp 17 Dec 2005 22:58:07 -0000 1.32 --- MercuryModel.cpp 18 Dec 2005 07:56:18 -0000 1.33 *************** *** 13,16 **** --- 13,17 ---- { m_polys = 0; + m_file = NULL; } *************** *** 70,76 **** void MercuryModel::OpenFile(const CString path) { ! m_file.open(path.c_str()); ! if (!m_file.is_open()) { LOG.Warn("File not oppened:" + path); --- 71,78 ---- void MercuryModel::OpenFile(const CString path) { ! SAFE_DELETE(m_file); ! m_file = FILEMAN.Open(path); ! if (m_file==NULL) { LOG.Warn("File not oppened:" + path); |
|
From: Charles L. <cn...@us...> - 2005-12-18 07:24:17
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4698 Modified Files: MercuryFiles.cpp MercuryFiles.h MercuryTexture.cpp MercuryUtil.cpp Log Message: Use MercuryFiles for more Index: MercuryUtil.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryUtil.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MercuryUtil.cpp 10 Oct 2005 20:59:46 -0000 1.7 --- MercuryUtil.cpp 18 Dec 2005 07:24:08 -0000 1.8 *************** *** 1,5 **** #include "MercuryUtil.h" #include "Crash/archCrash.h" ! CString ConvertToCFormat( const CString & ncf ) --- 1,5 ---- #include "MercuryUtil.h" #include "Crash/archCrash.h" ! #include "MercuryFiles.h" CString ConvertToCFormat( const CString & ncf ) *************** *** 60,102 **** return ret; } long DumpFromFile( const CString & filename, char * & data ) { data = NULL; ! FILE * f = fopen( filename, "rb" ); if ( f == NULL ) return -1; ! fseek( f, 0, SEEK_END ); ! long lof = ftell( f ); ! if ( lof < 0 ) ! { ! fclose( f ); ! return -1; ! } ! fseek( f, 0, SEEK_SET ); ! data = (char*)malloc( lof ); ! long read = fread( data, 1, lof, f ); ! if ( read < lof ) { ! fclose( f ); ! free ( data ); return -1; } ! fclose( f ); ! return read; } bool DumpToFile( const CString & filename, const char * data, long bytes ) { ! FILE * f = fopen( filename, "wb" ); if ( f == NULL ) return false; ! if ( fwrite( data, bytes, 1, f ) != bytes ) ! { ! fclose( f ); ! return false; ! } ! fclose( f ); ! return true; } --- 60,100 ---- return ret; } + #include <iostream> + long DumpFromFile( const CString & filename, char * & data ) { data = NULL; ! MercuryFile * f = FILEMAN.Open( filename ); ! if ( f == NULL ) return -1; ! ! unsigned long length = f->Length(); ! ! data = (char*)malloc( length ); ! ! if ( f->Read( data, length ) != length ) { ! free( data ); ! data = NULL; ! SAFE_DELETE(f); return -1; } ! SAFE_DELETE(f); ! return length; } bool DumpToFile( const CString & filename, const char * data, long bytes ) { ! MercuryFile * f = FILEMAN.Open( filename, FILE_WRITE_ONLY ); if ( f == NULL ) return false; ! ! bool ret = f->Write( (void*) data, bytes ); ! ! SAFE_DELETE(f); ! ! return ret; } *************** *** 116,123 **** bool FileExists( const CString & filename ) { ! FILE * f = fopen( filename.c_str(), "r" ); if ( f == NULL ) return false; ! fclose ( f ); return true; } --- 114,121 ---- bool FileExists( const CString & filename ) { ! MercuryFile * f = FILEMAN.Open( filename.c_str() ); if ( f == NULL ) return false; ! SAFE_DELETE( f ); return true; } Index: MercuryFiles.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryFiles.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MercuryFiles.h 18 Dec 2005 06:52:43 -0000 1.1 --- MercuryFiles.h 18 Dec 2005 07:24:08 -0000 1.2 *************** *** 17,25 **** }; ! class MercuryFileObject { public: ! MercuryFileObject(); ! ~MercuryFileObject(); virtual bool Init( const CString & sPath, FilePermission p ); --- 17,25 ---- }; ! class MercuryFile { public: ! MercuryFile(); ! ~MercuryFile(); virtual bool Init( const CString & sPath, FilePermission p ); *************** *** 43,47 **** }; ! class MercuryFileObjectDirect: public MercuryFileObject { public: --- 43,47 ---- }; ! class MercuryFileObjectDirect: public MercuryFile { public: *************** *** 69,73 **** public: virtual void Init() { } ! virtual MercuryFileObject * GetFileHandle( const CString & sPath, FilePermission p ) = 0; virtual void ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly ) = 0; }; --- 69,73 ---- public: virtual void Init() { } ! virtual MercuryFile * GetFileHandle( const CString & sPath, FilePermission p ) = 0; virtual void ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly ) = 0; }; *************** *** 76,80 **** { public: ! virtual MercuryFileObject * GetFileHandle( const CString & sPath, FilePermission p ); virtual void ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly ); }; --- 76,80 ---- { public: ! virtual MercuryFile * GetFileHandle( const CString & sPath, FilePermission p ); virtual void ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly ); }; *************** *** 89,93 **** inline void CheckInit() { if ( m_bInit ) return; Init(); } ! MercuryFileObject * Open( const CString & sPath, FilePermission p = FILE_READ_ONLY ); void ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly=false ); private: --- 89,93 ---- inline void CheckInit() { if ( m_bInit ) return; Init(); } ! MercuryFile * Open( const CString & sPath, FilePermission p = FILE_READ_ONLY ); void ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly=false ); private: Index: MercuryFiles.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryFiles.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MercuryFiles.cpp 18 Dec 2005 06:52:43 -0000 1.1 --- MercuryFiles.cpp 18 Dec 2005 07:24:08 -0000 1.2 *************** *** 4,18 **** //Core base only. ! MercuryFileObject::MercuryFileObject() { //No code } ! MercuryFileObject::~MercuryFileObject() { //No code } ! bool MercuryFileObject::Init( const CString &sPath, FilePermission p ) { m_sPath = sPath; --- 4,18 ---- //Core base only. ! MercuryFile::MercuryFile() { //No code } ! MercuryFile::~MercuryFile() { //No code } ! bool MercuryFile::Init( const CString &sPath, FilePermission p ) { m_sPath = sPath; *************** *** 23,27 **** MercuryFileObjectDirect::MercuryFileObjectDirect( ): ! MercuryFileObject( ) { m_fF = NULL; --- 23,27 ---- MercuryFileObjectDirect::MercuryFileObjectDirect( ): ! MercuryFile( ) { m_fF = NULL; *************** *** 48,52 **** bool MercuryFileObjectDirect::Init( const CString & fName, FilePermission p ) { ! MercuryFileObject::Init( fName, p ); if ( m_fF != NULL ) SAFE_DELETE( m_fF ); --- 48,52 ---- bool MercuryFileObjectDirect::Init( const CString & fName, FilePermission p ) { ! MercuryFile::Init( fName, p ); if ( m_fF != NULL ) SAFE_DELETE( m_fF ); *************** *** 55,65 **** { case FILE_READ_ONLY: ! m_fF = fopen( fName.c_str(), "r" ); break; case FILE_WRITE_ONLY: ! m_fF = fopen( fName.c_str(), "w" ); break; case FILE_READ_AND_WRITE: ! m_fF = fopen( fName.c_str(), "w+" ); break; case FILE_APPEND: --- 55,65 ---- { case FILE_READ_ONLY: ! m_fF = fopen( fName.c_str(), "rb" ); break; case FILE_WRITE_ONLY: ! m_fF = fopen( fName.c_str(), "wb" ); break; case FILE_READ_AND_WRITE: ! m_fF = fopen( fName.c_str(), "wb+" ); break; case FILE_APPEND: *************** *** 127,133 **** } ! MercuryFileObject * MercuryFileDirverDirect::GetFileHandle( const CString & sPath, FilePermission p ) { ! MercuryFileObject * ret = new MercuryFileObjectDirect; if ( ret->Init( sPath, p ) ) return ret; --- 127,133 ---- } ! MercuryFile * MercuryFileDirverDirect::GetFileHandle( const CString & sPath, FilePermission p ) { ! MercuryFile * ret = new MercuryFileObjectDirect; if ( ret->Init( sPath, p ) ) return ret; *************** *** 201,208 **** } ! MercuryFileObject * MercuryFileManager::Open( const CString & sPath, FilePermission p ) { CheckInit(); ! MercuryFileObject * ret; for ( unsigned int i = 0; i < m_Drivers->size(); i++ ) { --- 201,208 ---- } ! MercuryFile * MercuryFileManager::Open( const CString & sPath, FilePermission p ) { CheckInit(); ! MercuryFile * ret; for ( unsigned int i = 0; i < m_Drivers->size(); i++ ) { Index: MercuryTexture.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryTexture.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** MercuryTexture.cpp 10 Dec 2005 06:54:18 -0000 1.22 --- MercuryTexture.cpp 18 Dec 2005 07:24:08 -0000 1.23 *************** *** 4,7 **** --- 4,8 ---- #include "MercuryTextureManager.h" #include "MercuryLog.h" + #include "MercuryFiles.h" MercuryTexture::MercuryTexture() *************** *** 160,166 **** void PNGRead( png_struct *png, png_byte *p, png_size_t size ) { ! FILE* f = (FILE*)png->io_ptr; ! int got = fread(p, 1, size, f); if( got == -1 ) --- 161,167 ---- void PNGRead( png_struct *png, png_byte *p, png_size_t size ) { ! MercuryFile * f = (MercuryFile*)png->io_ptr; ! int got = f->Read( p, size ); if( got == -1 ) *************** *** 185,192 **** //open file and test for it being a png ! FILE *fp = fopen(path.c_str(), "rb"); if (!fp) abort_("[read_png_file] File %s could not be opened for reading"); ! fread(header, 1, 8, fp); if (png_sig_cmp(header, 0, 8)) abort_("[read_png_file] File %s is not recognized as a PNG file"); --- 186,193 ---- //open file and test for it being a png ! MercuryFile *fp = FILEMAN.Open( path.c_str() ); if (!fp) abort_("[read_png_file] File %s could not be opened for reading"); ! fp->Read(header, 8 ); if (png_sig_cmp(header, 0, 8)) abort_("[read_png_file] File %s is not recognized as a PNG file"); *************** *** 233,237 **** m_alpha = 1; ! fclose(fp); m_data = new unsigned char[sizeof(unsigned char) * m_height * m_width * 4]; --- 234,238 ---- m_alpha = 1; ! SAFE_DELETE(fp); m_data = new unsigned char[sizeof(unsigned char) * m_height * m_width * 4]; |
|
From: Charles L. <cn...@us...> - 2005-12-18 06:52:50
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1269 Modified Files: Mercury.dsp Added Files: MercuryFiles.cpp MercuryFiles.h Log Message: Mercury File System (commit now) --- NEW FILE: MercuryFiles.cpp --- #include "MercuryFiles.h" MercuryFileManager FILEMAN; //Core base only. MercuryFileObject::MercuryFileObject() { //No code } MercuryFileObject::~MercuryFileObject() { //No code } bool MercuryFileObject::Init( const CString &sPath, FilePermission p ) { m_sPath = sPath; m_p = p; return true; } MercuryFileObjectDirect::MercuryFileObjectDirect( ): MercuryFileObject( ) { m_fF = NULL; } MercuryFileObjectDirect::~MercuryFileObjectDirect() { if ( m_fF != NULL ) { fclose ( m_fF ); m_fF = NULL; } } void MercuryFileObjectDirect::Close() { if ( m_fF != NULL ) { fclose ( m_fF ); m_fF = NULL; } } bool MercuryFileObjectDirect::Init( const CString & fName, FilePermission p ) { MercuryFileObject::Init( fName, p ); if ( m_fF != NULL ) SAFE_DELETE( m_fF ); switch ( p ) { case FILE_READ_ONLY: m_fF = fopen( fName.c_str(), "r" ); break; case FILE_WRITE_ONLY: m_fF = fopen( fName.c_str(), "w" ); break; case FILE_READ_AND_WRITE: m_fF = fopen( fName.c_str(), "w+" ); break; case FILE_APPEND: m_fF = fopen( fName.c_str(), "a" ); break; default: m_fF = NULL; break; } return ( m_fF != NULL ); } bool MercuryFileObjectDirect::Seek( unsigned long position ) { if ( m_fF == NULL ) return false; return ( fseek( m_fF, position, SEEK_SET ) == 0 ); } unsigned long MercuryFileObjectDirect::Tell() { if ( m_fF == NULL ) return false; return ftell( m_fF ); } unsigned long MercuryFileObjectDirect::Length() { if ( m_fF == NULL ) return false; unsigned long prev = ftell( m_fF ); fseek( m_fF, 0, SEEK_END ); unsigned long ret = ftell( m_fF ); fseek( m_fF, 0, SEEK_SET ); return ret; } bool MercuryFileObjectDirect::Write( void * data, unsigned long length ) { if ( m_fF == NULL ) return false; return ( fwrite( data, length, 1, m_fF ) > 0 ); } unsigned long MercuryFileObjectDirect::Read( void * data, unsigned long length ) { if ( m_fF == NULL ) return false; return ( fread( data, 1, length, m_fF) ); } bool MercuryFileObjectDirect::Check() { if ( m_fF == NULL ) return false; return (ferror( m_fF )!=0); } bool MercuryFileObjectDirect::Eof() { if ( m_fF == NULL ) return false; return (feof( m_fF )!=0); } MercuryFileObject * MercuryFileDirverDirect::GetFileHandle( const CString & sPath, FilePermission p ) { MercuryFileObject * ret = new MercuryFileObjectDirect; if ( ret->Init( sPath, p ) ) return ret; SAFE_DELETE(ret); return NULL; } #if defined(WIN32) #include <windows.h> #endif void MercuryFileDirverDirect::ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly ) { #if defined(WIN32) WIN32_FIND_DATA fd; HANDLE hFind = ::FindFirstFile( sPath, &fd ); if( INVALID_HANDLE_VALUE == hFind ) // no files found return; do { if( bDirsOnly && !(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ) continue; // skip if( (!bDirsOnly) && (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ) continue; // skip CString sDirName( fd.cFileName ); if( sDirName == "." || sDirName == ".." ) continue; output.push_back( sDirName ); } while( ::FindNextFile( hFind, &fd ) ); ::FindClose( hFind ); #else DIR * pDe = opendir( "./" + sPath ); if ( pDe == NULL ) return; dirent * pEnt; while ( pEnt = readdir( de ) ) { if ( ( pEnt->d_type & DT_DIR ) && !bDirsOnly ) continue; if ( !( pEnt->d_type & DT_DIR ) && bDirsOnly ) continue; if ( strcmp( pEnt->d_name, "." ) == 0 ) continue; if ( strcmp( pEnt->d_name, ".." ) == 0 ) continue; output.push_back( pEnt->d_name ); } closedir( pDe ); #endif } void MercuryFileManager::Init() { m_bInit = true; m_Drivers = new std::vector< MercuryFileDriver * >; m_Drivers->push_back( new MercuryFileDirverDirect ); } MercuryFileObject * MercuryFileManager::Open( const CString & sPath, FilePermission p ) { CheckInit(); MercuryFileObject * ret; for ( unsigned int i = 0; i < m_Drivers->size(); i++ ) { ret = m_Drivers->at(i)->GetFileHandle( sPath, p ); if ( ret != NULL ) return ret; } return NULL; } void MercuryFileManager::ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly ) { CheckInit(); for ( unsigned int i = 0; i < m_Drivers->size(); i++ ) { m_Drivers->at(i)->ListDirectory( sPath, output, bDirsOnly ); } } --- NEW FILE: MercuryFiles.h --- #ifndef _MERCURY_FILES_H #define _MERCURY_FILES_H #include "global.h" #include "StdString.h" #include <vector> /****************************************************************/ //File Objects: enum FilePermission { FILE_READ_ONLY, FILE_WRITE_ONLY, FILE_READ_AND_WRITE, FILE_APPEND, }; class MercuryFileObject { public: MercuryFileObject(); ~MercuryFileObject(); virtual bool Init( const CString & sPath, FilePermission p ); virtual void Close() = 0; virtual bool Seek( unsigned long position ) = 0; virtual unsigned long Tell() = 0; virtual unsigned long Length() = 0; /** Writes length bytes, returns true if it wrote successfully */ virtual bool Write( void * data, unsigned long length ) = 0; /** Returns the number of bytes read */ virtual unsigned long Read( void * data, unsigned long length ) = 0; /** Returns non-zero value if there's an error */ virtual bool Check() = 0; /** Return true if end of file */ virtual bool Eof() = 0; CString GetName() { return m_sPath; } protected: CString m_sPath; FilePermission m_p; }; class MercuryFileObjectDirect: public MercuryFileObject { public: MercuryFileObjectDirect(); ~MercuryFileObjectDirect(); virtual bool Init( const CString & fName, FilePermission p ); virtual bool Seek( unsigned long position ); virtual void Close(); virtual unsigned long Tell(); virtual unsigned long Length(); virtual bool Write( void * data, unsigned long length ); virtual unsigned long Read( void * data, unsigned long length ); virtual bool Check(); virtual bool Eof(); private: FILE * m_fF; }; /****************************************************************/ //File Drivers: class MercuryFileDriver { public: virtual void Init() { } virtual MercuryFileObject * GetFileHandle( const CString & sPath, FilePermission p ) = 0; virtual void ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly ) = 0; }; class MercuryFileDirverDirect : public MercuryFileDriver { public: virtual MercuryFileObject * GetFileHandle( const CString & sPath, FilePermission p ); virtual void ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly ); }; /****************************************************************/ //File Manager: class MercuryFileManager { public: void Init(); inline void CheckInit() { if ( m_bInit ) return; Init(); } MercuryFileObject * Open( const CString & sPath, FilePermission p = FILE_READ_ONLY ); void ListDirectory( const CString & sPath, std::vector< CString > & output, bool bDirsOnly=false ); private: bool m_bInit; std::vector< MercuryFileDriver * > * m_Drivers; }; extern MercuryFileManager FILEMAN; #endif /* * (c) 2005 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. */ Index: Mercury.dsp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/Mercury.dsp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Mercury.dsp 18 Dec 2005 02:46:52 -0000 1.28 --- Mercury.dsp 18 Dec 2005 06:52:43 -0000 1.29 *************** *** 160,163 **** --- 160,167 ---- # Begin Source File + SOURCE=.\MercuryFiles.cpp + # End Source File + # Begin Source File + SOURCE=.\MercuryINI.cpp # End Source File *************** *** 288,291 **** --- 292,299 ---- # Begin Source File + SOURCE=.\MercuryFiles.h + # End Source File + # Begin Source File + SOURCE=.\MercuryINI.h # End Source File |
|
From: Charles L. <cn...@us...> - 2005-12-18 02:49:42
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6285 Modified Files: Makefile.am Log Message: Add Shapes Index: Makefile.am =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile.am 30 Nov 2005 02:40:56 -0000 1.12 --- Makefile.am 18 Dec 2005 02:49:32 -0000 1.13 *************** *** 24,28 **** MercuryTheme.cpp MercuryTimer.cpp MercuryTypes.cpp MercuryUtil.cpp MercuryWindow.cpp \ MercuryWindowSDL.cpp ScreenExample2DSS.cpp ScreenHelloWorld.cpp ScreenTestCollision.cpp \ ! ScreenTestCollision2.cpp ScreenTitle.cpp SUBDIRS = Crash --- 24,28 ---- MercuryTheme.cpp MercuryTimer.cpp MercuryTypes.cpp MercuryUtil.cpp MercuryWindow.cpp \ MercuryWindowSDL.cpp ScreenExample2DSS.cpp ScreenHelloWorld.cpp ScreenTestCollision.cpp \ ! ScreenTestCollision2.cpp ScreenTitle.cpp MercuryShapes.cpp SUBDIRS = Crash |
|
From: Charles L. <cn...@us...> - 2005-12-18 02:47:04
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5961 Modified Files: Mercury.dsp Added Files: MercuryShapes.cpp MercuryShapes.h Log Message: Add Mercury Shapes --- NEW FILE: MercuryShapes.cpp --- #include "MercuryShapes.h" #include <iostream> MercuryShape::MercuryShape() : MercuryModel() { m_material = new MercuryMaterial; AddMaterial( m_material ); } MercuryShape::~MercuryShape() { SAFE_DELETE( m_material ); } bool MercuryShape::LoadPNG( const CString & Filename ) { if ( !m_material->m_diffuse_texture.LoadPNG(Filename) ) return false; m_material->m_diffuse.SetA( 1 ); m_material->m_diffuse.SetB( 1 ); m_material->m_diffuse.SetG( 1 ); m_material->m_diffuse.SetR( 1 ); m_material->m_emissive.SetA( 1 ); m_material->m_emissive.SetB( 1 ); m_material->m_emissive.SetG( 1 ); m_material->m_emissive.SetR( 1 ); m_scale.SetX((m_material->m_diffuse_texture.GetWidth() / m_material->m_diffuse_texture.GetDpiX()) * 12); m_scale.SetY((m_material->m_diffuse_texture.GetHeight() / m_material->m_diffuse_texture.GetDpiY()) * 12); return true; } void MercuryShape::SetMaterial( const MercuryMaterial & mat ) { (*m_material) = mat; } void MercuryShape::MakeSphere( int Stacks, int Slices ) { for ( int i = 0; i < m_meshes.size(); i++ ) { SAFE_DELETE(m_meshes[i]); } m_meshes.resize(1); m_meshes[0] = new MercuryMesh; m_hidden = false; m_meshes[0]->SetMaterial( 0 ); for ( int y = 0; y < Stacks; y++ ) for ( int x = 0; x < Slices; x++ ) { float dY = 6.2831853072f / float(Stacks)/2; float dX = 6.2831853072f / float(Slices); MercuryVert * p1 = new MercuryVert; MercuryVert * p2 = new MercuryVert; MercuryVert * p3 = new MercuryVert; MercuryVert * p4 = new MercuryVert; MercuryVert * p5 = new MercuryVert; MercuryVert * p6 = new MercuryVert; p1->x = COS( dX * x ) * SIN( dY * y ); p1->y = SIN( dX * x ) * SIN( dY * y ); p1->z = COS( dY * y ); p1->SetV( float( y ) / Stacks ); p1->SetU( float( x ) / Slices ); p2->x = COS( dX * ( x + 1 ) ) * SIN( dY * y ); p2->y = SIN( dX * ( x + 1 ) ) * SIN( dY * y ); p2->z = COS( dY * y ); p2->SetV( float( y ) / Stacks ); p2->SetU( float( x + 1 ) / Slices ); p3->x = COS( dX * x ) * SIN( dY * ( y + 1 ) ); p3->y = SIN( dX * x ) * SIN( dY * ( y + 1 ) ); p3->z = COS( dX * ( y + 1 ) ); p3->SetV( float( y + 1 ) / Stacks ); p3->SetU( float( x ) / Slices ); p4->x = COS( dX * ( x + 1 ) ) * SIN( dY * y ); p4->y = SIN( dX * ( x + 1 ) ) * SIN( dY * y ); p4->z = COS( dY * y ); p4->SetV( float( y ) / Stacks ); p4->SetU( float( x + 1 ) / Slices ); p5->x = COS( dX * x ) * SIN( dY * ( y + 1 ) ); p5->y = SIN( dX * x ) * SIN( dY * ( y + 1 ) ); p5->z = COS( dX * ( y + 1 ) ); p5->SetV( float( y + 1 ) / Stacks ); p5->SetU( float( x ) / Slices ); p6->x = COS( dX * ( x + 1 ) ) * SIN( dY * ( y + 1 ) ); p6->y = SIN( dX * ( x + 1 ) ) * SIN( dY * ( y + 1 ) ); p6->z = COS( dX * ( y + 1 ) ); p6->SetV( float( y + 1 ) / Stacks ); p6->SetU( float( x + 1 ) / Slices ); MercuryPoly * l = new MercuryPoly; l->AddVert( p2 ); l->AddVert( p1 ); l->AddVert( p3 ); m_meshes[0]->AddPoly( l ); l = new MercuryPoly; l->AddVert( p4 ); l->AddVert( p5 ); l->AddVert( p6 ); m_meshes[0]->AddPoly( l ); } cout<<"Normal time."<<endl; m_meshes[0]->CalculateVertexNormals(); } void MercuryShape::MakeSprite( ) { for ( int i = 0; i < m_meshes.size(); i++ ) { SAFE_DELETE(m_meshes[i]); } m_meshes.resize(1); m_meshes[0] = new MercuryMesh; m_hidden = false; m_meshes[0]->SetMaterial( 0 ); MercuryVert * p1 = new MercuryVert; MercuryVert * p2 = new MercuryVert; MercuryVert * p3 = new MercuryVert; MercuryVert * p4 = new MercuryVert; MercuryVert * p5 = new MercuryVert; MercuryVert * p6 = new MercuryVert; p1->x = -0.5f; p1->y = -0.5f; p1->z = 0; p1->SetU( 0 ); p1->SetV( 0 ); p2->x = -0.5f; p2->y = 0.5f; p2->z = 0; p2->SetU( 0 ); p2->SetV( 1 ); p3->x = 0.5f; p3->y = -0.5f; p3->z = 0; p3->SetU( 1 ); p3->SetV( 0 ); p4->x = 0.5f; p4->y = -0.5f; p4->z = 0; p4->SetU( 1 ); p4->SetV( 0 ); p5->x = -0.5f; p5->y = 0.5f; p5->z = 0; p5->SetU( 0 ); p5->SetV( 1 ); p6->x = 0.5f; p6->y = 0.5f; p6->z = 0; p6->SetU( 1 ); p6->SetV( 1 ); MercuryPoly * l = new MercuryPoly; l->AddVert( p2 ); l->AddVert( p1 ); l->AddVert( p3 ); m_meshes[0]->AddPoly( l ); l = new MercuryPoly; l->AddVert( p5 ); l->AddVert( p4 ); l->AddVert( p6 ); m_meshes[0]->AddPoly( l ); m_meshes[0]->CalculateVertexNormals(); } void MercuryShape::MakeCylinder( int Stacks, int Slices ) { int i,y,x,z; for ( i = 0; i < m_meshes.size(); i++ ) { SAFE_DELETE(m_meshes[i]); } m_meshes.resize(1); m_meshes[0] = new MercuryMesh; m_hidden = false; m_meshes[0]->SetMaterial( 0 ); int SP2 = Stacks + 2; for ( y = 0; y < Stacks; y++ ) for ( x = 0; x < Slices; x++ ) { float dY = 6.2831853072f / float(Stacks)/2; float dX = 6.2831853072f / float(Slices); MercuryVert * p1 = new MercuryVert; MercuryVert * p2 = new MercuryVert; MercuryVert * p3 = new MercuryVert; MercuryVert * p4 = new MercuryVert; MercuryVert * p5 = new MercuryVert; MercuryVert * p6 = new MercuryVert; p1->x = COS( dX * x ); p1->y = SIN( dX * x ); p1->z = ( float( y ) / Stacks ) - 0.5f; p1->SetV( float( y + 1 ) / SP2 ); p1->SetU( float( x ) / Slices ); p2->x = COS( dX * ( x + 1 ) ); p2->y = SIN( dX * ( x + 1 ) ); p2->z = ( float( y ) / Stacks ) - 0.5f; p2->SetV( float( y + 1 ) / SP2 ); p2->SetU( float( x + 1 ) / Slices ); p3->x = COS( dX * x ); p3->y = SIN( dX * x ); p3->z = ( float( y + 1 ) / Stacks ) - 0.5f; p3->SetV( float( y + 2 ) / SP2 ); p3->SetU( float( x ) / Slices ); p4->x = COS( dX * ( x + 1 ) ); p4->y = SIN( dX * ( x + 1 ) ); p4->z = ( float( y ) / Stacks ) - 0.5f; p4->SetV( float( y + 1 ) / SP2 ); p4->SetU( float( x + 1 ) / Slices ); p5->x = COS( dX * x ); p5->y = SIN( dX * x ); p5->z = ( float( y + 1 ) / Stacks ) - 0.5f; p5->SetV( float( y + 2 ) / SP2 ); p5->SetU( float( x ) / Slices ); p6->x = COS( dX * ( x + 1 ) ); p6->y = SIN( dX * ( x + 1 ) ); p6->z = ( float( y + 1 ) / Stacks ) - 0.5f; p6->SetV( float( y + 2 ) / SP2 ); p6->SetU( float( x + 1 ) / Slices ); MercuryPoly * l = new MercuryPoly; l->AddVert( p1 ); l->AddVert( p2 ); l->AddVert( p3 ); m_meshes[0]->AddPoly( l ); l = new MercuryPoly; l->AddVert( p5 ); l->AddVert( p4 ); l->AddVert( p6 ); m_meshes[0]->AddPoly( l ); } for ( z = 0; z < 2; z++ ) for ( x = 0; x < Slices; x++ ) { float dY = 6.2831853072f / float(Stacks)/2; float dX = 6.2831853072f / float(Slices); MercuryVert * p1 = new MercuryVert; MercuryVert * p2 = new MercuryVert; MercuryVert * p3 = new MercuryVert; if ( z == 0 ) { p1->SetV( float( 0 ) / SP2 ); p2->SetV( float( 1 ) / SP2 ); p3->SetV( float( 1 ) / SP2 ); y = 0; } else { p1->SetV( float( Stacks+2 ) / SP2 ); p2->SetV( float( Stacks+1 ) / SP2 ); p3->SetV( float( Stacks+1 ) / SP2 ); y = Stacks; } p1->x = 0; p1->y = 0; p1->z = z - 0.5f; p1->SetU( float( x ) / Slices ); p2->x = COS( dX * ( x + 1 ) ); p2->y = SIN( dX * ( x + 1 ) ); p2->z = z - 0.5f; p2->SetU( float( x + 1 ) / Slices ); p3->x = COS( dX * x ); p3->y = SIN( dX * x ); p3->z = z - 0.5f; p3->SetU( float( x ) / Slices ); MercuryPoly * l = new MercuryPoly; if ( z == 0 ) { l->AddVert( p1 ); l->AddVert( p2 ); l->AddVert( p3 ); } else { l->AddVert( p2 ); l->AddVert( p1 ); l->AddVert( p3 ); } m_meshes[0]->AddPoly( l ); } m_meshes[0]->CalculateVertexNormals(); } void MercuryShape::MakeBox( bool bWholeMap ) { unsigned int i; for ( i = 0; i < m_meshes.size(); i++ ) { SAFE_DELETE(m_meshes[i]); } m_meshes.resize(1); m_meshes[0] = new MercuryMesh; m_hidden = false; m_meshes[0]->SetMaterial( 0 ); for ( i = 0; i < 6; i++ ) { MercuryVert * h[2][2]; for ( int x = 0; x < 2; x++ ) for ( int y = 0; y < 2; y++ ) { int SV = i/3; int RV = i%3; float v1 = SV - 0.5f; float v2 = x - 0.5f; float v3 = y - 0.5f; switch ( RV ) { case 0: h[x][y] = new MercuryVert( v1,v2,v3,x,y); break; case 1: h[x][y] = new MercuryVert( v2,v3,v1,x,y); break; case 2: h[x][y] = new MercuryVert( v3,v1,v2,x,y); break; } } bool bSwapOrder = i / 3; MercuryPoly * l = new MercuryPoly; if ( bSwapOrder ) { l->AddVert( h[0][0] ); l->AddVert( h[1][0] ); l->AddVert( h[0][1] ); } else { l->AddVert( h[0][1] ); l->AddVert( h[1][0] ); l->AddVert( h[0][0] ); } m_meshes[0]->AddPoly( l ); l = new MercuryPoly; if ( bSwapOrder ) { l->AddVert( h[1][0] ); l->AddVert( h[1][1] ); l->AddVert( h[0][1] ); } else { l->AddVert( h[0][1] ); l->AddVert( h[1][1] ); l->AddVert( h[1][0] ); } m_meshes[0]->AddPoly( l ); } m_meshes[0]->CalculateVertexNormals(); } /* * (c) 2005 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. */ --- NEW FILE: MercuryShapes.h --- #ifndef _MERCURY_SHAPES_H #define _MERCURY_SHAPES_H #include "MercuryModel.h" class MercuryShape : public MercuryModel { public: MercuryShape(); virtual ~MercuryShape(); bool LoadPNG( const CString & Filename ); void SetMaterial( const MercuryMaterial & mat ); void LoadModel() { } void MakeSphere( int Stacks=6, int Slices=12 ); void MakeCylinder( int Stacks=6, int Slices=12 ); void MakeSprite( ); void MakeBox( bool bWholeMap = true ); protected: MercuryMaterial * m_material; }; #endif /* * (c) 2005 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. */ Index: Mercury.dsp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/Mercury.dsp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Mercury.dsp 5 Dec 2005 21:27:25 -0000 1.27 --- Mercury.dsp 18 Dec 2005 02:46:52 -0000 1.28 *************** *** 55,59 **** # Begin Special Build Tool IntDir=.\../Release ! TargetDir=\Mercury\Release TargetName=Mercury SOURCE="$(InputPath)" --- 55,59 ---- # Begin Special Build Tool IntDir=.\../Release ! TargetDir=\HGENGINE\Mercury\Release TargetName=Mercury SOURCE="$(InputPath)" *************** *** 88,92 **** # Begin Special Build Tool IntDir=.\../Debug ! TargetDir=\Mercury\Debug TargetName=Mercury SOURCE="$(InputPath)" --- 88,92 ---- # Begin Special Build Tool IntDir=.\../Debug ! TargetDir=\HGENGINE\Mercury\Debug TargetName=Mercury SOURCE="$(InputPath)" *************** *** 121,125 **** # Begin Special Build Tool IntDir=.\../AllIn ! TargetDir=\Mercury\AllIn TargetName=Mercury SOURCE="$(InputPath)" --- 121,125 ---- # Begin Special Build Tool IntDir=.\../AllIn ! TargetDir=\HGENGINE\Mercury\AllIn TargetName=Mercury SOURCE="$(InputPath)" *************** *** 220,223 **** --- 220,227 ---- # Begin Source File + SOURCE=.\MercuryShapes.cpp + # End Source File + # Begin Source File + SOURCE=.\MercurySprite.cpp # End Source File *************** *** 344,347 **** --- 348,355 ---- # Begin Source File + SOURCE=.\MercuryShapes.h + # End Source File + # Begin Source File + SOURCE=.\MercurySprite.h # End Source File |
|
From: Charles L. <cn...@us...> - 2005-12-18 02:46:17
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5829 Modified Files: MercuryObject.cpp MercuryObject.h Log Message: Add new constructor for verts. Index: MercuryObject.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryObject.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** MercuryObject.h 30 Nov 2005 19:04:05 -0000 1.24 --- MercuryObject.h 18 Dec 2005 02:46:09 -0000 1.25 *************** *** 28,31 **** --- 28,32 ---- virtual ~MercuryVert(); MercuryVert(); + MercuryVert( const float x, const float y, const float z, const float u, const float v ); const float* GetVert() const; inline const float* GetUV() const { return m_uv; } Index: MercuryObject.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryObject.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** MercuryObject.cpp 30 Nov 2005 19:04:05 -0000 1.31 --- MercuryObject.cpp 18 Dec 2005 02:46:09 -0000 1.32 *************** *** 12,15 **** --- 12,22 ---- } + MercuryVert::MercuryVert( const float ix, const float iy, const float iz, const float u, const float v ) + :MercuryPoint() + { + x=ix;y=iy;z=iz; + m_uv[0]=u;m_uv[1]=v; + } + MercuryVert::MercuryVert() :MercuryPoint() |
|
From: Charles L. <cn...@us...> - 2005-12-17 23:09:09
|
Update of /cvsroot/hgengine/Mercury In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19430 Removed Files: fire.bmp Fireball.txt ground.bmp oldground.txt Log Message: Remove unessiary files --- Fireball.txt DELETED --- --- fire.bmp DELETED --- --- ground.bmp DELETED --- --- oldground.txt DELETED --- |
|
From: Charles L. <cn...@us...> - 2005-12-17 23:05:57
|
Update of /cvsroot/hgengine/Mercury/Themes/default/Models In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18645 Added Files: Box.bmp box.txt Face.bmp man.txt Log Message: Models for 2dss --- NEW FILE: Face.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: man.txt --- // MilkShape 3D ASCII Frames: 30 Frame: 1 Meshes: 3 "Head" 0 0 89 1 0.000000 2.150350 -0.022727 0.000000 1.000000 -1 1 1.250000 2.485286 -0.022727 0.000000 0.833333 -1 1 1.082532 2.485286 0.602273 0.083333 0.833333 -1 1 0.000000 7.150350 -0.022727 0.000000 0.000000 -1 1 1.082532 6.815413 0.602273 0.083333 0.166667 -1 1 1.250000 6.815413 -0.022727 0.000000 0.166667 -1 1 0.000000 2.150350 -0.022727 0.083333 1.000000 -1 1 0.625000 2.485286 1.059805 0.166667 0.833333 -1 1 0.000000 7.150350 -0.022727 0.083333 0.000000 -1 1 0.625000 6.815413 1.059805 0.166667 0.166667 -1 1 0.000000 2.150350 -0.022727 0.166667 1.000000 -1 [...1374 lines suppressed...] 1.000000 0.000000 0.000000 1.000000 0.000000 1.000000 "" "" "Skin" 0.200000 0.200000 0.200000 1.000000 0.800000 0.800000 0.800000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000 "" "" Bones: 0 GroupComments: 0 MaterialComments: 0 BoneComments: 0 ModelComment: 0 --- NEW FILE: box.txt --- // MilkShape 3D ASCII Frames: 30 Frame: 1 Meshes: 1 "Box01" 1 0 20 1 -2.000000 2.000000 2.000000 0.000000 0.000000 -1 1 -2.000000 -2.000000 2.000000 0.000000 1.000000 -1 1 2.000000 2.000000 2.000000 1.000000 0.000000 -1 1 2.000000 -2.000000 2.000000 1.000000 1.000000 -1 1 2.000000 2.000000 2.000000 0.000000 0.000000 -1 1 2.000000 -2.000000 2.000000 0.000000 1.000000 -1 1 2.000000 2.000000 -2.000000 1.000000 0.000000 -1 1 2.000000 -2.000000 -2.000000 1.000000 1.000000 -1 1 2.000000 2.000000 -2.000000 0.000000 0.000000 -1 1 2.000000 -2.000000 -2.000000 0.000000 1.000000 -1 1 -2.000000 2.000000 -2.000000 1.000000 0.000000 -1 1 -2.000000 -2.000000 -2.000000 1.000000 1.000000 -1 1 -2.000000 2.000000 -2.000000 0.000000 0.000000 -1 1 -2.000000 -2.000000 -2.000000 0.000000 1.000000 -1 1 -2.000000 2.000000 2.000000 1.000000 0.000000 -1 1 -2.000000 -2.000000 2.000000 1.000000 1.000000 -1 1 -2.000000 2.000000 2.000000 0.000000 1.000000 -1 1 2.000000 2.000000 2.000000 1.000000 1.000000 -1 1 -2.000000 -2.000000 2.000000 0.000000 0.000000 -1 1 2.000000 -2.000000 2.000000 1.000000 0.000000 -1 6 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 -1.000000 -1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 -1.000000 0.000000 12 1 0 1 2 0 0 0 1 1 1 3 2 0 0 0 1 1 4 5 6 1 1 1 2 1 5 7 6 1 1 1 2 1 8 9 10 2 2 2 1 1 9 11 10 2 2 2 1 1 12 13 14 3 3 3 2 1 13 15 14 3 3 3 2 1 12 16 6 4 4 4 3 1 16 17 6 4 4 4 3 1 18 13 19 5 5 5 3 1 13 7 19 5 5 5 3 Materials: 1 "Material01" 0.200000 0.200000 0.200000 1.000000 0.800000 0.800000 0.800000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000 ".\Box.bmp" "" Bones: 0 GroupComments: 0 MaterialComments: 0 BoneComments: 0 ModelComment: 0 --- NEW FILE: Box.bmp --- (This appears to be a binary file; contents omitted.) |
|
From: Charles L. <cn...@us...> - 2005-12-17 23:04:52
|
Update of /cvsroot/hgengine/Mercury/Themes/default/Files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18259 Added Files: map.txt Log Message: Map for 2dSS --- NEW FILE: map.txt --- -1,0 0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0 8,0 9,0 10,0 11,0 12,0 13,0 5,6 6,6 7,6 8,6 9,12 10,12 |
|
From: Charles L. <cn...@us...> - 2005-12-17 23:04:06
|
Update of /cvsroot/hgengine/Mercury/Themes/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17918 Modified Files: metrics.ini Log Message: Update: Metrics Index: metrics.ini =================================================================== RCS file: /cvsroot/hgengine/Mercury/Themes/default/metrics.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** metrics.ini 12 Oct 2005 06:57:09 -0000 1.2 --- metrics.ini 17 Dec 2005 23:03:52 -0000 1.3 *************** *** 1,7 **** [Common] ! InitialScreen=ScreenHelloWorld [ScreenExample2DSS] Class=ScreenExample2DSS [ScreenHelloWorld] --- 1,12 ---- [Common] ! InitialScreen=ScreenExample2DSS [ScreenExample2DSS] Class=ScreenExample2DSS + Man=man.txt + Background=Background.png + Title=Title.png + Map=map.txt + Box=box.txt [ScreenHelloWorld] |
|
From: Charles L. <cn...@us...> - 2005-12-17 23:03:41
|
Update of /cvsroot/hgengine/Mercury/Themes/default/Files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17825/Files Log Message: Directory /cvsroot/hgengine/Mercury/Themes/default/Files added to the repository |
|
From: Josh A. <axl...@us...> - 2005-12-17 23:03:27
|
Update of /cvsroot/hgengine/Mercury/ScreenExample2DSS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17752/ScreenExample2DSS Removed Files: Background.bmp Background.png Background.psd Box.bmp Box.ms3d Box.psd Face.bmp Face.psd Man.ms3d Title.png Title.psd box.txt man.txt map.txt Log Message: Removed for Charles --- Face.psd DELETED --- --- box.txt DELETED --- --- Background.bmp DELETED --- --- map.txt DELETED --- --- Title.png DELETED --- --- Box.ms3d DELETED --- --- Title.psd DELETED --- --- Box.bmp DELETED --- --- man.txt DELETED --- --- Background.psd DELETED --- --- Background.png DELETED --- --- Box.psd DELETED --- --- Face.bmp DELETED --- --- Man.ms3d DELETED --- |
|
From: Charles L. <cn...@us...> - 2005-12-17 23:03:24
|
Update of /cvsroot/hgengine/Mercury/Themes/default/Models In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17762/Models Log Message: Directory /cvsroot/hgengine/Mercury/Themes/default/Models added to the repository |
|
From: Charles L. <cn...@us...> - 2005-12-17 23:03:11
|
Update of /cvsroot/hgengine/Mercury/Themes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17699 Added Files: _missing.png _missing.txt Log Message: Update: Missing files. --- NEW FILE: _missing.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: _missing.txt --- // MilkShape 3D ASCII Frames: 21 Frame: 1 Meshes: 1 "Box02" 1 -1 20 1 -4.500000 4.500000 4.500000 0.000000 0.000000 -1 1 -4.500000 -4.500000 4.500000 0.000000 1.000000 -1 1 4.500000 4.500000 4.500000 1.000000 0.000000 -1 1 4.500000 -4.500000 4.500000 1.000000 1.000000 -1 1 4.500000 4.500000 4.500000 0.000000 0.000000 -1 1 4.500000 -4.500000 4.500000 0.000000 1.000000 -1 1 4.500000 4.500000 -4.500000 1.000000 0.000000 -1 1 4.500000 -4.500000 -4.500000 1.000000 1.000000 -1 1 4.500000 4.500000 -4.500000 0.000000 0.000000 -1 1 4.500000 -4.500000 -4.500000 0.000000 1.000000 -1 1 -4.500000 4.500000 -4.500000 1.000000 0.000000 -1 1 -4.500000 -4.500000 -4.500000 1.000000 1.000000 -1 1 -4.500000 4.500000 -4.500000 0.000000 0.000000 -1 1 -4.500000 -4.500000 -4.500000 0.000000 1.000000 -1 1 -4.500000 4.500000 4.500000 1.000000 0.000000 -1 1 -4.500000 -4.500000 4.500000 1.000000 1.000000 -1 1 -4.500000 4.500000 4.500000 0.000000 1.000000 -1 1 4.500000 4.500000 4.500000 1.000000 1.000000 -1 1 -4.500000 -4.500000 4.500000 0.000000 0.000000 -1 1 4.500000 -4.500000 4.500000 1.000000 0.000000 -1 6 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 -1.000000 -1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 -1.000000 0.000000 12 1 0 1 2 0 0 0 1 1 1 3 2 0 0 0 1 1 4 5 6 1 1 1 2 1 5 7 6 1 1 1 2 1 8 9 10 2 2 2 1 1 9 11 10 2 2 2 1 1 12 13 14 3 3 3 2 1 13 15 14 3 3 3 2 1 12 16 6 4 4 4 3 1 16 17 6 4 4 4 3 1 18 13 19 5 5 5 3 1 13 7 19 5 5 5 3 Materials: 0 Bones: 0 GroupComments: 0 MaterialComments: 0 BoneComments: 0 ModelComment: 0 |
|
From: Charles L. <cn...@us...> - 2005-12-17 22:58:38
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16472 Modified Files: ScreenExample2DSS.cpp Log Message: Make 2DSS use themes. Index: ScreenExample2DSS.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/ScreenExample2DSS.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ScreenExample2DSS.cpp 7 Oct 2005 18:14:17 -0000 1.5 --- ScreenExample2DSS.cpp 17 Dec 2005 22:58:30 -0000 1.6 *************** *** 5,8 **** --- 5,9 ---- #include "MercuryDisplay.h" //for access to the DISPLAY global singleton #include "CN3D.h" //for collision functions + #include "MercuryTheme.h" //For the theme #define MC_INPUTMAPPED 1 //convention: MESSAGE CODE *************** *** 14,19 **** KeyMapping( button_space ); - const CString ThisScreenPrefix = "ScreenExample2DSS/"; - //In order to make it easy to include screens in the project without modifying //core files, by doing this, you only have link in the ScreenExample, and with --- 15,18 ---- *************** *** 32,36 **** { m_modMan.SetName( "Man" ); //Set the "Man"'s name. (for debug purposes) ! m_modMan.Load( ThisScreenPrefix + "man.txt" ); //Load the model m_modMan.SetRotY( 90 ); //Rotate the man so he is facing the camera AddObject( &m_modMan ); //Make the engine take control of drawing and tweening the man --- 31,35 ---- { m_modMan.SetName( "Man" ); //Set the "Man"'s name. (for debug purposes) ! m_modMan.Load( GET_MODEL_BY_NAME( "Man" ) ); //Load the model m_modMan.SetRotY( 90 ); //Rotate the man so he is facing the camera AddObject( &m_modMan ); //Make the engine take control of drawing and tweening the man *************** *** 40,44 **** m_sprBackground.SetName( "Background" ); //Set the background's name ! m_sprBackground.LoadPNG( ThisScreenPrefix + "Background.png" ); //Load the background PNG m_sprBackground.SetScale( MercuryPoint( 2000, 2000, 2000 )); //Make the sky look really big m_sprBackground.SetZ(-90); //Move the sky behind the man and boxes --- 39,43 ---- m_sprBackground.SetName( "Background" ); //Set the background's name ! m_sprBackground.LoadPNG( GET_GRAPHIC_BY_NAME("Background") ); //Load the background PNG m_sprBackground.SetScale( MercuryPoint( 2000, 2000, 2000 )); //Make the sky look really big m_sprBackground.SetZ(-90); //Move the sky behind the man and boxes *************** *** 50,54 **** //top object is drawn, the alpha will not transfer properly (under OpenGL or DirectX) m_sprTitle.SetName( "Title Sprite" ); ! m_sprTitle.LoadPNG( ThisScreenPrefix + "Title.png" ); //Give the title sprite a command: --- 49,53 ---- //top object is drawn, the alpha will not transfer properly (under OpenGL or DirectX) m_sprTitle.SetName( "Title Sprite" ); ! m_sprTitle.LoadPNG( GET_GRAPHIC_BY_NAME( "Title" ) ); //Give the title sprite a command: *************** *** 63,67 **** //Call our private member function ! LoadMap( ThisScreenPrefix + "map.txt" ); //Set up basic physics constraints for this screen --- 62,66 ---- //Call our private member function ! LoadMap( GET_FILE_BY_NAME( "Map" ) ); //Set up basic physics constraints for this screen *************** *** 218,221 **** --- 217,222 ---- //Make sure we draw the title sprite last. m_sprBackground.Draw(); + + //Draw the title sprite m_sprTitle.Draw(); } *************** *** 257,261 **** //Instanciate a new box. m_vBoxes[m_vBoxes.size()-1] = new MercuryMilkshapeModel; ! m_vBoxes[m_vBoxes.size()-1]->Load( ThisScreenPrefix + "box.txt" ); //Load a model of the box m_vBoxes[m_vBoxes.size()-1]->SetName( ssprintf( "Box%d", m_vBoxes.size() ) ); m_vBoxes[m_vBoxes.size()-1]->SetX( x*4 ); //Set its location --- 258,262 ---- //Instanciate a new box. m_vBoxes[m_vBoxes.size()-1] = new MercuryMilkshapeModel; ! m_vBoxes[m_vBoxes.size()-1]->Load( GET_MODEL_BY_NAME ( "Box" ) ); //Load a model of the box m_vBoxes[m_vBoxes.size()-1]->SetName( ssprintf( "Box%d", m_vBoxes.size() ) ); m_vBoxes[m_vBoxes.size()-1]->SetX( x*4 ); //Set its location |
|
From: Charles L. <cn...@us...> - 2005-12-17 22:58:16
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16389 Modified Files: MercuryModel.cpp Log Message: Make models follow theme. Index: MercuryModel.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryModel.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** MercuryModel.cpp 30 Nov 2005 02:38:45 -0000 1.31 --- MercuryModel.cpp 17 Dec 2005 22:58:07 -0000 1.32 *************** *** 83,87 **** void MercuryModel::Load(CString path) { ! m_path = "Models/" + path.substr(0, path.find_last_of("/")+1); m_filename = path.substr(path.find_last_of("/")+1); OpenFile(m_path + m_filename); --- 83,87 ---- void MercuryModel::Load(CString path) { ! m_path = path.substr(0, path.find_last_of("/")+1); m_filename = path.substr(path.find_last_of("/")+1); OpenFile(m_path + m_filename); |
|
From: Charles L. <cn...@us...> - 2005-12-17 22:54:45
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15878 Modified Files: MercuryTheme.cpp MercuryTheme.h Log Message: Add stuff for Getting files & models by name. Index: MercuryTheme.h =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryTheme.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MercuryTheme.h 12 Oct 2005 00:57:51 -0000 1.4 --- MercuryTheme.h 17 Dec 2005 22:54:36 -0000 1.5 *************** *** 50,55 **** --- 50,61 ---- /** Get path to a file, in any theme. This will check to see if any of the themes have the file in order. If the file exists, it will put the path to the file (including the file) in Path and return true, else it will return false. */ bool GetPathToFile( const CString & File, CString & Path ); + + /** Get path to file in the File/ folder */ + CString GetPathToFile( const CString &Name ); /** Get the path to a specific graphic, check all themes for the graphic, and if none is found, return the path to the default missing image. */ CString GetPathToGraphic( const CString &Name ); + /** Get the path to a specific model, check all themes for the graphic, and if none is found, return the path to the default missing model. */ + CString GetPathToModel( const CString &Name ); + private: std::vector < MercuryTheme > *m_vThemes; *************** *** 60,63 **** --- 66,71 ---- /** Get the path to a theme according to what metrics wants */ #define GET_GRAPHIC_BY_NAME( x ) THEME.GetPathToGraphic( THEME.GetMetricS( GetName(), x ) ) + #define GET_MODEL_BY_NAME( x ) THEME.GetPathToModel( THEME.GetMetricS( GetName(), x ) ) + #define GET_FILE_BY_NAME( x ) THEME.GetPathToFile( THEME.GetMetricS( GetName(), x ) ) #endif Index: MercuryTheme.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryTheme.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MercuryTheme.cpp 11 Oct 2005 21:03:44 -0000 1.3 --- MercuryTheme.cpp 17 Dec 2005 22:54:36 -0000 1.4 *************** *** 113,116 **** --- 113,125 ---- } + CString MercuryThemeManager::GetPathToFile( const CString & Name ) + { + CString Ret; + CString In = "Files/" + Name; + if ( !GetPathToFile( In, Ret ) ) + Ret = ""; + return Ret; + } + CString MercuryThemeManager::GetPathToGraphic( const CString & Name ) { *************** *** 122,125 **** --- 131,143 ---- } + CString MercuryThemeManager::GetPathToModel( const CString &Name ) + { + CString Ret; + CString In = "Models/" + Name; + if ( !GetPathToFile( In, Ret ) ) + Ret = "Themes/_missing.txt"; + return Ret; + } + /* * (c) 2005 Charles Lohr |
|
From: Josh A. <axl...@us...> - 2005-12-11 21:43:56
|
Update of /cvsroot/hgengine/Mercury/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19938/src Modified Files: MercuryOGL.cpp Log Message: Trivial change, I want to see if the e-mail notification works. Index: MercuryOGL.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryOGL.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** MercuryOGL.cpp 30 Nov 2005 19:04:05 -0000 1.32 --- MercuryOGL.cpp 11 Dec 2005 21:43:47 -0000 1.33 *************** *** 195,199 **** --- 195,201 ---- glBindTexture(GL_TEXTURE_2D, tID); else + { glBindTexture(GL_TEXTURE_2D, 0); + } } |