mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
general: Get rid of some coerce constructors where they make no sense
This commit is contained in:
parent
61ff260ee3
commit
cee1de7338
@ -53,8 +53,8 @@ PUBLISHED:
|
|||||||
};
|
};
|
||||||
|
|
||||||
DSearchPath() = default;
|
DSearchPath() = default;
|
||||||
DSearchPath(const std::string &path, const std::string &separator = std::string());
|
explicit DSearchPath(const std::string &path, const std::string &separator = std::string());
|
||||||
DSearchPath(const Filename &directory);
|
explicit DSearchPath(const Filename &directory);
|
||||||
DSearchPath(const DSearchPath ©) = default;
|
DSearchPath(const DSearchPath ©) = default;
|
||||||
DSearchPath(DSearchPath &&from) = default;
|
DSearchPath(DSearchPath &&from) = default;
|
||||||
~DSearchPath() = default;
|
~DSearchPath() = default;
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
|
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
INLINE Filename();
|
INLINE Filename();
|
||||||
Filename(const Filename &dirname, const Filename &basename);
|
explicit Filename(const Filename &dirname, const Filename &basename);
|
||||||
|
|
||||||
#ifdef HAVE_PYTHON
|
#ifdef HAVE_PYTHON
|
||||||
EXTENSION(Filename(PyObject *path));
|
EXTENSION(Filename(PyObject *path));
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
class EXPCL_DTOOL_PRC ConfigVariableBool : public ConfigVariable {
|
class EXPCL_DTOOL_PRC ConfigVariableBool : public ConfigVariable {
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
INLINE ConfigVariableBool(const std::string &name);
|
INLINE explicit ConfigVariableBool(const std::string &name);
|
||||||
INLINE ConfigVariableBool(const std::string &name, bool default_value,
|
INLINE ConfigVariableBool(const std::string &name, bool default_value,
|
||||||
const std::string &description = std::string(), int flags = 0);
|
const std::string &description = std::string(), int flags = 0);
|
||||||
INLINE ConfigVariableBool(const std::string &name, const std::string &default_value,
|
INLINE ConfigVariableBool(const std::string &name, const std::string &default_value,
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
class EXPCL_DTOOL_PRC ConfigVariableDouble : public ConfigVariable {
|
class EXPCL_DTOOL_PRC ConfigVariableDouble : public ConfigVariable {
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
INLINE ConfigVariableDouble(const std::string &name);
|
INLINE explicit ConfigVariableDouble(const std::string &name);
|
||||||
INLINE ConfigVariableDouble(const std::string &name, double default_value,
|
INLINE ConfigVariableDouble(const std::string &name, double default_value,
|
||||||
const std::string &description = std::string(),
|
const std::string &description = std::string(),
|
||||||
int flags = 0);
|
int flags = 0);
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
class EXPCL_DTOOL_PRC ConfigVariableFilename : public ConfigVariable {
|
class EXPCL_DTOOL_PRC ConfigVariableFilename : public ConfigVariable {
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
INLINE ConfigVariableFilename(const std::string &name);
|
INLINE explicit ConfigVariableFilename(const std::string &name);
|
||||||
INLINE ConfigVariableFilename(const std::string &name, const Filename &default_value,
|
INLINE ConfigVariableFilename(const std::string &name, const Filename &default_value,
|
||||||
const std::string &description = std::string(), int flags = 0);
|
const std::string &description = std::string(), int flags = 0);
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
class EXPCL_DTOOL_PRC ConfigVariableInt : public ConfigVariable {
|
class EXPCL_DTOOL_PRC ConfigVariableInt : public ConfigVariable {
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
INLINE ConfigVariableInt(const std::string &name);
|
INLINE explicit ConfigVariableInt(const std::string &name);
|
||||||
INLINE ConfigVariableInt(const std::string &name, int default_value,
|
INLINE ConfigVariableInt(const std::string &name, int default_value,
|
||||||
const std::string &description = std::string(),
|
const std::string &description = std::string(),
|
||||||
int flags = 0);
|
int flags = 0);
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
class EXPCL_DTOOL_PRC ConfigVariableInt64 : public ConfigVariable {
|
class EXPCL_DTOOL_PRC ConfigVariableInt64 : public ConfigVariable {
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
INLINE ConfigVariableInt64(const std::string &name);
|
INLINE explicit ConfigVariableInt64(const std::string &name);
|
||||||
INLINE ConfigVariableInt64(const std::string &name, int64_t default_value,
|
INLINE ConfigVariableInt64(const std::string &name, int64_t default_value,
|
||||||
const std::string &description = std::string(),
|
const std::string &description = std::string(),
|
||||||
int flags = 0);
|
int flags = 0);
|
||||||
|
@ -29,7 +29,7 @@ class EXPCL_PANDA_DOWNLOADER URLSpec {
|
|||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
URLSpec();
|
URLSpec();
|
||||||
INLINE URLSpec(const std::string &url, bool server_name_expected = false);
|
INLINE URLSpec(const std::string &url, bool server_name_expected = false);
|
||||||
URLSpec(const URLSpec &url, const Filename &path);
|
explicit URLSpec(const URLSpec &url, const Filename &path);
|
||||||
INLINE void operator = (const std::string &url);
|
INLINE void operator = (const std::string &url);
|
||||||
|
|
||||||
INLINE bool operator == (const URLSpec &other) const;
|
INLINE bool operator == (const URLSpec &other) const;
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
class EXPCL_PANDA_EXPRESS Datagram : public TypedObject {
|
class EXPCL_PANDA_EXPRESS Datagram : public TypedObject {
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
INLINE Datagram() = default;
|
INLINE Datagram() = default;
|
||||||
INLINE Datagram(const void *data, size_t size);
|
INLINE explicit Datagram(const void *data, size_t size);
|
||||||
INLINE explicit Datagram(vector_uchar data);
|
INLINE explicit Datagram(vector_uchar data);
|
||||||
Datagram(const Datagram ©) = default;
|
Datagram(const Datagram ©) = default;
|
||||||
Datagram(Datagram &&from) noexcept = default;
|
Datagram(Datagram &&from) noexcept = default;
|
||||||
|
@ -10455,9 +10455,9 @@ make_this_from_bam(const FactoryParams ¶ms) {
|
|||||||
// If texture filename was given relative to the bam filename, expand
|
// If texture filename was given relative to the bam filename, expand
|
||||||
// it now.
|
// it now.
|
||||||
Filename bam_dir = manager->get_filename().get_dirname();
|
Filename bam_dir = manager->get_filename().get_dirname();
|
||||||
vfs->resolve_filename(filename, bam_dir);
|
vfs->resolve_filename(filename, DSearchPath(bam_dir));
|
||||||
if (!alpha_filename.empty()) {
|
if (!alpha_filename.empty()) {
|
||||||
vfs->resolve_filename(alpha_filename, bam_dir);
|
vfs->resolve_filename(alpha_filename, DSearchPath(bam_dir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ PUBLISHED:
|
|||||||
INLINE_LINMATH FLOATNAME(LVecBase3)() = default;
|
INLINE_LINMATH FLOATNAME(LVecBase3)() = default;
|
||||||
INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE fill_value);
|
INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE fill_value);
|
||||||
INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z);
|
INLINE_LINMATH FLOATNAME(LVecBase3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z);
|
||||||
INLINE_LINMATH FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z);
|
INLINE_LINMATH explicit FLOATNAME(LVecBase3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z);
|
||||||
ALLOC_DELETED_CHAIN(FLOATNAME(LVecBase3));
|
ALLOC_DELETED_CHAIN(FLOATNAME(LVecBase3));
|
||||||
|
|
||||||
#ifdef CPPPARSER
|
#ifdef CPPPARSER
|
||||||
|
@ -40,7 +40,7 @@ PUBLISHED:
|
|||||||
INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE fill_value);
|
INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE fill_value);
|
||||||
INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w);
|
INLINE_LINMATH FLOATNAME(LVecBase4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w);
|
||||||
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(UnalignedLVecBase4) ©);
|
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(UnalignedLVecBase4) ©);
|
||||||
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w);
|
INLINE_LINMATH explicit FLOATNAME(LVecBase4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w);
|
||||||
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LPoint3) &point);
|
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LPoint3) &point);
|
||||||
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LVector3) &vector);
|
INLINE_LINMATH FLOATNAME(LVecBase4)(const FLOATNAME(LVector3) &vector);
|
||||||
ALLOC_DELETED_CHAIN(FLOATNAME(LVecBase4));
|
ALLOC_DELETED_CHAIN(FLOATNAME(LVecBase4));
|
||||||
|
@ -41,7 +41,7 @@ typedef unsigned char gray;
|
|||||||
struct pixel {
|
struct pixel {
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
pixel() = default;
|
pixel() = default;
|
||||||
pixel(gray fill) : r(fill), g(fill), b(fill) { }
|
explicit pixel(gray fill) : r(fill), g(fill), b(fill) { }
|
||||||
pixel(gray r, gray g, gray b) : r(r), g(g), b(b) { }
|
pixel(gray r, gray g, gray b) : r(r), g(g), b(b) { }
|
||||||
|
|
||||||
gray operator [](int i) const { nassertr(i >= 0 && i < 3, 0); return *(&r + i); }
|
gray operator [](int i) const { nassertr(i >= 0 && i < 3, 0); return *(&r + i); }
|
||||||
|
@ -30,7 +30,7 @@ PUBLISHED:
|
|||||||
// its value, it might happen after the value had already been set
|
// its value, it might happen after the value had already been set
|
||||||
// previously by another static initializer!
|
// previously by another static initializer!
|
||||||
INLINE ButtonHandle() = default;
|
INLINE ButtonHandle() = default;
|
||||||
constexpr ButtonHandle(int index);
|
explicit constexpr ButtonHandle(int index);
|
||||||
ButtonHandle(const std::string &name);
|
ButtonHandle(const std::string &name);
|
||||||
|
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
|
@ -49,8 +49,8 @@ PUBLISHED:
|
|||||||
TF_no_filters = 0x0400, // disallow using texture pool filters
|
TF_no_filters = 0x0400, // disallow using texture pool filters
|
||||||
};
|
};
|
||||||
|
|
||||||
LoaderOptions(int flags = LF_search | LF_report_errors);
|
explicit LoaderOptions(int flags = LF_search | LF_report_errors);
|
||||||
constexpr LoaderOptions(int flags, int texture_flags);
|
explicit constexpr LoaderOptions(int flags, int texture_flags);
|
||||||
|
|
||||||
INLINE void set_flags(int flags);
|
INLINE void set_flags(int flags);
|
||||||
INLINE int get_flags() const;
|
INLINE int get_flags() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user