Skip to content

Commit

Permalink
Merge branch 'commaai:master' into PA-dev2
Browse files Browse the repository at this point in the history
  • Loading branch information
Edison-CBS authored Nov 29, 2024
2 parents 78f3726 + ce948f7 commit d8d4888
Show file tree
Hide file tree
Showing 15 changed files with 1,590 additions and 379 deletions.
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ SConscript(['rednose/SConscript'])

# Build system services
SConscript([
'system/ui/SConscript',
'system/proclogd/SConscript',
'system/ubloxd/SConscript',
'system/loggerd/SConscript',
Expand Down
2 changes: 0 additions & 2 deletions selfdrive/ui/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,3 @@ if GetOption('extras') and arch != "Darwin":
# build watch3
if arch in ['x86_64', 'aarch64', 'Darwin'] or GetOption('extras'):
qt_env.Program("watch3", ["watch3.cc"], LIBS=qt_libs + ['common', 'msgq', 'visionipc'])

SConscript(['raylib/SConscript'])
1 change: 0 additions & 1 deletion selfdrive/ui/raylib/.gitignore

This file was deleted.

17 changes: 0 additions & 17 deletions selfdrive/ui/raylib/SConscript

This file was deleted.

1 change: 1 addition & 0 deletions system/ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spinner
18 changes: 18 additions & 0 deletions system/ui/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Import('env', 'arch', 'common')

renv = env.Clone()

rayutil = env.Library("rayutil", ['raylib/util.cc'], LIBS='raylib')
linked_libs = ['raylib', rayutil, common]
renv['LIBPATH'] += [f'#third_party/raylib/{arch}/']

mac_frameworks = []
if arch == "Darwin":
mac_frameworks += ['OpenCL', 'CoreVideo', 'Cocoa', 'GLUT', 'CoreFoundation', 'OpenGL', 'IOKit']
elif arch == 'larch64':
linked_libs += ['GLESv2', 'GL', 'EGL', 'wayland-client', 'wayland-egl']
else:
linked_libs += ['OpenCL', 'dl', 'pthread']

if arch != 'aarch64':
renv.Program("spinner", ["raylib/spinner.cc"], LIBS=linked_libs, FRAMEWORKS=mac_frameworks)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <cmath>
#include <iostream>

#include "selfdrive/ui/raylib/util.h"
#include "system/ui/raylib/util.h"
#include "third_party/raylib/include/raylib.h"

constexpr int kProgressBarWidth = 1000;
Expand All @@ -19,8 +19,8 @@ int main(int argc, char *argv[]) {
std::cin.sync_with_stdio(false);
std::cin.tie(nullptr);

Texture2D commaTexture = LoadTextureResized("../../assets/img_spinner_comma.png", kTextureSize);
Texture2D spinnerTexture = LoadTextureResized("../../assets/img_spinner_track.png", kTextureSize);
Texture2D commaTexture = LoadTextureResized("../../selfdrive/assets/img_spinner_comma.png", kTextureSize);
Texture2D spinnerTexture = LoadTextureResized("../../selfdrive/assets/img_spinner_track.png", kTextureSize);

float rotation = 0.0f;
std::string userInput;
Expand Down
6 changes: 2 additions & 4 deletions selfdrive/ui/raylib/util.cc → system/ui/raylib/util.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "selfdrive/ui/raylib/util.h"
#include "system/ui/raylib/util.h"

#include <array>

Expand All @@ -23,7 +23,6 @@ struct FontManager {
FontManager() {
for (int i = 0; i < fonts.size(); ++i) {
fonts[i] = LoadFontEx(FONT_FILE_PATHS[i], 120, nullptr, 250);
SetTextureFilter(fonts[i].texture, TEXTURE_FILTER_TRILINEAR);
}
}

Expand All @@ -43,14 +42,13 @@ Texture2D LoadTextureResized(const char *fileName, int size) {
Image img = LoadImage(fileName);
ImageResize(&img, size, size);
Texture2D texture = LoadTextureFromImage(img);
SetTextureFilter(texture, TEXTURE_FILTER_TRILINEAR);
return texture;
}

void initApp(const char *title, int fps) {
Hardware::set_display_power(true);
Hardware::set_brightness(65);
// SetTraceLogLevel(LOG_NONE);
InitWindow(0, 0, title);
InitWindow(2160, 1080, title);
SetTargetFPS(fps);
}
File renamed without changes.
270 changes: 158 additions & 112 deletions third_party/raylib/include/raylib.h

Large diffs are not rendered by default.

Loading

0 comments on commit d8d4888

Please sign in to comment.