mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-26 14:43:50 -04:00
general: Allow compiling Panda headers on Windows without NOMINMAX
This commit is contained in:
parent
0538106d52
commit
fbea0056f5
@ -49,7 +49,7 @@ set_severity(NotifySeverity severity) {
|
||||
_severity = severity;
|
||||
#else
|
||||
// enforce the no-debug, no-spam rule.
|
||||
_severity = std::max(severity, NS_info);
|
||||
_severity = (std::max)(severity, NS_info);
|
||||
#endif
|
||||
invalidate_cache();
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ is_axis_known(size_t index) const {
|
||||
INLINE void InputDevice::
|
||||
set_vibration(double strong, double weak) {
|
||||
LightMutexHolder holder(_lock);
|
||||
do_set_vibration(std::max(std::min(strong, 1.0), 0.0), std::max(std::min(weak, 1.0), 0.0));
|
||||
do_set_vibration((std::max)((std::min)(strong, 1.0), 0.0), (std::max)((std::min)(weak, 1.0), 0.0));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -242,7 +242,7 @@ INLINE void DrawableRegion::
|
||||
update_pixel_factor() {
|
||||
PN_stdfloat new_pixel_factor;
|
||||
if (supports_pixel_zoom()) {
|
||||
new_pixel_factor = (PN_stdfloat)1 / sqrt(std::max(_pixel_zoom, (PN_stdfloat)1.0));
|
||||
new_pixel_factor = (PN_stdfloat)1 / sqrt((std::max)(_pixel_zoom, (PN_stdfloat)1.0));
|
||||
} else {
|
||||
new_pixel_factor = 1;
|
||||
}
|
||||
|
@ -57,10 +57,11 @@ get_depth_bits() const {
|
||||
*/
|
||||
INLINE int FrameBufferProperties::
|
||||
get_color_bits() const {
|
||||
return std::max(_property[FBP_color_bits],
|
||||
_property[FBP_red_bits] +
|
||||
_property[FBP_green_bits] +
|
||||
_property[FBP_blue_bits]);
|
||||
return (std::max)(
|
||||
_property[FBP_color_bits],
|
||||
_property[FBP_red_bits] +
|
||||
_property[FBP_green_bits] +
|
||||
_property[FBP_blue_bits]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -167,8 +167,8 @@ get_y_size() const {
|
||||
*/
|
||||
INLINE LVecBase2i GraphicsOutput::
|
||||
get_fb_size() const {
|
||||
return LVecBase2i(std::max(int(_size.get_x() * get_pixel_factor()), 1),
|
||||
std::max(int(_size.get_y() * get_pixel_factor()), 1));
|
||||
return LVecBase2i((std::max)(int(_size.get_x() * get_pixel_factor()), 1),
|
||||
(std::max)(int(_size.get_y() * get_pixel_factor()), 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -178,7 +178,7 @@ get_fb_size() const {
|
||||
*/
|
||||
INLINE int GraphicsOutput::
|
||||
get_fb_x_size() const {
|
||||
return std::max(int(_size.get_x() * get_pixel_factor()), 1);
|
||||
return (std::max)(int(_size.get_x() * get_pixel_factor()), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,7 +188,7 @@ get_fb_x_size() const {
|
||||
*/
|
||||
INLINE int GraphicsOutput::
|
||||
get_fb_y_size() const {
|
||||
return std::max(int(_size.get_y() * get_pixel_factor()), 1);
|
||||
return (std::max)(int(_size.get_y() * get_pixel_factor()), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -200,8 +200,8 @@ INLINE LVecBase2i GraphicsOutput::
|
||||
get_sbs_left_size() const {
|
||||
PN_stdfloat left_w = _sbs_left_dimensions[1] - _sbs_left_dimensions[0];
|
||||
PN_stdfloat left_h = _sbs_left_dimensions[3] - _sbs_left_dimensions[2];
|
||||
return LVecBase2i(std::max(int(_size.get_x() * left_w), 1),
|
||||
std::max(int(_size.get_y() * left_h), 1));
|
||||
return LVecBase2i((std::max)(int(_size.get_x() * left_w), 1),
|
||||
(std::max)(int(_size.get_y() * left_h), 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -212,7 +212,7 @@ get_sbs_left_size() const {
|
||||
INLINE int GraphicsOutput::
|
||||
get_sbs_left_x_size() const {
|
||||
PN_stdfloat left_w = _sbs_left_dimensions[1] - _sbs_left_dimensions[0];
|
||||
return std::max(int(_size.get_x() * left_w), 1);
|
||||
return (std::max)(int(_size.get_x() * left_w), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -223,7 +223,7 @@ get_sbs_left_x_size() const {
|
||||
INLINE int GraphicsOutput::
|
||||
get_sbs_left_y_size() const {
|
||||
PN_stdfloat left_h = _sbs_left_dimensions[3] - _sbs_left_dimensions[2];
|
||||
return std::max(int(_size.get_y() * left_h), 1);
|
||||
return (std::max)(int(_size.get_y() * left_h), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -235,8 +235,8 @@ INLINE LVecBase2i GraphicsOutput::
|
||||
get_sbs_right_size() const {
|
||||
PN_stdfloat right_w = _sbs_right_dimensions[1] - _sbs_right_dimensions[0];
|
||||
PN_stdfloat right_h = _sbs_right_dimensions[3] - _sbs_right_dimensions[2];
|
||||
return LVecBase2i(std::max(int(_size.get_x() * right_w), 1),
|
||||
std::max(int(_size.get_y() * right_h), 1));
|
||||
return LVecBase2i((std::max)(int(_size.get_x() * right_w), 1),
|
||||
(std::max)(int(_size.get_y() * right_h), 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -247,7 +247,7 @@ get_sbs_right_size() const {
|
||||
INLINE int GraphicsOutput::
|
||||
get_sbs_right_x_size() const {
|
||||
PN_stdfloat right_w = _sbs_right_dimensions[1] - _sbs_right_dimensions[0];
|
||||
return std::max(int(_size.get_x() * right_w), 1);
|
||||
return (std::max)(int(_size.get_x() * right_w), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -258,7 +258,7 @@ get_sbs_right_x_size() const {
|
||||
INLINE int GraphicsOutput::
|
||||
get_sbs_right_y_size() const {
|
||||
PN_stdfloat right_h = _sbs_right_dimensions[3] - _sbs_right_dimensions[2];
|
||||
return std::max(int(_size.get_y() * right_h), 1);
|
||||
return (std::max)(int(_size.get_y() * right_h), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -258,7 +258,7 @@ get_max_vertices_per_primitive() const {
|
||||
INLINE int GraphicsStateGuardian::
|
||||
get_max_texture_stages() const {
|
||||
if (max_texture_stages > 0) {
|
||||
return std::min(_max_texture_stages, (int)max_texture_stages);
|
||||
return (std::min)(_max_texture_stages, (int)max_texture_stages);
|
||||
}
|
||||
return _max_texture_stages;
|
||||
}
|
||||
@ -695,7 +695,7 @@ get_timer_queries_active() const {
|
||||
INLINE int GraphicsStateGuardian::
|
||||
get_max_color_targets() const {
|
||||
if (max_color_targets > 0) {
|
||||
return std::min(_max_color_targets, (int)max_color_targets);
|
||||
return (std::min)(_max_color_targets, (int)max_color_targets);
|
||||
}
|
||||
return _max_color_targets;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ matches(const EggMesherEdge &other) const {
|
||||
*/
|
||||
INLINE EggMesherEdge *EggMesherEdge::
|
||||
common_ptr() {
|
||||
return std::min(this, _opposite);
|
||||
return (std::min)(this, _opposite);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -431,6 +431,6 @@ is_cert_special() const {
|
||||
*/
|
||||
INLINE std::streampos Multifile::Subfile::
|
||||
get_last_byte_pos() const {
|
||||
return std::max(_index_start + (std::streampos)_index_length,
|
||||
return (std::max)(_index_start + (std::streampos)_index_length,
|
||||
_data_start + (std::streampos)_data_length) - (std::streampos)1;
|
||||
}
|
||||
|
@ -471,9 +471,9 @@ set_data(const std::string &data) {
|
||||
template<class Element>
|
||||
INLINE std::string PointerToArray<Element>::
|
||||
get_subdata(size_type n, size_type count) const {
|
||||
n = std::min(n, size());
|
||||
count = std::max(count, n);
|
||||
count = std::min(count, size() - n);
|
||||
n = (std::min)(n, size());
|
||||
count = (std::max)(count, n);
|
||||
count = (std::min)(count, size() - n);
|
||||
return std::string((const char *)(p() + n), sizeof(Element) * count);
|
||||
}
|
||||
|
||||
@ -965,9 +965,9 @@ get_data() const {
|
||||
template<class Element>
|
||||
INLINE std::string ConstPointerToArray<Element>::
|
||||
get_subdata(size_type n, size_type count) const {
|
||||
n = std::min(n, size());
|
||||
count = std::max(count, n);
|
||||
count = std::min(count, size() - n);
|
||||
n = (std::min)(n, size());
|
||||
count = (std::max)(count, n);
|
||||
count = (std::min)(count, size() - n);
|
||||
return std::string((const char *)(p() + n), sizeof(Element) * count);
|
||||
}
|
||||
|
||||
|
@ -249,9 +249,9 @@ set_data(PyObject *data) {
|
||||
template<class Element>
|
||||
INLINE PyObject *Extension<PointerToArray<Element> >::
|
||||
get_subdata(size_t n, size_t count) const {
|
||||
n = std::min(n, this->_this->size());
|
||||
count = std::max(count, n);
|
||||
count = std::min(count, this->_this->size() - n);
|
||||
n = (std::min)(n, this->_this->size());
|
||||
count = (std::max)(count, n);
|
||||
count = (std::min)(count, this->_this->size() - n);
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
return PyBytes_FromStringAndSize((char *)(this->_this->p() + n), sizeof(Element) * count);
|
||||
#else
|
||||
@ -313,9 +313,9 @@ get_data() const {
|
||||
template<class Element>
|
||||
INLINE PyObject *Extension<ConstPointerToArray<Element> >::
|
||||
get_subdata(size_t n, size_t count) const {
|
||||
n = std::min(n, this->_this->size());
|
||||
count = std::max(count, n);
|
||||
count = std::min(count, this->_this->size() - n);
|
||||
n = (std::min)(n, this->_this->size());
|
||||
count = (std::max)(count, n);
|
||||
count = (std::min)(count, this->_this->size() - n);
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
return PyBytes_FromStringAndSize((char *)(this->_this->p() + n), sizeof(Element) * count);
|
||||
#else
|
||||
|
@ -535,8 +535,8 @@ get_data() const {
|
||||
INLINE vector_uchar GeomVertexArrayDataHandle::
|
||||
get_subdata(size_t start, size_t size) const {
|
||||
mark_used();
|
||||
start = std::min(start, _cdata->_buffer.get_size());
|
||||
size = std::min(size, _cdata->_buffer.get_size() - start);
|
||||
start = (std::min)(start, _cdata->_buffer.get_size());
|
||||
size = (std::min)(size, _cdata->_buffer.get_size() - start);
|
||||
const unsigned char *ptr = _cdata->_buffer.get_read_pointer(true) + start;
|
||||
return vector_uchar(ptr, ptr + size);
|
||||
}
|
||||
|
@ -1382,13 +1382,13 @@ inc_add_pointer() {
|
||||
_handle = nullptr;
|
||||
GeomVertexDataPipelineWriter writer(_vertex_data, true, _current_thread);
|
||||
writer.check_array_writers();
|
||||
writer.set_num_rows(std::max(write_row + 1, writer.get_num_rows()));
|
||||
writer.set_num_rows((std::max)(write_row + 1, writer.get_num_rows()));
|
||||
_handle = writer.get_array_writer(_array);
|
||||
|
||||
} else {
|
||||
// Otherwise, we can get away with modifying only the one array we're
|
||||
// using.
|
||||
_handle->set_num_rows(std::max(write_row + 1, _handle->get_num_rows()));
|
||||
_handle->set_num_rows((std::max)(write_row + 1, _handle->get_num_rows()));
|
||||
}
|
||||
|
||||
set_pointer(write_row);
|
||||
|
@ -55,7 +55,7 @@ INLINE ParamTextureImage::
|
||||
ParamTextureImage(Texture *tex, bool read, bool write, int z, int n) :
|
||||
_texture(tex),
|
||||
_access(0),
|
||||
_bind_level(std::min(n, 127)),
|
||||
_bind_level((std::min)(n, 127)),
|
||||
_bind_layer(z)
|
||||
{
|
||||
if (read) {
|
||||
|
@ -122,7 +122,7 @@ mark_loaded() {
|
||||
// _data_size_bytes = _data->get_texture_size_bytes();
|
||||
_properties_modified = get_texture()->get_properties_modified();
|
||||
_image_modified = get_texture()->get_image_modified();
|
||||
update_modified(std::max(_properties_modified, _image_modified));
|
||||
update_modified((std::max)(_properties_modified, _image_modified));
|
||||
|
||||
// Assume the texture is now resident.
|
||||
set_resident(true);
|
||||
@ -136,7 +136,7 @@ INLINE void TextureContext::
|
||||
mark_simple_loaded() {
|
||||
_properties_modified = get_texture()->get_properties_modified();
|
||||
_simple_image_modified = get_texture()->get_simple_image_modified();
|
||||
update_modified(std::max(_properties_modified, _simple_image_modified));
|
||||
update_modified((std::max)(_properties_modified, _simple_image_modified));
|
||||
|
||||
// The texture's not exactly resident now, but some part of it is.
|
||||
set_resident(true);
|
||||
|
@ -479,8 +479,8 @@ get_border_stitching() {
|
||||
*/
|
||||
INLINE double GeoMipTerrain::
|
||||
get_pixel_value(int x, int y) {
|
||||
x = std::max(std::min(x,int(_xsize-1)),0);
|
||||
y = std::max(std::min(y,int(_ysize-1)),0);
|
||||
x = (std::max)((std::min)(x,int(_xsize-1)),0);
|
||||
y = (std::max)((std::min)(y,int(_ysize-1)),0);
|
||||
if (_heightfield.is_grayscale()) {
|
||||
return double(_heightfield.get_bright(x, y));
|
||||
} else {
|
||||
|
@ -183,10 +183,10 @@ angle_rad(const FLOATNAME(LVector3) &other) const {
|
||||
// poorly as dot(other) approaches 1.0.
|
||||
if (dot(other) < 0.0f) {
|
||||
FLOATTYPE a = ((*this)+other).length() / 2.0f;
|
||||
return MathNumbers::cpi((FLOATTYPE)0.0f) - 2.0f * casin(std::min(a, (FLOATTYPE)1.0));
|
||||
return MathNumbers::cpi((FLOATTYPE)0.0f) - 2.0f * casin((std::min)(a, (FLOATTYPE)1.0));
|
||||
} else {
|
||||
FLOATTYPE a = ((*this)-other).length() / 2.0f;
|
||||
return 2.0f * casin(std::min(a, (FLOATTYPE)1.0));
|
||||
return 2.0f * casin((std::min)(a, (FLOATTYPE)1.0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,5 +110,5 @@ scale_t(int segment, PN_stdfloat t) const {
|
||||
PN_stdfloat from = _segments[segment]._from;
|
||||
PN_stdfloat to = _segments[segment]._to;
|
||||
t = (t - from) / (to - from);
|
||||
return std::min(std::max(t, (PN_stdfloat)0.0), (PN_stdfloat)1.0);
|
||||
return (std::min)((std::max)(t, (PN_stdfloat)0.0), (PN_stdfloat)1.0);
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ get_curve(int index) const {
|
||||
*/
|
||||
INLINE void ParametricCurveCollection::
|
||||
add_curve(ParametricCurve *curve, int index) {
|
||||
insert_curve(std::max(index, 0), curve);
|
||||
insert_curve((std::max)(index, 0), curve);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -97,7 +97,7 @@ get_cur_alpha(BaseParticle* bp) {
|
||||
return bp->get_parameterized_age();
|
||||
|
||||
case PR_ALPHA_IN_OUT:
|
||||
return 2.0 * std::min(bp->get_parameterized_age(),
|
||||
return 2.0 * (std::min)(bp->get_parameterized_age(),
|
||||
1.0f - bp->get_parameterized_age());
|
||||
|
||||
case PR_ALPHA_USER:
|
||||
|
@ -558,7 +558,7 @@ set_wtext(const std::wstring &wtext) {
|
||||
update_text();
|
||||
}
|
||||
#endif
|
||||
set_cursor_position(std::min(_cursor_position, _text.get_num_characters()));
|
||||
set_cursor_position((std::min)(_cursor_position, _text.get_num_characters()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,7 @@ get_adjust_event() const {
|
||||
*/
|
||||
INLINE void PGSliderBar::
|
||||
internal_set_ratio(PN_stdfloat ratio) {
|
||||
_ratio = std::max(std::min(ratio, (PN_stdfloat)1.0), (PN_stdfloat)0.0);
|
||||
_ratio = (std::max)((std::min)(ratio, (PN_stdfloat)1.0), (PN_stdfloat)0.0);
|
||||
_needs_reposition = true;
|
||||
adjust();
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ get_render_pipeline() {
|
||||
*/
|
||||
INLINE void Pipeline::
|
||||
set_min_stages(int min_stages) {
|
||||
set_num_stages(std::max(min_stages, get_num_stages()));
|
||||
set_num_stages((std::max)(min_stages, get_num_stages()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ get_pipeline_stage() const {
|
||||
*/
|
||||
INLINE void Thread::
|
||||
set_min_pipeline_stage(int min_pipeline_stage) {
|
||||
set_pipeline_stage(std::max(_pipeline_stage, min_pipeline_stage));
|
||||
set_pipeline_stage((std::max)(_pipeline_stage, min_pipeline_stage));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,8 +44,8 @@ INLINE unsigned char decode_sRGB_uchar(unsigned char val) {
|
||||
*/
|
||||
INLINE unsigned char decode_sRGB_uchar(float val) {
|
||||
return (val <= 0.04045f)
|
||||
? (unsigned char)(std::max(0.f, val) * (255.f / 12.92f) + 0.5f)
|
||||
: (unsigned char)(cpow((std::min(val, 1.f) + 0.055f) * (1.f / 1.055f), 2.4f) * 255.f + 0.5f);
|
||||
? (unsigned char)((std::max)(0.f, val) * (255.f / 12.92f) + 0.5f)
|
||||
: (unsigned char)(cpow(((std::min)(val, 1.f) + 0.055f) * (1.f / 1.055f), 2.4f) * 255.f + 0.5f);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -99,8 +99,8 @@ encode_sRGB_uchar(float val) {
|
||||
return encode_sRGB_uchar_sse2(val);
|
||||
#else
|
||||
return (val < 0.0031308f)
|
||||
? (unsigned char) (std::max(0.f, val) * 3294.6f + 0.5f)
|
||||
: (unsigned char) (269.025f * cpow(std::min(val, 1.f), 0.41666f) - 13.525f);
|
||||
? (unsigned char) ((std::max)(0.f, val) * 3294.6f + 0.5f)
|
||||
: (unsigned char) (269.025f * cpow((std::min)(val, 1.f), 0.41666f) - 13.525f);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -587,12 +587,12 @@ setup_sub_image(const PfmFile ©, int &xto, int &yto,
|
||||
yto = 0;
|
||||
}
|
||||
|
||||
x_size = std::min(x_size, copy.get_x_size() - xfrom);
|
||||
y_size = std::min(y_size, copy.get_y_size() - yfrom);
|
||||
x_size = (std::min)(x_size, copy.get_x_size() - xfrom);
|
||||
y_size = (std::min)(y_size, copy.get_y_size() - yfrom);
|
||||
|
||||
xmin = xto;
|
||||
ymin = yto;
|
||||
|
||||
xmax = std::min(xmin + x_size, get_x_size());
|
||||
ymax = std::min(ymin + y_size, get_y_size());
|
||||
xmax = (std::min)(xmin + x_size, get_x_size());
|
||||
ymax = (std::min)(ymin + y_size, get_y_size());
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ INLINE PNMImage::
|
||||
*/
|
||||
INLINE xelval PNMImage::
|
||||
clamp_val(int input_value) const {
|
||||
return (xelval)std::min(std::max(0, input_value), (int)get_maxval());
|
||||
return (xelval)(std::min)((std::max)(0, input_value), (int)get_maxval());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -113,9 +113,9 @@ to_val(const LRGBColorf &value) const {
|
||||
case XE_scRGB_alpha:
|
||||
{
|
||||
LRGBColorf scaled = value * 8192.f + 4096.5f;
|
||||
col.r = std::min(std::max(0, (int)scaled[0]), 65535);
|
||||
col.g = std::min(std::max(0, (int)scaled[1]), 65535);
|
||||
col.b = std::min(std::max(0, (int)scaled[2]), 65535);
|
||||
col.r = (std::min)((std::max)(0, (int)scaled[0]), 65535);
|
||||
col.g = (std::min)((std::max)(0, (int)scaled[1]), 65535);
|
||||
col.b = (std::min)((std::max)(0, (int)scaled[2]), 65535);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -131,7 +131,7 @@ to_val(float input_value) const {
|
||||
switch (_xel_encoding) {
|
||||
case XE_generic:
|
||||
case XE_generic_alpha:
|
||||
return (int)(std::min(1.0f, std::max(0.0f, input_value)) * get_maxval() + 0.5f);
|
||||
return (int)((std::min)(1.0f, (std::max)(0.0f, input_value)) * get_maxval() + 0.5f);
|
||||
|
||||
case XE_generic_sRGB:
|
||||
case XE_generic_sRGB_alpha:
|
||||
@ -148,7 +148,7 @@ to_val(float input_value) const {
|
||||
|
||||
case XE_scRGB:
|
||||
case XE_scRGB_alpha:
|
||||
return std::min(std::max(0, (int)((8192 * input_value) + 4096.5f)), 65535);
|
||||
return (std::min)((std::max)(0, (int)((8192 * input_value) + 4096.5f)), 65535);
|
||||
|
||||
default:
|
||||
return 0;
|
||||
@ -210,7 +210,7 @@ from_val(xelval input_value) const {
|
||||
switch (_xel_encoding) {
|
||||
case XE_generic:
|
||||
case XE_generic_alpha:
|
||||
return std::min((float)input_value * _inv_maxval, 1.0f);
|
||||
return (std::min)((float)input_value * _inv_maxval, 1.0f);
|
||||
|
||||
case XE_generic_sRGB:
|
||||
case XE_generic_sRGB_alpha:
|
||||
@ -735,19 +735,19 @@ set_xel_a(int x, int y, const LColorf &value) {
|
||||
case XE_scRGB:
|
||||
{
|
||||
LColorf scaled = value * 8192.0f + 4096.5f;
|
||||
col.r = std::min(std::max(0, (int)scaled[0]), 65535);
|
||||
col.g = std::min(std::max(0, (int)scaled[1]), 65535);
|
||||
col.b = std::min(std::max(0, (int)scaled[2]), 65535);
|
||||
col.r = (std::min)((std::max)(0, (int)scaled[0]), 65535);
|
||||
col.g = (std::min)((std::max)(0, (int)scaled[1]), 65535);
|
||||
col.b = (std::min)((std::max)(0, (int)scaled[2]), 65535);
|
||||
}
|
||||
break;
|
||||
|
||||
case XE_scRGB_alpha:
|
||||
{
|
||||
LColorf scaled = value * 8192.0f + 4096.5f;
|
||||
col.r = std::min(std::max(0, (int)scaled[0]), 65535);
|
||||
col.g = std::min(std::max(0, (int)scaled[1]), 65535);
|
||||
col.b = std::min(std::max(0, (int)scaled[2]), 65535);
|
||||
alpha_row(y)[x] = std::min(std::max(0, (int)(value[3] * 65535 + 0.5f)), 65535);
|
||||
col.r = (std::min)((std::max)(0, (int)scaled[0]), 65535);
|
||||
col.g = (std::min)((std::max)(0, (int)scaled[1]), 65535);
|
||||
col.b = (std::min)((std::max)(0, (int)scaled[2]), 65535);
|
||||
alpha_row(y)[x] = (std::min)((std::max)(0, (int)(value[3] * 65535 + 0.5f)), 65535);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1224,14 +1224,14 @@ setup_sub_image(const PNMImage ©, int &xto, int &yto,
|
||||
yto = 0;
|
||||
}
|
||||
|
||||
x_size = std::min(x_size, copy.get_x_size() - xfrom);
|
||||
y_size = std::min(y_size, copy.get_y_size() - yfrom);
|
||||
x_size = (std::min)(x_size, copy.get_x_size() - xfrom);
|
||||
y_size = (std::min)(y_size, copy.get_y_size() - yfrom);
|
||||
|
||||
xmin = xto;
|
||||
ymin = yto;
|
||||
|
||||
xmax = std::min(xmin + x_size, get_x_size());
|
||||
ymax = std::min(ymin + y_size, get_y_size());
|
||||
xmax = (std::min)(xmin + x_size, get_x_size());
|
||||
ymax = (std::min)(ymin + y_size, get_y_size());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,7 +110,7 @@ INLINE double ClockObject::
|
||||
get_dt(Thread *current_thread) const {
|
||||
CDReader cdata(_cycler, current_thread);
|
||||
if (_max_dt > 0.0) {
|
||||
return std::min(_max_dt, cdata->_dt);
|
||||
return (std::min)(_max_dt, cdata->_dt);
|
||||
}
|
||||
return cdata->_dt;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user