commit 56e369a
chld
·
2026-07-21 20:33:17 +0000 UTC
parent f89bcd2
remove unused code: i dont even know why i learned all that just for it to be useless
1 files changed,
+3,
-16
+3,
-16
1@@ -21,7 +21,7 @@ public:View(BRect f, BBitmap *bmp):
2 class Win:public BWindow
3 {
4 public:Win(BRect f, const char *title, int texture_w, int texture_h):
5- BWindow(f, title, B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE|B_WILL_DRAW){
6+ BWindow(f, title, B_TITLED_WINDOW, B_WILL_DRAW){
7 bmp = new BBitmap(BRect(0, 0, texture_w - 1, texture_h - 1), B_RGB32);
8 view = new View(Bounds(), bmp);
9 AddChild(view);
10@@ -43,25 +43,12 @@ public:App(BRect r, const char *title, int texture_w, int texture_h):BApplicatio
11 };
12
13 static App *_app=nullptr;
14-static sem_id sem = -1;
15
16 int cottonwindow_init(CottonWindow *cw, const char *title, int window_w, int window_h, int texture_w, int texture_h)
17 {
18 (void)cw;
19- sem = create_sem(0, "r");
20-
21- struct InitData { const char *title; int ww, wh, tw, th; };
22- struct InitData d{title, window_w, window_h,texture_w, texture_h};
23-
24- thread_id id=spawn_thread([](void *data) -> status_t{
25- InitData *d = (InitData*)data;
26- _app=new App(BRect(100, 100, 100 + d->ww, 100 + d->wh), d->title, d->tw, d->th);
27- release_sem(sem);
28- _app->Run();
29- return 0;
30- }, "cotton", B_NORMAL_PRIORITY, &d);
31- resume_thread(id);
32- acquire_sem(sem);
33+
34+ _app=new App(BRect(100, 100, 100 + window_w, 100 + window_h), title, texture_w, texture_h);
35
36 return 0;
37 }