Commit 820d6f30 authored by Vesa-Pekka Palmu's avatar Vesa-Pekka Palmu

Better rings for the 192x192 pixel clock

parent b852e8ec
Pipeline #55530009 passed with stages
in 9 minutes and 7 seconds
......@@ -43,146 +43,146 @@ var staticCircles = [12][2]int32{
{1460, 539},
}
// radius 500 * 192 / 1080
var smallStaticCircles = [12][2]int32{
{93, 8},
{138, 19},
{171, 52},
{183, 96},
{173, 140},
{141, 172},
{98, 184},
{53, 172},
{20, 140},
{8, 95},
{18, 51},
{50, 19},
}
// Second circles
var secCircles = [60][2]int32{
{959, 90},
{959, 90}, // 0
{1007, 92},
{1053, 99},
{1099, 112},
{1143, 128},
{1185, 150},
{1185, 150}, // 5
{1224, 175},
{1261, 205},
{1294, 238},
{1324, 275},
{1349, 315},
{1349, 315}, // 10
{1371, 356},
{1387, 400},
{1400, 446},
{1407, 492},
{1410, 539},
{1410, 539}, // 15
{1407, 587},
{1400, 633},
{1387, 679},
{1371, 723},
{1349, 765},
{1349, 765}, // 20
{1324, 804},
{1294, 841},
{1261, 874},
{1224, 904},
{1185, 929},
{1185, 929}, // 25
{1143, 951},
{1099, 967},
{1053, 980},
{1007, 987},
{960, 990},
{960, 990}, // 30
{912, 987},
{866, 980},
{820, 967},
{776, 951},
{735, 929},
{735, 929}, // 35
{695, 904},
{658, 874},
{625, 841},
{595, 804},
{570, 765},
{570, 765}, // 40
{548, 723},
{532, 679},
{519, 633},
{512, 587},
{510, 540},
{510, 540}, // 45
{512, 492},
{519, 446},
{532, 400},
{548, 356},
{570, 315},
{570, 315}, // 50
{595, 275},
{625, 238},
{658, 205},
{695, 175},
{734, 150},
{734, 150}, // 55
{776, 128},
{820, 112},
{866, 99},
{912, 92},
}
// radius 500 * 192 / 1080
var smallStaticCircles = [12][2]int32{
{96, 8},
{140, 20},
{172, 52},
{184, 96},
{172, 140},
{140, 172},
{96, 184},
{52, 172},
{20, 140},
{8, 96},
{20, 52},
{52, 20},
}
// n = 60, center = 192 / 2, radius = 450 * 192 / 1080
var smallSecCircles = [60][2]int32{
{94, 16},
{102, 16},
{110, 17},
{118, 19},
{126, 22},
{134, 26},
{141, 31},
{148, 36},
{154, 42},
{159, 48},
{164, 56},
{168, 63},
{171, 71},
{173, 79},
{175, 87},
{175, 96},
{175, 104},
{174, 112},
{172, 120},
{169, 128},
{166, 136},
{96, 16},
{104, 16},
{113, 18},
{121, 20},
{129, 23},
{136, 27},
{143, 31},
{150, 37},
{155, 42},
{161, 49},
{165, 56},
{169, 63},
{172, 71},
{174, 79},
{176, 88},
{176, 96},
{176, 104},
{174, 113},
{172, 121},
{169, 129},
{165, 136},
{161, 143},
{156, 149},
{155, 150},
{150, 155},
{144, 160},
{137, 165},
{130, 169},
{122, 172},
{114, 174},
{106, 175},
{97, 176},
{89, 175},
{81, 174},
{73, 172},
{65, 169},
{57, 165},
{50, 160},
{43, 155},
{37, 149},
{32, 143},
{143, 161},
{136, 165},
{129, 169},
{121, 172},
{113, 174},
{104, 176},
{96, 176},
{88, 176},
{79, 174},
{71, 172},
{63, 169},
{56, 165},
{49, 161},
{42, 155},
{37, 150},
{31, 143},
{27, 136},
{23, 128},
{20, 120},
{18, 112},
{23, 129},
{20, 121},
{18, 113},
{16, 104},
{16, 95},
{16, 87},
{17, 79},
{19, 71},
{22, 63},
{25, 55},
{30, 48},
{35, 42},
{41, 36},
{47, 31},
{54, 26},
{61, 22},
{69, 19},
{77, 17},
{85, 16},
{16, 96},
{16, 88},
{18, 79},
{20, 71},
{23, 63},
{27, 56},
{31, 49},
{37, 42},
{42, 37},
{49, 31},
{56, 27},
{63, 23},
{71, 20},
{79, 18},
{88, 16},
}
......@@ -110,7 +110,7 @@ func main() {
// Create a texture for circles
if options.Small {
textureSize = 8
textureSize = 5
textureCoord = 3
textureRadius = 3
gridStartX = 32
......@@ -130,8 +130,28 @@ func main() {
gfx.FilledCircleColor(renderer, textureCoord, textureCoord, textureRadius, staticSDLColor)
gfx.AACircleColor(renderer, textureCoord, textureCoord, textureRadius, staticSDLColor)
} else {
gfx.RoundedBoxColor(renderer, 1, 1, 5, 5, 3, staticSDLColor)
gfx.AACircleColor(renderer, textureCoord, textureCoord, textureRadius, staticSDLColor)
renderer.SetDrawColor(staticSDLColor.R, staticSDLColor.G, staticSDLColor.B, 255)
renderer.DrawPoint(0, 1)
renderer.DrawPoint(0, 2)
renderer.DrawPoint(0, 3)
renderer.DrawPoint(1, 0)
renderer.DrawPoint(1, 1)
renderer.DrawPoint(1, 2)
renderer.DrawPoint(1, 3)
renderer.DrawPoint(1, 4)
renderer.DrawPoint(2, 0)
renderer.DrawPoint(2, 1)
renderer.DrawPoint(2, 2)
renderer.DrawPoint(2, 3)
renderer.DrawPoint(2, 4)
renderer.DrawPoint(3, 0)
renderer.DrawPoint(3, 1)
renderer.DrawPoint(3, 2)
renderer.DrawPoint(3, 3)
renderer.DrawPoint(3, 4)
renderer.DrawPoint(4, 1)
renderer.DrawPoint(4, 2)
renderer.DrawPoint(4, 3)
}
secTexture, _ = renderer.CreateTexture(sdl.PIXELFORMAT_RGBA8888, sdl.TEXTUREACCESS_TARGET, textureSize, textureSize)
......@@ -140,8 +160,28 @@ func main() {
gfx.FilledCircleColor(renderer, textureCoord, textureCoord, textureRadius, secSDLColor)
gfx.AACircleColor(renderer, textureCoord, textureCoord, textureRadius, secSDLColor)
} else {
gfx.RoundedBoxColor(renderer, 1, 1, 5, 5, 3, secSDLColor)
gfx.AACircleColor(renderer, textureCoord, textureCoord, textureRadius, secSDLColor)
renderer.SetDrawColor(secSDLColor.R, secSDLColor.G, secSDLColor.B, 255)
renderer.DrawPoint(0, 1)
renderer.DrawPoint(0, 2)
renderer.DrawPoint(0, 3)
renderer.DrawPoint(1, 0)
renderer.DrawPoint(1, 1)
renderer.DrawPoint(1, 2)
renderer.DrawPoint(1, 3)
renderer.DrawPoint(1, 4)
renderer.DrawPoint(2, 0)
renderer.DrawPoint(2, 1)
renderer.DrawPoint(2, 2)
renderer.DrawPoint(2, 3)
renderer.DrawPoint(2, 4)
renderer.DrawPoint(3, 0)
renderer.DrawPoint(3, 1)
renderer.DrawPoint(3, 2)
renderer.DrawPoint(3, 3)
renderer.DrawPoint(3, 4)
renderer.DrawPoint(4, 1)
renderer.DrawPoint(4, 2)
renderer.DrawPoint(4, 3)
}
renderer.SetRenderTarget(nil)
......@@ -209,7 +249,7 @@ func drawSecondCircles(seconds int) {
for i := 0; i <= int(seconds); i++ {
dest := sdl.Rect{secCircles[i][0] - 20, secCircles[i][1] - 20, 40, 40}
if options.Small {
dest = sdl.Rect{secCircles[i][0] - 4, secCircles[i][1] - 4, 8, 8}
dest = sdl.Rect{secCircles[i][0] - 3, secCircles[i][1] - 3, 5, 5}
}
renderer.Copy(secTexture, &textureSource, &dest)
}
......@@ -219,7 +259,7 @@ func drawStaticCircles() {
// Draw static indicator circles
for _, p := range staticCircles {
if options.Small {
dest := sdl.Rect{p[0] - 4, p[1] - 4, 8, 8}
dest := sdl.Rect{p[0] - 3, p[1] - 3, 5, 5}
renderer.Copy(staticTexture, &textureSource, &dest)
} else {
dest := sdl.Rect{p[0] - 20, p[1] - 20, 40, 40}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment