浏览代码

libobs: Background color of 0 should not be gray

When calling obs_display_set_background_color, the value set in the
'color' parameter should always be used as-is.  0 should not indicate a
color other than black.  To do anything otherwise is silly and confusing
for users of the API.

Closes obsproject/obs-studio#1516
jp9000 6 年之前
父节点
当前提交
03cca9d95a
共有 1 个文件被更改,包括 3 次插入10 次删除
  1. 3 10
      libobs/obs-display.c

+ 3 - 10
libobs/obs-display.c

@@ -57,10 +57,7 @@ obs_display_t *obs_display_create(const struct gs_init_data *graphics_data,
 
 	gs_enter_context(obs->video.graphics);
 
-	if (background_color)
-		display->background_color = background_color;
-	else
-		display->background_color = 0x4c4c4c;
+	display->background_color = background_color;
 
 	if (!obs_display_init(display, graphics_data)) {
 		obs_display_destroy(display);
@@ -232,10 +229,6 @@ bool obs_display_enabled(obs_display_t *display)
 
 void obs_display_set_background_color(obs_display_t *display, uint32_t color)
 {
-	if (display) {
-		if (color)
-			display->background_color = color;
-		else
-			display->background_color = 0x4c4c4c;
-	}
+	if (display)
+		display->background_color = color;
 }