better gcc and types.h
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
build
|
build
|
||||||
*.o
|
|
||||||
.vscode
|
.vscode
|
||||||
*.bmp
|
*.bmp
|
||||||
@@ -3,7 +3,5 @@ clean:
|
|||||||
rm -rf build
|
rm -rf build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
mkdir -p build && \
|
mkdir -p build
|
||||||
cd build && \
|
gcc -Wall src/*.c src/*.h -o build/mg
|
||||||
gcc -Wall -c ../src/*.c && \
|
|
||||||
gcc -Wall -o mg *.o
|
|
||||||
+1
-12
@@ -1,21 +1,10 @@
|
|||||||
|
#include "types.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef ARGS_H
|
#ifndef ARGS_H
|
||||||
#define ARGS_H
|
#define ARGS_H
|
||||||
|
|
||||||
struct Parameters {
|
|
||||||
unsigned long width;
|
|
||||||
unsigned long height;
|
|
||||||
char *file_path;
|
|
||||||
unsigned int size;
|
|
||||||
float slope;
|
|
||||||
float start[3];
|
|
||||||
float var[3];
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct Parameters parameters;
|
|
||||||
|
|
||||||
parameters parse_args(int argc, char **argv);
|
parameters parse_args(int argc, char **argv);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
|
#include "types.h"
|
||||||
|
|
||||||
#ifndef BMP_H
|
#ifndef BMP_H
|
||||||
#define BMP_H
|
#define BMP_H
|
||||||
|
|
||||||
typedef void line_fn(unsigned long y, char *data_buffer);
|
|
||||||
|
|
||||||
void bmp_generate(unsigned long width, unsigned long height,
|
void bmp_generate(unsigned long width, unsigned long height,
|
||||||
unsigned int color_depth, char *file_path,
|
unsigned int color_depth, char *file_path,
|
||||||
line_fn generate_line);
|
line_fn generate_line);
|
||||||
|
|||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef TYPES_H
|
||||||
|
#define TYPES_H
|
||||||
|
|
||||||
|
struct Parameters {
|
||||||
|
unsigned long width;
|
||||||
|
unsigned long height;
|
||||||
|
char *file_path;
|
||||||
|
unsigned int size;
|
||||||
|
float slope;
|
||||||
|
float start[3];
|
||||||
|
float var[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct Parameters parameters;
|
||||||
|
|
||||||
|
typedef void line_fn(unsigned long y, char *data_buffer);
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user