Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Optimizations to fix #268 & #267.
Browse files Browse the repository at this point in the history
  • Loading branch information
jessefreeman committed May 19, 2020
1 parent 5c6b3f4 commit 9e148f7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Disks/PixelVisionOS/System/Tools/ColorTool/saves.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"GameChip":
{
"savedData":{
"selectedSprite": "-1",
"selectedPalette": "-1",
"selectedColor": "-1",
"rootDirectory": "/Workspace/SpaceRanger/",
"sessionID": "202005060916591670",
"selectedPalettePage": "0",
"selectedSpritePage": "1",
"selectedPalettePage": "1"
"sessionID": "202005182033044056",
"rootDirectory": "/Workspace/Spirally-Spiral/",
"selectedColor": "-1",
"selectedPalette": "-1",
"selectedSprite": "-1"
}
}
}
4 changes: 2 additions & 2 deletions Disks/PixelVisionOS/System/Tools/FontTool/saves.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"GameChip":
{
"savedData":{
"rootDirectory": "/Workspace/NewProjectB/",
"sessionID": "202005040753365042"
"sessionID": "202005182033044056",
"rootDirectory": "/Workspace/Spirally-Spiral/"
}
}
}
6 changes: 3 additions & 3 deletions Disks/PixelVisionOS/System/Tools/WorkspaceTool/saves.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"GameChip":
{
"savedData":{
"lastPath": "/Workspace/DragonSweeper/",
"selection": "9",
"sessionID": "202005182033044056",
"scrollPos": "0",
"sessionID": "202005080627277948"
"selection": "0",
"lastPath": "/Workspace/Spirally-Spiral/"
}
}
}
10 changes: 5 additions & 5 deletions SDK/Engine/Chips/Graphics/DisplayChip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ public DrawRequest NextDrawRequest()
// int colorID;
// // int i;
// int index;
var tmpWidth = Width;
var tmpHeight = Height;

_total = width * height;

Expand All @@ -263,14 +265,12 @@ public DrawRequest NextDrawRequest()

// Make sure x & y are wrapped around the display
// Note: + size and the second modulo operation are required to get wrapped values between 0 and +size
var size = this.Height;
_srcY = (_srcY % size + size) % size;
size = this.Width;
_srcX = (_srcX % size + size) % size;
_srcY = (_srcY % tmpHeight + tmpHeight) % tmpHeight;
_srcX = (_srcX % tmpWidth + tmpWidth) % tmpWidth;
// size is still == _width from the previous operation - let's reuse the local

// Find the index
_index = _srcX + size * _srcY;
_index = _srcX + tmpWidth * _srcY;

// Set the pixel
Pixels[_index] = cachedColors[_colorID];
Expand Down
5 changes: 4 additions & 1 deletion SDK/Runner/Services/WorkspaceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ public virtual void UpdateLog(string logString, LogType type = LogType.Log, stri

public void SaveLog()
{
if(LogInvalidated)
if (LogInvalidated)
{
SaveTextToFile(logFilePath, logService.ReadLog(), true);
LogInvalidated = false;
}
}

public void ClearLog()
Expand Down

0 comments on commit 9e148f7

Please sign in to comment.