MCPcopy Create free account
hub / github.com/defold/defold / DeviceModelMatch

Function DeviceModelMatch

engine/render/src/render/display_profiles.cpp:135–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134
135 bool DeviceModelMatch(DisplayProfiles::Qualifier *qualifier, dmSys::SystemInfo *sys_info)
136 {
137 uint32_t device_models_count = qualifier->m_NumDeviceModels;
138 size_t sys_device_model_len = strlen(sys_info->m_DeviceModel);
139
140 for (uint32_t d = 0; d < device_models_count; ++d)
141 {
142 const char* device_model = qualifier->m_DeviceModels[d];
143 size_t q_device_model_len = strlen(device_model);
144
145 if (q_device_model_len <= sys_device_model_len)
146 {
147 if (strncmp(device_model, sys_info->m_DeviceModel, q_device_model_len) == 0) // match
148 {
149 return true;
150 }
151 }
152 }
153
154 return false;
155 }
156
157 dmhash_t GetOptimalDisplayProfile(HDisplayProfiles profiles, uint32_t width, uint32_t height, uint32_t dpi, const dmArray<dmhash_t>* id_choices)
158 {

Callers 2

TESTFunction · 0.85
GetOptimalDisplayProfileFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68