Index: proj/include/ent.h
===================================================================
--- proj/include/ent.h	(nonexistent)
+++ proj/include/ent.h	(revision 193)
@@ -0,0 +1,28 @@
+#ifndef ENT_H_INCLUDED
+#define ENT_H_INCLUDED
+
+#include "sprite.h"
+
+void (ent_set_scale) (double n);
+void (ent_set_origin)(double x, double y);
+
+double (ent_get_XLength)(void);
+double (ent_get_YLength)(void);
+
+struct ent;
+typedef struct ent ent_t;
+
+ent_t* (ent_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon);
+void   (ent_dtor)(ent_t *p);
+
+void (ent_set_pos)  (ent_t *p, int16_t x, int16_t y);
+void (ent_set_angle)(ent_t *p, double angle        );
+
+double  (ent_get_x)       (const ent_t *p);
+double  (ent_get_y)       (const ent_t *p);
+int16_t (ent_get_x_screen)(const ent_t *p);
+int16_t (ent_get_y_screen)(const ent_t *p);
+
+void (ent_draw)(ent_t *p);
+
+#endif //ENT_H_INCLUDED

Property changes on: proj/include/ent.h
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: proj/src/ent.c
===================================================================
--- proj/src/ent.c	(nonexistent)
+++ proj/src/ent.c	(revision 193)
@@ -0,0 +1,62 @@
+#include <lcom/lcf.h>
+
+#include "ent.h"
+
+#include "graph.h"
+
+static double scale = 1.0;
+static int16_t x_origin = 0;
+static int16_t y_origin = 0;
+
+void (ent_set_scale) (double n){ scale = n; }
+void (ent_set_origin)(double x, double y){ x_origin = x; y_origin = y; }
+
+double (ent_get_XLength)(void){ return graph_get_XRes()/scale; }
+double (ent_get_YLength)(void){ return graph_get_YRes()/scale; }
+
+struct ent{
+    double x, y; //real position in meters
+    sprite_t *dude;
+    sprite_t *weapon;
+};
+
+ent_t* (ent_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon){
+    ent_t *ret = malloc(sizeof(ent_t));
+    if(ret == NULL) return NULL;
+    ret->x = 0.0;
+    ret->y = 0.0;
+    ret->dude   = sprite_ctor(dude  );
+    ret->weapon = sprite_ctor(weapon);
+    if(ret->dude == NULL || ret->weapon == NULL){
+        ent_dtor(ret);
+        return NULL;
+    } else return ret;
+}
+void (ent_dtor)(ent_t *p){
+    if(p == NULL) return;
+    sprite_dtor(p->dude);
+    sprite_dtor(p->weapon);
+    free(p);
+}
+
+void (ent_set_pos)  (ent_t *p, int16_t x, int16_t y){ p->x = x; p->y = y; }
+void (ent_set_angle)(ent_t *p, double angle        ){
+    sprite_set_angle(p->dude  , angle);
+    sprite_set_angle(p->weapon, angle);
+}
+
+double  (ent_get_x)       (const ent_t *p){ return p->x; }
+double  (ent_get_y)       (const ent_t *p){ return p->y; }
+int16_t (ent_get_x_screen)(const ent_t *p){ return (p->x-x_origin)*scale; }
+int16_t (ent_get_y_screen)(const ent_t *p){ return (p->y-y_origin)*scale; }
+
+void (ent_draw)(ent_t *p){
+    const int16_t x_screen = ent_get_x_screen(p);
+    const int16_t y_screen = ent_get_y_screen(p);
+    sprite_set_pos  (p->dude  , x_screen, y_screen);
+    sprite_set_pos  (p->weapon, x_screen, y_screen);
+    sprite_set_scale(p->dude  , scale);
+    sprite_set_scale(p->weapon, scale);
+    sprite_draw     (p->weapon);
+    sprite_draw     (p->dude  );
+}

Property changes on: proj/src/ent.c
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: proj/xpm/nothing.h
===================================================================
--- proj/xpm/nothing.h	(nonexistent)
+++ proj/xpm/nothing.h	(revision 193)
@@ -0,0 +1,11 @@
+#ifndef NOTHING_H_INCLUDED
+#define NOTHING_H_INCLUDED
+
+#include "nothing.xpm"
+#include "sprite.h"
+
+basic_sprite_t* get_nothing(void){
+    return basic_sprite_ctor((const char **)nothing_xpm, 34, 34);
+}
+
+#endif //NOTHING_H_INCLUDED

Property changes on: proj/xpm/nothing.h
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: proj/xpm/nothing.xpm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/x-xpmi
Index: proj/xpm/nothing.xpm
===================================================================
--- proj/xpm/nothing.xpm	(nonexistent)
+++ proj/xpm/nothing.xpm	(revision 193)

Property changes on: proj/xpm/nothing.xpm
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+image/x-xpmi
\ No newline at end of property
Index: proj/xpm/pistol.h
===================================================================
--- proj/xpm/pistol.h	(nonexistent)
+++ proj/xpm/pistol.h	(revision 193)
@@ -0,0 +1,11 @@
+#ifndef PISTOL_H_INCLUDED
+#define PISTOL_H_INCLUDED
+
+#include "pistol.xpm"
+#include "sprite.h"
+
+basic_sprite_t* get_pistol(void){
+    return basic_sprite_ctor((const char **)pistol_xpm, 34, 34);
+}
+
+#endif //PISTOL_H_INCLUDED

Property changes on: proj/xpm/pistol.h
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
