mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-05 19:56:18 +00:00
Merge branch 'master' into features-1.1.0
This commit is contained in:
commit
ad4e399018
26 files changed
+241
-203
No files matched your search
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
@@ -102,8 +103,7 @@ void sect_RelBytes(uint32_t n, std::vector<Expression> const &exprs);
|
||||
void sect_RelWord(Expression const &expr, uint32_t pcShift);
|
||||
void sect_RelLong(Expression const &expr, uint32_t pcShift);
|
||||
void sect_PCRelByte(Expression const &expr, uint32_t pcShift);
|
||||
bool sect_BinaryFile(std::string const &name, uint32_t startPos);
|
||||
bool sect_BinaryFileSlice(std::string const &name, uint32_t startPos, uint32_t length);
|
||||
bool sect_BinaryFile(std::string const &name, uint32_t startPos, std::optional<uint32_t> length);
|
||||
|
||||
void sect_EndSection();
|
||||
void sect_PushSection();
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public:
|
||||
}
|
||||
std::streambuf *operator->() { return &**this; }
|
||||
|
||||
char const *c_str(std::string const &path) const {
|
||||
char const *display_name(std::string const &path) const {
|
||||
return std::holds_alternative<std::filebuf>(_file) ? path.c_str()
|
||||
: std::get<std::streambuf *>(_file) == std::cin.rdbuf() ? "<stdin>"
|
||||
: "<stdout>";
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <streambuf>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "gfx/rgba.hpp"
|
||||
@@ -17,7 +18,11 @@ struct Png {
|
||||
bool isIndexed = false;
|
||||
|
||||
Png() {}
|
||||
Png(std::string const &path);
|
||||
Png(char const *filename, std::streambuf &file);
|
||||
|
||||
private:
|
||||
void initialize(char const *filename, std::streambuf &file);
|
||||
};
|
||||
|
||||
#endif // RGBDS_GFX_PNG_HPP
|
||||
@@ -53,6 +53,12 @@
|
||||
#define O_TEXT 0 // Assume that it's not defined either
|
||||
#endif // _MSC_VER
|
||||
|
||||
// MSVC doesn't have POSIX `ftruncate`, use a suitable replacement
|
||||
#if defined(_MSC_VER)
|
||||
#include <io.h> // IWYU pragma: export
|
||||
#define ftruncate _chsize_s
|
||||
#endif
|
||||
|
||||
// Windows has stdin and stdout open as text by default, which we may not want
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#include <io.h> // IWYU pragma: export
|
||||
|
||||
Reference in new issue
Block a user