forked from potato47/ccc-devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nextfu
committed
Aug 3, 2022
1 parent
90baadd
commit 77073f2
Showing
12 changed files
with
249 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<div id="dev-app" style="width: 400px;height: 100%;display: none;flex-direction: column;justify-content: center;"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
<div id="dev-app" style="width: 400px;height: 100%;display: flex;flex-direction: column;justify-content: center;"></div> | ||
<script type="module" src="/src/main.ts"></script> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...w-template/dist/assets/index.a2551c8e.css → ...w-template/dist/assets/index.9940da1d.css
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<script type="module" crossorigin src="/dist/assets/index.1b8a852c.js"></script> | ||
<link rel="stylesheet" href="/dist/assets/index.a2551c8e.css"> | ||
<div id="dev-app" style="width: 400px;height: 100%;display: none;flex-direction: column;justify-content: center;"></div> | ||
<script type="module" crossorigin src="/dist/assets/index.17ee060a.js"></script> | ||
<link rel="stylesheet" href="/dist/assets/index.9940da1d.css"> | ||
<div id="dev-app" style="width: 400px;height: 100%;display: flex;flex-direction: column;justify-content: center;"></div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<template> | ||
<div style="width: 100%;height: 30px;background-color: #26282f;display: flex;align-items: center;justify-content: center;color: white;" | ||
class="modal-drag"> | ||
Profiler | ||
</div> | ||
<div style="width: 100%;"> | ||
<div class="row" v-for="item in items" :key="item.key"> | ||
<span>{{ item.desc }}</span> | ||
<span style="flex: 1;text-align: right;">{{ item.value }}</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { onMounted, ref } from 'vue-demi'; | ||
const props = defineProps({ | ||
show: Boolean, | ||
}); | ||
let updateKey = ref(1); | ||
let items = ref<any[]>([]); | ||
function refresh() { | ||
if (props.show) { | ||
updateKey.value = -updateKey.value; | ||
} | ||
// @ts-ignore | ||
const stats = cc.profiler._stats; | ||
items.value.forEach(item => { | ||
const data = stats[item.key]; | ||
item.desc = data.desc; | ||
if (data.isInteger) { | ||
item.value = data.counter._value | 0; | ||
} else { | ||
item.value = data.counter._value.toFixed(2); | ||
} | ||
}); | ||
setTimeout(refresh, 1000); | ||
} | ||
function init() { | ||
items.value = [ | ||
{ key: 'fps', desc: '', value: 0 }, | ||
{ key: 'draws', desc: '', value: 0 }, | ||
{ key: 'frame', desc: '', value: 0 }, | ||
{ key: 'instances', desc: '', value: 0 }, | ||
{ key: 'tricount', desc: '', value: 0 }, | ||
{ key: 'logic', desc: '', value: 0 }, | ||
{ key: 'physics', desc: '', value: 0 }, | ||
{ key: 'render', desc: '', value: 0 }, | ||
{ key: 'textureMemory', desc: '', value: 0 }, | ||
{ key: 'bufferMemory', desc: '', value: 0 }, | ||
]; | ||
refresh(); | ||
} | ||
onMounted(() => { | ||
init(); | ||
}); | ||
</script> | ||
|
||
<style> | ||
.row { | ||
display: flex; | ||
justify-content: center; | ||
margin: 10px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters