void RenderLinearGradient(SDL_Surface *surf,
const SDL_Rect *rect,
const SDL_Color *color1,
const SDL_Color *color2,
bool orientation)
{
SDL_Rect walking_rect = SDL_Rect(*rect);
auto *offset = orientation ? &walking_rect.x : &walking_rect.y;
auto *pos = orientation ? &walking_rect.w : &walking_rect.h;
auto starting_offset = *offset;
auto starting_pos = *pos;
*pos = 1;
for (; *offset < starting_offset + starting_pos; (*offset)++) {
float fraction = (float(*offset - starting_offset) / float(starting_pos));
SDL_FillRect(surf, &walking_rect, Interpolate(surf->format, color2, color1, fraction));
}
}
uint32_t Interpolate(SDL_PixelFormat *format,
const SDL_Color *color1,
const SDL_Color *color2,
float fraction)
{
return SDL_MapRGBA(format,
static_cast<uint8_t>((color1->r - color2->r) * fraction + color2->r),
static_cast<uint8_t>((color1->g - color2->g) * fraction + color2->g),
static_cast<uint8_t>((color1->b - color2->b) * fraction + color2->b),
static_cast<uint8_t>((color1->a - color2->a) * fraction + color2->a));
}
CNetObj_PlayerInfo
) has its own m_ClientID
member variable in addition to the generic snapshot item ID. The snapshot item ID was only used to set m_Snap.m_LocalClientID
but without being checked for invalid values. Now it is checked that both IDs are identical and only m_ClientID
is used consistently.
stat
calls, a handful of read
calls, and an exec
2 * std::thread::hardware_concurrency() + 2
many threads for now (edited)std::thread::hardware_concurrency() + 1
2 * std::thread::hardware_concurrency() + 2
many threads for now (edited)9cbbc0a
Replace static variables in MouseRelative
with member variable - Robyt3
97c1046
Add assertions to ensure that thread_init
is successful - Robyt3
2dcec64
Use std::vector
for jobpool threads - Robyt3
ba5a974
Increase jobpool thread count based on hardware concurrency - Robyt3
2235231
Give jobpool worker threads different names based on index - Robyt3
0666646
Merge pull request #7352 from Robyt3/Engine-Input-Antistatic - def-
042a04d
Merge pull request #7353 from Robyt3/Engine-Jobpool-Refactoring - def-