Changeset 2414
- Timestamp:
- Feb 15, 2013, 6:44:18 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build/vs2010/Lol.sln
r2406 r2414 128 128 EndProject 129 129 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshViewer", "..\..\test\MeshViewer.vcxproj", "{7CE9FE12-E4AB-4A22-90D4-2C15F0C30D4E}" 130 EndProject 131 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tactics", "..\..\people\touky\private\Tactics\Tactics.vcxproj", "{25493FC8-75AC-4703-AD57-AB0C2A0FB79C}" 130 132 EndProject 131 133 Global … … 649 651 {58922993-9830-4A40-B462-0326342F69ED}.Release|Xbox 360.ActiveCfg = Release|Any CPU 650 652 {834852DB-EDB6-4FD0-BCF9-45CD01126962}.Debug|Any CPU.ActiveCfg = Debug|Xbox 360 651 {834852DB-EDB6-4FD0-BCF9-45CD01126962}.Debug|Mixed Platforms.ActiveCfg = Debug| Xbox 360652 {834852DB-EDB6-4FD0-BCF9-45CD01126962}.Debug|Mixed Platforms.Build.0 = Debug| Xbox 360653 {834852DB-EDB6-4FD0-BCF9-45CD01126962}.Debug|Mixed Platforms.Deploy.0 = Debug| Xbox 360653 {834852DB-EDB6-4FD0-BCF9-45CD01126962}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 654 {834852DB-EDB6-4FD0-BCF9-45CD01126962}.Debug|Mixed Platforms.Build.0 = Debug|Win32 655 {834852DB-EDB6-4FD0-BCF9-45CD01126962}.Debug|Mixed Platforms.Deploy.0 = Debug|Win32 654 656 {834852DB-EDB6-4FD0-BCF9-45CD01126962}.Debug|PS3.ActiveCfg = Debug|PS3 655 657 {834852DB-EDB6-4FD0-BCF9-45CD01126962}.Debug|PS3.Build.0 = Debug|PS3 … … 710 712 {7CE9FE12-E4AB-4A22-90D4-2C15F0C30D4E}.Release|x64.Build.0 = Release|x64 711 713 {7CE9FE12-E4AB-4A22-90D4-2C15F0C30D4E}.Release|Xbox 360.ActiveCfg = Release|x64 714 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Debug|Any CPU.ActiveCfg = Debug|x64 715 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 716 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 717 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Debug|PS3.ActiveCfg = Debug|x64 718 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Debug|Win32.ActiveCfg = Debug|Win32 719 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Debug|Win32.Build.0 = Debug|Win32 720 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Debug|x64.ActiveCfg = Debug|x64 721 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Debug|x64.Build.0 = Debug|x64 722 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Debug|Xbox 360.ActiveCfg = Debug|x64 723 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Release|Any CPU.ActiveCfg = Release|x64 724 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Release|Mixed Platforms.ActiveCfg = Release|x64 725 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Release|Mixed Platforms.Build.0 = Release|x64 726 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Release|PS3.ActiveCfg = Release|x64 727 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Release|Win32.ActiveCfg = Release|Win32 728 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Release|Win32.Build.0 = Release|Win32 729 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Release|x64.ActiveCfg = Release|x64 730 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Release|x64.Build.0 = Release|x64 731 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C}.Release|Xbox 360.ActiveCfg = Release|x64 712 732 EndGlobalSection 713 733 GlobalSection(SolutionProperties) = preSolution … … 746 766 {587FCCE9-1D8D-4398-B8B6-E8F4E9A92233} = {B357514A-7881-422D-8358-161B689E7620} 747 767 {EE203B88-44CF-4859-9D42-7A5F43FECB52} = {9EA99B18-D352-47F6-BC04-A0B49CAA2772} 768 {25493FC8-75AC-4703-AD57-AB0C2A0FB79C} = {9EA99B18-D352-47F6-BC04-A0B49CAA2772} 748 769 {A69411B3-6DE8-404E-8E70-0D3375A7492A} = {0A1651FC-322B-4B04-82CB-28E9046D9383} 749 770 {5A77DCDD-2CBA-43E9-8B45-00C281443F77} = {0A1651FC-322B-4B04-82CB-28E9046D9383} -
trunk/src/easymesh/easymesh.cpp
r2410 r2414 1151 1151 SetTexCoordData(vec2(.0f, .5f), vec2(.5f, .5f)); 1152 1152 SetCurColor(m_color); 1153 AppendDisc(nsides, r1);1153 AppendDisc(nsides, d1); 1154 1154 Translate(vec3(.0f, h, .0f)); 1155 1155 RotateX(180.0f); … … 1157 1157 SetTexCoordData(vec2(.5f, .5f), vec2(.5f, .5f)); 1158 1158 SetCurColor(m_color2); 1159 AppendDisc(nsides, r2);1159 AppendDisc(nsides, d2); 1160 1160 Translate(vec3(.0f, h * .5f, .0f)); 1161 1161 CloseBrace(); … … 1294 1294 int rid[] = { id[k + l], id[(k + 1) % 3 + l], id[(k + 2) % 3 + l] }; 1295 1295 AddVertex(p[rid[0]]); 1296 vec2 new_uv; 1296 1297 if (uv[rid[0]].x < .0f) 1297 SetCurVertTexCoord(vec2((uv[rid[1]].x + uv[rid[2]].x) * .5f, 1298 uv[rid[0]].y)); 1298 new_uv = vec2((uv[rid[1]].x + uv[rid[2]].x) * .5f, uv[rid[0]].y); 1299 1299 else 1300 SetCurVertTexCoord(uv[rid[0]]); 1300 new_uv = uv[rid[0]]; 1301 SetCurVertTexCoord(vec2(0.f, 1.f) - new_uv); 1301 1302 } 1302 1303 AppendTriangle(0, 2, 1, m_vert.Count() - 3); … … 1432 1433 //Bottom vertices 1433 1434 AddVertex(vec3(-d.x, -d.y - chamf, +d.z)); 1434 SetCurVertTexCoord(vec2( 0.f, 1.f));1435 SetCurVertTexCoord(vec2(.5f, 1.f)); 1435 1436 AddVertex(vec3(-d.x, -d.y - chamf, -d.z)); 1436 SetCurVertTexCoord(vec2( 0.f, .5f));1437 SetCurVertTexCoord(vec2(.5f, .5f)); 1437 1438 AddVertex(vec3(+d.x, -d.y - chamf, -d.z)); 1438 SetCurVertTexCoord(vec2(. 5f, .5f));1439 SetCurVertTexCoord(vec2(.0f, .5f)); 1439 1440 AddVertex(vec3(+d.x, -d.y - chamf, +d.z)); 1440 SetCurVertTexCoord(vec2(. 5f, 1.f));1441 SetCurVertTexCoord(vec2(.0f, 1.f)); 1441 1442 1442 1443 //Top vertices 1443 1444 AddVertex(vec3(-d.x, +d.y + chamf, -d.z)); 1444 SetCurVertTexCoord(vec2( 0.f, 1.f));1445 SetCurVertTexCoord(vec2(1.f, 1.f)); 1445 1446 AddVertex(vec3(-d.x, +d.y + chamf, +d.z)); 1446 SetCurVertTexCoord(vec2( 0.f, .5f));1447 SetCurVertTexCoord(vec2(1.f, .5f)); 1447 1448 AddVertex(vec3(+d.x, +d.y + chamf, +d.z)); 1448 1449 SetCurVertTexCoord(vec2(.5f, .5f)); … … 1622 1623 AddVertex(p); SetCurVertTexCoord(vec2(.5f, 0.133975f)); 1623 1624 p = m * p; 1625 AddVertex(p); SetCurVertTexCoord(vec2(0.f, 1.f)); 1626 if (fade) 1627 SetCurVertColor(m_color2); 1628 p = m * p; 1624 1629 AddVertex(p); SetCurVertTexCoord(vec2(1.f, 1.f)); 1625 1630 if (fade) 1626 1631 SetCurVertColor(m_color2); 1627 p = m * p;1628 AddVertex(p); SetCurVertTexCoord(vec2(0.f, 1.f));1629 if (fade)1630 SetCurVertColor(m_color2);1631 1632 1632 1633 AppendTriangle(0, 1, 2, m_vert.Count() - 3); … … 1642 1643 void EasyMesh::AppendSimpleQuad(vec2 p1, vec2 p2, float z, int fade) 1643 1644 { 1644 AddVertex(vec3(p2.x, z, -p1.y)); SetCurVertTexCoord(vec2( 0.f, 1.f));1645 AddVertex(vec3(p2.x, z, -p1.y)); SetCurVertTexCoord(vec2(1.f, 0.f)); 1645 1646 AddVertex(vec3(p2.x, z, -p2.y)); SetCurVertTexCoord(vec2(0.f, 0.f)); 1646 AddVertex(vec3(p1.x, z, -p2.y)); SetCurVertTexCoord(vec2(1.f, 0.f)); 1647 if (fade) 1648 SetCurVertColor(m_color2); 1647 AddVertex(vec3(p1.x, z, -p2.y)); SetCurVertTexCoord(vec2(0.f, 1.f)); 1648 if (fade) SetCurVertColor(m_color2); 1649 1649 AddVertex(vec3(p1.x, z, -p1.y)); SetCurVertTexCoord(vec2(1.f, 1.f)); 1650 if (fade) 1651 SetCurVertColor(m_color2); 1650 if (fade) SetCurVertColor(m_color2); 1652 1651 1653 1652 AppendQuad(0, 1, 2, 3, m_vert.Count() - 4); -
trunk/src/easymesh/easymesh.h
r2410 r2414 20 20 #define VU_VANILLA 0 21 21 22 #define VERTEX_USEAGE VU_ VANILLA22 #define VERTEX_USEAGE VU_TEX_UV 23 23 24 24 #if !defined __EASYMESH_EASYMESH_H__ -
trunk/src/tileset.cpp
r2312 r2414 175 175 } 176 176 177 ShaderTexture TileSet::GetTexture() const 178 { 179 return data->m_texture->GetTexture(); 180 } 181 177 182 void TileSet::Bind() 178 183 { -
trunk/src/tileset.h
r2216 r2414 44 44 ivec2 GetCount() const; 45 45 ivec2 GetSize(int tileid) const; 46 ShaderTexture GetTexture() const; 46 47 void Bind(); 47 48 void Unbind(); -
trunk/test/MeshViewer.cpp
r2404 r2414 22 22 using namespace lol; 23 23 24 static int const TEXTURE_WIDTH = 256; 25 24 26 LOLFX_RESOURCE_DECLARE(shinyfur); 27 LOLFX_RESOURCE_DECLARE(shinyMVTexture); 25 28 26 29 #define IPT_CAM_RESET "Cam_Center" … … 96 99 97 100 m_angle = 0; 101 DefaultTexture = NULL; 98 102 99 103 //Camera Setup … … 326 330 } 327 331 332 if (!DefaultTexture) 333 { 334 m_texture_shader = Shader::Create(LOLFX_RESOURCE_NAME(shinyMVTexture)); 335 m_texture_uni = m_texture_shader->GetUniformLocation("u_Texture"); 336 //m_image = new Image("data/MeshViewerTestTexture.png"); 337 DefaultTexture = Tiler::Register("data/MeshViewerTestTexture.png", ivec2(0), ivec2(0,1)); 338 339 //ivec2 size = m_image->GetSize(); 340 //// m_image->GetFormat() 341 //m_texture = new Texture(m_image->GetSize(), PixelFormat::ABGR_8); 342 //m_texture->SetData(m_image->GetData()); 343 // PixelFormat::ABGR_8 344 } 345 else if (m_texture && DefaultTexture) 346 m_texture_shader->SetUniform(m_texture_uni, DefaultTexture->GetTexture(), 0); 347 328 348 for (int i = 0; i < m_meshes.Count(); i++) 329 349 { … … 334 354 m_meshes[i].m1.MeshConvert(Shader::Create(LOLFX_RESOURCE_NAME(shinyfur))); 335 355 #else 336 m_meshes[i].m1.MeshConvert(); 356 m_meshes[i].m1.MeshConvert(m_texture_shader); 357 //m_meshes[i].m1.MeshConvert(); 337 358 #endif 338 359 m_meshes[i].m2 = true; … … 402 423 Array<Light *> m_lights; 403 424 Camera * m_camera; 425 Shader * m_texture_shader; 426 TileSet * DefaultTexture; 427 Texture * m_texture; 428 ShaderUniform m_texture_uni; 429 Image * m_image; 404 430 float m_fov; 405 431 float m_fov_damp; -
trunk/test/MeshViewer.vcxproj
r2389 r2414 53 53 <ItemGroup> 54 54 <LolFxCompile Include="shinyfur.lolfx" /> 55 <LolFxCompile Include="shinyMVTexture.lolfx" /> 55 56 </ItemGroup> 56 57 <PropertyGroup Label="Globals"> -
trunk/test/MeshViewerBuffer.txt
r2410 r2414 1 [sc#88f ab 4 4 4 smth 3 1 1 ]//twy 45 0 bdxy 90 0 splt 5 tz 2 1 [sc#fff scb#fff ato 20 8 12 rx0] 2 [sc#fff scb#fff acg 8 2 5 1 6 8 4 2 .1 1] 3 4 //[sc#fff ab 4 4 4 smth 0 1 1 ]//twy 45 0 bdxy 90 0 splt 5 tz 2 2 5 //[sc#88f ab 4 4 4 tx 4 ab 4 4 4 tx -2 tax .4 .4 0] 3 6 //[sc#88f ab .25 1 1 tx .25 ab .25 1 1 tx .25 ab .25 1 1 tx .25 ab .25 1 1 tx .125 stx 10 0 0] 4 //[sc#ff2 scb#2ff acg 13 2 1 1 8 8 4 4 0 1 tax -2 0 0 0] 7 // tax -2 0 0 0 5 8 //[sc#88f ab 4 4 4 tx 4 ab 4 4 4 tx -2 shz 1 0 0 0] 6 //[sc#ff 2 asph 4 4 shx 0 0 0 0]9 //[sc#fff asph 4 4] 7 10 //[sc#ff2 asph 4 4 tax .4 .4 0] 8 11 //[sc#ff2 asph 2 4] 9 //[sc#ff 2acap 1 4 4]10 //[sc#ff 2 scb#ff2ac 10 4 4 4 0 0 1]12 //[sc#fff acap 1 4 4] 13 //[sc#fff scb#fff ac 10 4 4 4 0 0 1] 11 14 //[sc#ff2 scb#ff2 ad 10 4 0] 12 //[sc#ff2 scb#ff2 ato 40 1 4] 13 //[sc#ff2 scb#2ff at 4 1] 14 //[sc#ff2 scb#2ff aq 4 0] 15 //[sc#ff2 scb#2ff aes 5 3 6 2] 16 //[sc#ff2 scb#2ff as 4 2 4 0 0] 17 //[sc#ff2 scb#2ff acg 2 10 .1 .1 .4 .4 .1 .1 0 1] 15 //[sc#fff scb#fff at 4 1] 16 //[sc#fff scb#000 aq 4 1] 17 //[sc#fff scb#2ff aes 5 3 6 2] 18 //[sc#fff scb#2ff as 4 2 4 0 0] 19 //[sc#fff scb#fff acg 2 10 .1 .1 .4 .4 .1 .1 0 1] 18 20 19 21 //[sc#ff2 asph 2 10 10 10]
Note: See TracChangeset
for help on using the changeset viewer.