Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze Plymouth visual style
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Breeze Plymouth visual style
Commits
6b7d5e15
Commit
6b7d5e15
authored
Nov 08, 2017
by
Harald Sitter
🎶
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some new debug tech simulating an on-screen logging system
parent
fce8b9f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
breeze/breeze.script.cmake
breeze/breeze.script.cmake
+32
-0
No files found.
breeze/breeze.script.cmake
View file @
6b7d5e15
...
...
@@ -133,6 +133,11 @@ SpriteImage.SetSpriteImage = fun(image) {
};
// --------------------------------- Debug ---------------------------------- //
// TODO: it may be handy to move all debug methods into a separate file
// and configure_file them into the master script iff explicitly enabled.
// This would reduce the script size and possibly eval time. Although
// in the grand scheme of things I am not sure this script takes up a lot of
// resources to begin with.
debugsprite =
Sprite
()
;
debugsprite_bottom =
Sprite
()
;
debugsprite_medium =
Sprite
()
;
...
...
@@ -190,6 +195,33 @@ fun DebugMedium(text) {
debugsprite_medium.
SetPosition
(
0,
(
Window.
GetHeight
(
0
)
- 60
)
, 1
)
;
}
/**
* Debug helper to simulate something like a log on the right hand side of
* the display. There is a global ActionStack which gets .
Log
(
"foo"
)
'd into
* which essentially prepends the string to an internal string buffer which
* is then rendered into a sprite.
* The buffer is not ever emptied so this basically is growing memory
* consumption. And it's offset placing from the rigth side is also getting
* increasingly wrong as the largest ever logged line dictates the offset.
*/
Logger =
fun
()
{
local.logger = [];
local.logger.log =
""
;
local.logger.sprite =
Sprite
()
;
return logger | global.Logger;
} | [];
Logger.Log =
fun
(
text
)
{
log = text +
"
\n
"
+ log;
Print
()
;
};
Logger.Print =
fun
()
{
sprite.
SetImage
(
ImageToText
(
log
))
;
sprite.
SetPosition
(
Window.
GetMaxWidth
()
- sprite.
GetImage
()
.
GetWidth
()
- 16, 0, 1
)
;
};
global.logger =
Logger
()
;
fun
TextYOffset
()
{
local.y;
local.text_height;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment