summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-08-29 09:25:53 (GMT)
committer Simon <simon@hardwired.org.uk>2010-08-29 09:25:53 (GMT)
commitc0563111f822f5253264c7805917a864e1ddda5d (patch)
treec27c0eedd1f9bd96a8e849ab8940c9f4f27667c9
parenta23f3777314312f8dfb70b779258dbb2f948bd08 (diff)
downloadpowder-c0563111f822f5253264c7805917a864e1ddda5d.zip
powder-c0563111f822f5253264c7805917a864e1ddda5d.tar.gz
Include some headers and move some functions
-rw-r--r--interface.c4
-rw-r--r--main.c34
-rw-r--r--misc.c28
-rw-r--r--misc.h12
-rw-r--r--powder.c1
5 files changed, 45 insertions, 34 deletions
diff --git a/interface.c b/interface.c
index f40fadc..d5d87e5 100644
--- a/interface.c
+++ b/interface.c
@@ -1,10 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <math.h>
+#include "http.h"
+#include "md5.h"
#include "font.h"
#include "defines.h"
#include "powder.h"
#include "interface.h"
+#include "misc.h"
SDLMod sdl_mod;
int sdl_key, sdl_wheel, sdl_caps=0, sdl_ascii, sdl_zoom_trig=0;
diff --git a/main.c b/main.c
index 88b712c..e30a972 100644
--- a/main.c
+++ b/main.c
@@ -1167,40 +1167,6 @@ int execute_tagop(pixel *vid_buf, char *op, char *tag)
return 0;
}
-struct strlist
-{
- char *str;
- struct strlist *next;
-};
-
-void strlist_add(struct strlist **list, char *str)
-{
- struct strlist *item = malloc(sizeof(struct strlist));
- item->str = mystrdup(str);
- item->next = *list;
- *list = item;
-}
-
-int strlist_find(struct strlist **list, char *str)
-{
- struct strlist *item;
- for(item=*list; item; item=item->next)
- if(!strcmp(item->str, str))
- return 1;
- return 0;
-}
-
-void strlist_free(struct strlist **list)
-{
- struct strlist *item;
- while(*list)
- {
- item = *list;
- *list = (*list)->next;
- free(item);
- }
-}
-
void thumb_cache_inval(char *id);
void execute_save(pixel *vid_buf)
diff --git a/misc.c b/misc.c
index ade3c3c..a74b0e4 100644
--- a/misc.c
+++ b/misc.c
@@ -52,4 +52,32 @@ char *mystrdup(char *s)
return x;
}
return s;
+}
+
+void strlist_add(struct strlist **list, char *str)
+{
+ struct strlist *item = malloc(sizeof(struct strlist));
+ item->str = mystrdup(str);
+ item->next = *list;
+ *list = item;
+}
+
+int strlist_find(struct strlist **list, char *str)
+{
+ struct strlist *item;
+ for(item=*list; item; item=item->next)
+ if(!strcmp(item->str, str))
+ return 1;
+ return 0;
+}
+
+void strlist_free(struct strlist **list)
+{
+ struct strlist *item;
+ while(*list)
+ {
+ item = *list;
+ *list = (*list)->next;
+ free(item);
+ }
} \ No newline at end of file
diff --git a/misc.h b/misc.h
index 556cc97..e279093 100644
--- a/misc.h
+++ b/misc.h
@@ -22,4 +22,16 @@ extern inline float restrict_flt(float f, float min, float max);
char *mystrdup(char *s);
+struct strlist
+{
+ char *str;
+ struct strlist *next;
+};
+
+void strlist_add(struct strlist **list, char *str);
+
+int strlist_find(struct strlist **list, char *str);
+
+void strlist_free(struct strlist **list);
+
#endif \ No newline at end of file
diff --git a/powder.c b/powder.c
index d1c8321..0f31577 100644
--- a/powder.c
+++ b/powder.c
@@ -463,6 +463,7 @@ void update_particles_i(pixel *vid, int start, int inc)
for(i=start; i<(NPART-starti); i+=inc)
if(parts[i].type)
{
+ //printf("parts[%d].type: %d\n", i, parts[i].type);
lx = parts[i].x;
ly = parts[i].y;