-
Notifications
You must be signed in to change notification settings - Fork 0
/
singleFrameTimeTest.py
58 lines (50 loc) · 1.42 KB
/
singleFrameTimeTest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from hashlib import new
from PhiPlayer.Events import Event, Events
import profile
import line_profiler
from PhiPlayer.View import newPainter
from PhiPlayer.Song import Song
from PhiPlayer.officalChartLoader import officalChartLoader
from PyQt5.QtGui import QImage, QPixmap, QGuiApplication
p = line_profiler.LineProfiler()
def preWork():
chartAddr = "assets/Chart_IN_Error"
illustrationAddr = "./assets/IllustrationBlur.png"
illustration = QPixmap(illustrationAddr)
f = open(chartAddr)
chart = officalChartLoader(f)
f.close()
global song
song = Song(
chart,
illustration
)
global picmap
picmap = QPixmap(1920, 1080)
picmap.selectedObj = []
picmap.objAndRects = None
global time
time = 90.0 # s
import PhiPlayer.HitAnimation
PhiPlayer.HitAnimation.init()
def render():
global picmap
global time
global song
painter = newPainter()
painter.begin(picmap)
painter.setWindow(0, picmap.height(), picmap.width(), -picmap.height())
painter.drawSong(time, song)
painter.end()
# if __name__ == "__main__":
app = QGuiApplication([])
preWork()
render()
newPainter.drawSong = p(newPainter.drawSong)
# newPainter.drawNote = p(newPainter.drawNote)
newPainter.drawJudgeLine = p(newPainter.drawJudgeLine)
newPainter.drawChart = p(newPainter.drawChart)
newPainter.drawHit = p(newPainter.drawHit)
# Events.get = p(Events.get)
render()
p.print_stats()