mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
Various: Don't use boolean bitfields
Using bitfields causes less optimized code generation and the memory savings are minimal as none of the objects are instantiated enough times to be worth it. See https://blogs.msdn.microsoft.com/oldnewthing/20081126-00/?p=20073
This commit is contained in:
@@ -38,10 +38,10 @@ struct scale_filter_data {
|
||||
int cy_out;
|
||||
enum obs_scale_type sampling;
|
||||
gs_samplerstate_t *point_sampler;
|
||||
bool aspect_ratio_only : 1;
|
||||
bool target_valid : 1;
|
||||
bool valid : 1;
|
||||
bool undistort : 1;
|
||||
bool aspect_ratio_only;
|
||||
bool target_valid;
|
||||
bool valid;
|
||||
bool undistort;
|
||||
};
|
||||
|
||||
static const char *scale_filter_name(void *unused)
|
||||
|
||||
@@ -87,13 +87,13 @@ struct game_capture_config {
|
||||
enum capture_mode mode;
|
||||
uint32_t scale_cx;
|
||||
uint32_t scale_cy;
|
||||
bool cursor : 1;
|
||||
bool force_shmem : 1;
|
||||
bool force_scaling : 1;
|
||||
bool allow_transparency : 1;
|
||||
bool limit_framerate : 1;
|
||||
bool capture_overlays : 1;
|
||||
bool anticheat_hook : 1;
|
||||
bool cursor;
|
||||
bool force_shmem;
|
||||
bool force_scaling;
|
||||
bool allow_transparency;
|
||||
bool limit_framerate;
|
||||
bool capture_overlays;
|
||||
bool anticheat_hook;
|
||||
};
|
||||
|
||||
struct game_capture {
|
||||
@@ -119,17 +119,17 @@ struct game_capture {
|
||||
volatile long hotkey_window;
|
||||
volatile bool deactivate_hook;
|
||||
volatile bool activate_hook_now;
|
||||
bool wait_for_target_startup : 1;
|
||||
bool showing : 1;
|
||||
bool active : 1;
|
||||
bool capturing : 1;
|
||||
bool activate_hook : 1;
|
||||
bool process_is_64bit : 1;
|
||||
bool error_acquiring : 1;
|
||||
bool dwm_capture : 1;
|
||||
bool initial_config : 1;
|
||||
bool convert_16bit : 1;
|
||||
bool is_app : 1;
|
||||
bool wait_for_target_startup;
|
||||
bool showing;
|
||||
bool active;
|
||||
bool capturing;
|
||||
bool activate_hook;
|
||||
bool process_is_64bit;
|
||||
bool error_acquiring;
|
||||
bool dwm_capture;
|
||||
bool initial_config;
|
||||
bool convert_16bit;
|
||||
bool is_app;
|
||||
bool cursor_hidden;
|
||||
|
||||
struct game_capture_config config;
|
||||
|
||||
@@ -12,9 +12,9 @@ struct d3d10_data {
|
||||
uint32_t cx;
|
||||
uint32_t cy;
|
||||
DXGI_FORMAT format;
|
||||
bool using_shtex : 1;
|
||||
bool using_scale : 1;
|
||||
bool multisampled : 1;
|
||||
bool using_shtex;
|
||||
bool using_scale;
|
||||
bool multisampled;
|
||||
|
||||
ID3D10Texture2D *scale_tex;
|
||||
ID3D10ShaderResourceView *scale_resource;
|
||||
|
||||
@@ -13,9 +13,9 @@ struct d3d11_data {
|
||||
uint32_t cx;
|
||||
uint32_t cy;
|
||||
DXGI_FORMAT format;
|
||||
bool using_shtex : 1;
|
||||
bool using_scale : 1;
|
||||
bool multisampled : 1;
|
||||
bool using_shtex;
|
||||
bool using_scale;
|
||||
bool multisampled;
|
||||
|
||||
ID3D11Texture2D *scale_tex;
|
||||
ID3D11ShaderResourceView *scale_resource;
|
||||
|
||||
@@ -19,10 +19,10 @@ struct d3d12_data {
|
||||
uint32_t cx;
|
||||
uint32_t cy;
|
||||
DXGI_FORMAT format;
|
||||
bool using_shtex : 1;
|
||||
bool using_scale : 1;
|
||||
bool multisampled : 1;
|
||||
bool dxgi_1_4 : 1;
|
||||
bool using_shtex;
|
||||
bool using_scale;
|
||||
bool multisampled;
|
||||
bool dxgi_1_4;
|
||||
|
||||
ID3D11Device *device11;
|
||||
ID3D11DeviceContext *context11;
|
||||
|
||||
@@ -32,8 +32,8 @@ struct d3d9_data {
|
||||
uint32_t cy;
|
||||
D3DFORMAT d3d9_format;
|
||||
DXGI_FORMAT dxgi_format;
|
||||
bool using_shtex : 1;
|
||||
bool using_scale : 1;
|
||||
bool using_shtex;
|
||||
bool using_scale;
|
||||
|
||||
/* shared texture */
|
||||
IDirect3DSurface9 *d3d9_copytex;
|
||||
|
||||
@@ -35,9 +35,9 @@ struct gl_data {
|
||||
uint32_t cy;
|
||||
DXGI_FORMAT format;
|
||||
GLuint fbo;
|
||||
bool using_shtex : 1;
|
||||
bool using_scale : 1;
|
||||
bool shmem_fallback : 1;
|
||||
bool using_shtex;
|
||||
bool using_scale;
|
||||
bool shmem_fallback;
|
||||
|
||||
union {
|
||||
/* shared texture */
|
||||
|
||||
Reference in New Issue
Block a user