mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 23:34:57 -04:00
pgraph: Add file_version property to BamFile (like BamReader/Writer)
This commit is contained in:
parent
749e297a02
commit
45fbfab094
@ -74,7 +74,11 @@ PUBLISHED:
|
||||
BamReader *get_reader();
|
||||
BamWriter *get_writer();
|
||||
|
||||
public:
|
||||
EXTENSION(PyObject *get_file_version() const);
|
||||
|
||||
PUBLISHED:
|
||||
MAKE_PROPERTY(file_version, get_file_version);
|
||||
MAKE_PROPERTY(file_endian, get_file_endian);
|
||||
MAKE_PROPERTY(file_stdfloat_double, get_file_stdfloat_double);
|
||||
|
||||
|
28
panda/src/pgraph/bamFile_ext.cxx
Normal file
28
panda/src/pgraph/bamFile_ext.cxx
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* PANDA 3D SOFTWARE
|
||||
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||
*
|
||||
* All use of this software is subject to the terms of the revised BSD
|
||||
* license. You should have received a copy of this license along
|
||||
* with this source code in a file named "LICENSE."
|
||||
*
|
||||
* @file bamFile_ext.cxx
|
||||
* @author rdb
|
||||
* @date 2023-05-03
|
||||
*/
|
||||
|
||||
#include "bamFile_ext.h"
|
||||
#include "bamWriter_ext.h"
|
||||
|
||||
#ifdef HAVE_PYTHON
|
||||
|
||||
/**
|
||||
* Returns the version number of the Bam file currently being written.
|
||||
*/
|
||||
PyObject *Extension<BamFile>::
|
||||
get_file_version() const {
|
||||
return Py_BuildValue("(ii)", _this->get_file_major_ver(),
|
||||
_this->get_file_minor_ver());
|
||||
}
|
||||
|
||||
#endif
|
37
panda/src/pgraph/bamFile_ext.h
Normal file
37
panda/src/pgraph/bamFile_ext.h
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* PANDA 3D SOFTWARE
|
||||
* Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||
*
|
||||
* All use of this software is subject to the terms of the revised BSD
|
||||
* license. You should have received a copy of this license along
|
||||
* with this source code in a file named "LICENSE."
|
||||
*
|
||||
* @file bamFile_ext.h
|
||||
* @author rdb
|
||||
* @date 2023-05-03
|
||||
*/
|
||||
|
||||
#ifndef BAMFILE_EXT_H
|
||||
#define BAMFILE_EXT_H
|
||||
|
||||
#include "dtoolbase.h"
|
||||
|
||||
#ifdef HAVE_PYTHON
|
||||
|
||||
#include "extension.h"
|
||||
#include "bamFile.h"
|
||||
#include "py_panda.h"
|
||||
|
||||
/**
|
||||
* This class defines the extension methods for BamFile, which are called
|
||||
* instead of any C++ methods with the same prototype.
|
||||
*/
|
||||
template<>
|
||||
class Extension<BamFile> : public ExtensionBase<BamFile> {
|
||||
public:
|
||||
PyObject *get_file_version() const;
|
||||
};
|
||||
|
||||
#endif // HAVE_PYTHON
|
||||
|
||||
#endif // BAMFILE_EXT_H
|
@ -1,3 +1,4 @@
|
||||
#include "bamFile_ext.cxx"
|
||||
#include "loaderFileTypeRegistry_ext.cxx"
|
||||
#include "nodePath_ext.cxx"
|
||||
#include "nodePathCollection_ext.cxx"
|
||||
|
Loading…
x
Reference in New Issue
Block a user