Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BadOS Project
BWL
提交
d75e9826
B
BWL
项目概览
BadOS Project
/
BWL
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
B
BWL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d75e9826
编写于
7月 28, 2022
作者:
指向BIOS的野指针
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add update queue to sync
上级
73ba4457
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
6 deletion
+57
-6
BWLserver/threads.cc
BWLserver/threads.cc
+33
-5
BWLserver/update.cc
BWLserver/update.cc
+5
-0
BWLserver/update.hh
BWLserver/update.hh
+19
-1
未找到文件。
BWLserver/threads.cc
浏览文件 @
d75e9826
...
...
@@ -7,11 +7,11 @@
#include <sys/time.h>
#include <signal.h>
#include "update.hh"
#include "../includes/bsv.hh"
#include "../includes/syscfg.hh"
#include "update.hh"
extern
volatile
bool
server_running
;
//服务器运行标志
extern
std
::
map
<
bwl
::
id_t
,
bwl
::
__page
*>
pages
;
//页列表
...
...
@@ -41,11 +41,38 @@ namespace bwl
else
updating_signal
=
0
;
//检查背景更新
if
(
__ud
.
__bg
.
sig
)
if
(
__ud
.
__bg
.
sig
)
{
update_bg
();
__ud
.
__bg
.
sig
=
0
;
}
//检查更新鼠标
if
(
__ud
.
__mo
.
sig
)
{
update_mo
();
__ud
.
__mo
.
sig
=
0
;
}
}
/**
* @brief 更新刷新队列
*
*/
void
update_queues
()
{
//背景队列
if
(
!
__ud
.
bg_update_que
.
empty
()
&&
!
__ud
.
__bg
.
sig
)
{
__ud
.
__bg
=
__ud
.
bg_update_que
.
front
();
__ud
.
bg_update_que
.
pop
();
}
//鼠标队列
if
(
!
__ud
.
mouse_update_que
.
empty
()
&&
!
__ud
.
__bg
.
sig
)
{
__ud
.
__mo
=
__ud
.
mouse_update_que
.
front
();
__ud
.
mouse_update_que
.
pop
();
}
}
void
updateDrmBuffer
()
...
...
@@ -55,8 +82,9 @@ namespace bwl
useconds_t
itv
=
interval
(
server
::
getFPS
());
//获取帧率并换算为每帧时间间隔
while
(
server_running
)
{
usleep
(
itv
);
//睡眠
updater
();
//更新屏幕
usleep
(
itv
);
//睡眠
update_queues
();
//更新队列
updater
();
//更新屏幕
}
}
};
BWLserver/update.cc
浏览文件 @
d75e9826
...
...
@@ -35,4 +35,9 @@ namespace bwl
}
}
void
update_mo
()
{
}
};
BWLserver/update.hh
浏览文件 @
d75e9826
...
...
@@ -4,6 +4,7 @@
#define __bwl_server
#include <iostream>
#include <queue>
namespace
bwl
{
...
...
@@ -15,14 +16,31 @@ namespace bwl
int64_t
pos
[
2
];
//更新位置
uint64_t
size
[
2
];
//更新大小
}
__bg
;
std
::
queue
<
bg
>
bg_update_que
;
//背景更新队列
struct
mouse
{
uint8_t
sig
;
//更新标志
int64_t
pos
[
2
];
//更新位置
uint64_t
size
[
2
];
//更新大小
}
__mo
;
std
::
queue
<
mouse
>
mouse_update_que
;
//鼠标更新队列
};
/**
* @brief 更新背景
*
*
*/
void
update_bg
();
/**
* @brief 更新鼠标
*
*/
void
update_mo
();
};
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录