Add auto-included fart/common.h
This commit is contained in:
1 parent
1947ea553c
commit
d71be68fae
6 files changed
+14
-9
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ end
|
|||||||
|
|
||||||
env do |env|
|
env do |env|
|
||||||
env.add_builder(Propane)
|
env.add_builder(Propane)
|
||||||
env["CCFLAGS"] += %w[-Wall -O2 -std=c++23]
|
env["CCFLAGS"] += %w[-Wall -O2 -std=c++23 -include fart/common.h]
|
||||||
env["CPPPATH"] += %W[src #{env.build_root}/src]
|
env["CPPPATH"] += %W[src #{env.build_root}/src]
|
||||||
|
|
||||||
env.Propane("^/src/propane.cpp", "src/fart.propane")
|
env.Propane("^/src/propane.cpp", "src/fart.propane")
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
|
||||||
ImageWriter * ImageWriter::build(const std::string & fname)
|
ImageWriter * ImageWriter::build(const string & fname)
|
||||||
{
|
{
|
||||||
std::string ext = std::filesystem::path(fname).extension().string();
|
string ext = std::filesystem::path(fname).extension().string();
|
||||||
if (ext == ".png")
|
if (ext == ".png")
|
||||||
{
|
{
|
||||||
return new PngImageWriter(fname);
|
return new PngImageWriter(fname);
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
class ImageWriter
|
class ImageWriter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static ImageWriter * build(const std::string & fname);
|
static ImageWriter * build(const string & fname);
|
||||||
virtual ~ImageWriter() = default;
|
virtual ~ImageWriter() = default;
|
||||||
virtual bool write(const Image & image) = 0;
|
virtual bool write(const Image & image) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ImageWriter(const std::string & fname) : fname(fname) {}
|
ImageWriter(const string & fname) : fname(fname) {}
|
||||||
std::string fname;
|
string fname;
|
||||||
};
|
};
|
||||||
@@ -5,6 +5,6 @@
|
|||||||
class PngImageWriter : public ImageWriter
|
class PngImageWriter : public ImageWriter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PngImageWriter(const std::string & fname) : ImageWriter(fname) {}
|
PngImageWriter(const string & fname) : ImageWriter(fname) {}
|
||||||
bool write(const Image & image) override;
|
bool write(const Image & image) override;
|
||||||
};
|
};
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
struct RenderParams
|
struct RenderParams
|
||||||
{
|
{
|
||||||
std::string input_file;
|
string input_file;
|
||||||
std::string output_file;
|
string output_file;
|
||||||
size_t width = 0u;
|
size_t width = 0u;
|
||||||
size_t height = 0u;
|
size_t height = 0u;
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
using string = std::string;
|
||||||
Reference in new issue
Block a user