Skip to content

Commit

Permalink
Use 'out' folder as output path
Browse files Browse the repository at this point in the history
  • Loading branch information
JayFoxRox committed Jul 19, 2018
1 parent e78f694 commit de008c2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
__pycache__/

# Debug output
*.png
*.html
out/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ nv2a-trace can dump intermediate rendering steps like this:

![Screenshot of Burnout 3](https://i.imgur.com/a2GuIFz.png)

Currently, most output will be send to PNG files in the current folder.
Currently, most output will be send to PNG files in the "out" folder.
Additionally a "debug.html" will be created which shows the captured commands.
This output format is a temporary solution.
Eventually there'll be one of the following:
Expand Down
7 changes: 4 additions & 3 deletions Trace.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import struct

import Texture
Expand All @@ -8,7 +9,7 @@
flipStallCount = 0


debugLog = "debug.html"
debugLog = os.path.join("out", "debug.html")
def addHTML(xx):
f = open(debugLog,"a")
f.write("<tr>")
Expand Down Expand Up @@ -99,7 +100,7 @@ def recordPGRAPHMethod(xbox, method, data):
path = "command%d--tex_%d.png" % (commandCount, i)
img = Texture.dumpTextureUnit(xbox, i)
if img != None:
img.save(path)
img.save(os.path.join("out", path))
extraHTML += ['<img height="128px" src="%s" alt="%s"/>' % (path, path)]
else:
# Dump finished surface
Expand Down Expand Up @@ -153,7 +154,7 @@ def recordPGRAPHMethod(xbox, method, data):
if True:
img = img.convert('RGB')

img.save(path)
img.save(os.path.join("out", path))

# Check for texture address changes
for i in range(4):
Expand Down
7 changes: 7 additions & 0 deletions nv2a-trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

from xboxpy import *

# Create output folder
import os
try:
os.mkdir("out")
except:
pass

import time
import signal
import sys
Expand Down

0 comments on commit de008c2

Please sign in to comment.