]> git.lizzy.rs Git - shadowclad.git/commitdiff
random stuff
authoroutfrost <kotlet.bahn@gmail.com>
Wed, 24 Jan 2018 19:49:36 +0000 (20:49 +0100)
committeroutfrost <kotlet.bahn@gmail.com>
Wed, 24 Jan 2018 19:49:36 +0000 (20:49 +0100)
Makefile
debugutil.h
glut_janitor.h
level.c
level.h
lib3ds.so [new symlink]
main.c
render.c
render.h
typedefs.h

index 33effd2b865177228e4aaa4ab657897080c76461..71dec25576e978e51ab1a76090e058521d6b06e5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 compileargs = -Wall -Wextra -Wpedantic
-linkargs = -lGL -lglut -Lout -l3ds
+linkargs = -lGL -lglut -l3ds
 objects = out/main.o out/debugutil.o out/glut_janitor.o out/render.o \
-          out/tga.o out/level.o out/lib3ds.so
+          out/tga.o out/level.o
 
 shadowclad : $(objects)
        gcc -o out/shadowclad $(objects) $(linkargs)
@@ -26,6 +26,3 @@ out/tga.o : tga.c tga.h
 
 out/level.o : level.c level.h tga.h lib/lib3ds.h
        gcc -c -o out/level.o level.c $(compileargs)
-
-out/lib3ds.so : lib/lib3ds.so.2.0.0 lib/lib3ds.h
-       cp lib/lib3ds.so.2.0.0 out/lib3ds.so
index df7a31ef21b3bf8ba4e7ff914ef16f752890d2b0..77bc7d9b5250adfc709aaea7c7234ba24c38f514 100644 (file)
@@ -1 +1,6 @@
+#ifndef DEBUGUTIL_H
+#define DEBUGUTIL_H
+
 char * get_gl_info();
+
+#endif
index 7c79355bf80f0cea41e9331c9147d74be4a91d11..b8ba6ba8d4cbc35e3ba44718fac9cdd2fe340fd2 100644 (file)
@@ -1,4 +1,9 @@
+#ifndef GLUT_JANITOR_H
+#define GLUT_JANITOR_H
+
 #include <GL/gl.h>
 
 void init_render();
 void resize_stage(GLsizei width, GLsizei height);
+
+#endif
diff --git a/level.c b/level.c
index 77e2356919aa0817cffabf76571f4d200631bd93..a5ba854ca5a6be826a4e4f750014335bd24ebd6f 100644 (file)
--- a/level.c
+++ b/level.c
@@ -4,6 +4,9 @@
 #include "level.h"
 #include "tga.h"
 
+const GLuint BLOCK_EMPTY = 0x000000FF;
+const GLuint BLOCK_WALL01 = 0xFF0000FF;
+
 TGAimage* level_image = NULL;
 
 Block** blocks;
diff --git a/level.h b/level.h
index e65ea1eb2dc58629ff7694d62ab3cc14cdc3fa86..11dbae75539205161d46c9d1571bdf3131c81491 100644 (file)
--- a/level.h
+++ b/level.h
@@ -14,9 +14,10 @@ typedef struct {
        unsigned int obstacle;
 } Block;
 
-const GLuint BLOCK_EMPTY = 0x000000FF;
-const GLuint BLOCK_WALL01 = 0xFF0000FF;
+const GLuint BLOCK_EMPTY;
+const GLuint BLOCK_WALL01;
 
+void init_blocks();
 Block* get_block_at(GLushort x, GLushort y);
 void set_level_image(TGAimage* image);
 
diff --git a/lib3ds.so b/lib3ds.so
new file mode 120000 (symlink)
index 0000000..44d8e80
--- /dev/null
+++ b/lib3ds.so
@@ -0,0 +1 @@
+lib/lib3ds.so.2.0.0
\ No newline at end of file
diff --git a/main.c b/main.c
index 7bca0aa32e8357ca1dea04b74c12947bf404a0fa..4ca62ace552af325f20c2692178aa0deda2b170b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -3,6 +3,7 @@
 #include "debugutil.h"
 #include "glut_janitor.h"
 #include "render.h"
+#include "level.h"
 
 int main(int argc, char** argv) {
        glutInit(&argc, argv);
@@ -22,6 +23,8 @@ int main(int argc, char** argv) {
        
        init_render();
        
+       init_blocks();
+       
        glutMainLoop();
        return 0;
 }
index 25e36ba2e80899f7d33937e0cc41faec60198e75..9a8dde9856bdc4eddf77e8961d3a6c3312b27f10 100644 (file)
--- a/render.c
+++ b/render.c
@@ -18,12 +18,12 @@ void render_scene() {
 }
 
 void draw_axes() {
-       point3f x_axis_start = { -AXIS_RADIUS, 0.0f, 0.0f };
-       point3f x_axis_end = { AXIS_RADIUS, 0.0f, 0.0f };
-       point3f y_axis_start = { 0.0f, -AXIS_RADIUS, 0.0f };
-       point3f y_axis_end = { 0.0f, AXIS_RADIUS, 0.0f };
-       point3f z_axis_start = { 0.0f, 0.0f, -AXIS_RADIUS };
-       point3f z_axis_end = { 0.0f, 0.0f, AXIS_RADIUS };
+       Point3f x_axis_start = { -AXIS_RADIUS, 0.0f, 0.0f };
+       Point3f x_axis_end = { AXIS_RADIUS, 0.0f, 0.0f };
+       Point3f y_axis_start = { 0.0f, -AXIS_RADIUS, 0.0f };
+       Point3f y_axis_end = { 0.0f, AXIS_RADIUS, 0.0f };
+       Point3f z_axis_start = { 0.0f, 0.0f, -AXIS_RADIUS };
+       Point3f z_axis_end = { 0.0f, 0.0f, AXIS_RADIUS };
        
        glColor3f(1.0f, 0.0f, 0.0f);
        glBegin(GL_LINES);
@@ -43,3 +43,7 @@ void draw_axes() {
        glVertex3fv(z_axis_end);
        glEnd();
 }
+
+void test_draw_wall() {
+       
+}
index 3eb135f7001fb57f93855e14615a5af7b56cc0ff..15d113a7b14f77fb076d3cb34e08cbe4620165bc 100644 (file)
--- a/render.h
+++ b/render.h
@@ -1,2 +1,8 @@
+#ifndef RENDER_H
+#define RENDER_H
+
 void render_scene();
 void draw_axes();
+void test_draw_wall();
+
+#endif
index d492aeee6af22bd6f6b003fb055e6a1beda50c1d..80d46f228e9652e9635f9cd8ae6ce190a793b91b 100644 (file)
@@ -1 +1,6 @@
-typedef float point3f[3];
+#ifndef TYPEDEFS_H
+#define TYPEDEFS_H
+
+typedef float Point3f[3];
+
+#endif