Skip to content

Commit

Permalink
Add texture id info used with the model in model viewer, texture file…
Browse files Browse the repository at this point in the history
… need to be extract manually.

Signed-off-by: Khral Steelforge <[email protected]>
  • Loading branch information
kytulendu committed Apr 24, 2014
1 parent ce7cc06 commit 6dc3b55
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
15 changes: 11 additions & 4 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
Change log
----------

Gw2Browser_2014-01-30
Gw2Browser_2014-04-24
---------------------
Change:
- Fix crash when viewing Luminance DDS file.
- Fix camera not look at center of model.
- Hack fix for reading 126x64 ATEX files.
- Add texture id info used with the model in model viewer, texture file need to be extract manually.

Gw2Browser_2014-03-25
---------------------
Change:
- Hack for read 126x64 ATEX files.
- Model Reader now use high-res texture, still need to figure out ModelReader to not load LOD models.
- WebP support, can export to png. WebP can open by Chrome browser.
- Bink 2 video detect, to play it you need The RAD Video Tools
Expand All @@ -19,6 +22,10 @@ the reason why it crash is unknown. (maybe they use custom Bink 2 format?)
Removed:
- ABFF file support.

Fix:
- Fix crash when viewing Luminance DDS file.
- Fix camera not look at center of model.

Issue:
- Memory leak on viewing WebP files.

Expand Down
2 changes: 1 addition & 1 deletion src/Readers/ImageReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ namespace gw2b {
uint16 width = atex->width;
uint16 height = atex->height;

// Hack fix for 126x64 ATEX
// Hack for read 126x64 ATEX
if ( width == 126 && height == 64 ) {
width = 128;
}
Expand Down
25 changes: 25 additions & 0 deletions src/Viewers/ModelViewer/ModelViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,31 @@ namespace gw2b {
this->drawText( 0, clientSize.y - 0x28, wxT( "Rotate: Left mouse button" ) );
this->drawText( 0, clientSize.y - 0x14, wxT( "Zoom: Scroll wheel" ) );

// Texture That need to extract manualy.
wxString diffuseMapFile = wxString( wxT( "diffuseMap:\n" ) );
wxString normalMapFile = wxString( wxT( "normalMap:\n" ) );
wxString lightMapFile = wxString( wxT( "lightMap:\n" ) );

for ( uint i = 0; i < m_model.numMaterialData( ); i++ ) {
auto& material = m_model.materialData( i );

if ( material.diffuseMap ) {
diffuseMapFile += wxString::Format( wxT( "%d\n" ), material.diffuseMap );
}
if ( material.normalMap ) {
normalMapFile += wxString::Format( wxT( "%d\n" ), material.normalMap );
}
if ( material.lightMap ) {
lightMapFile += wxString::Format( wxT( "%d\n" ), material.lightMap );
}
}

this->drawText( clientSize.x - 0x11c, 0, wxT( "Textures" ) );

this->drawText( clientSize.x - 0x4f, 0, wxString( diffuseMapFile ) );
this->drawText( clientSize.x - 0x9e, 0, wxString( normalMapFile ) );
this->drawText( clientSize.x - 0xdd, 0, wxString( lightMapFile ) );

this->endFrame( );
}

Expand Down

0 comments on commit 6dc3b55

Please sign in to comment.