summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-02-14 18:03:09 (EST)
committer P. J. McDermott <pjm@nac.net>2013-02-14 18:03:09 (EST)
commit80191b41352ad20493fb62e8f3683d69133d0d24 (patch)
treecb77e93dfe476d9535ca48e732a98aae9a780ba4 /src/main.c
downloadoverworld-rpg-80191b41352ad20493fb62e8f3683d69133d0d24.zip
overworld-rpg-80191b41352ad20493fb62e8f3683d69133d0d24.tar.gz
overworld-rpg-80191b41352ad20493fb62e8f3683d69133d0d24.tar.bz2
Initial commit.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..b30d0b2
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,65 @@
+#include <SDL.h>
+#include "init.h"
+#include "logging.h"
+#include "image.h"
+#include "tmx.h"
+
+int
+main(void)
+{
+ SDL_Surface *img;
+ SDL_Rect imgrect, surfacerect;
+
+ init();
+
+ tmx_load("data/forest1.tmx");
+
+ img = load_png("../forest-6-layer-test_ground.png");
+ imgrect.w = 240;
+ imgrect.h = 160;
+ surfacerect.x = 0;
+ surfacerect.y = 0;
+ surfacerect.w = 240;
+ surfacerect.h = 160;
+
+ imgrect.x = 208;
+ imgrect.y = 480;
+ SDL_BlitSurface(img, &imgrect, screen, &surfacerect);
+ SDL_Flip(screen);
+ SDL_Delay(500);
+
+ imgrect.x = 208;
+ imgrect.y = 464;
+ SDL_BlitSurface(img, &imgrect, screen, &surfacerect);
+ SDL_Flip(screen);
+ SDL_Delay(500);
+
+ imgrect.x = 224;
+ imgrect.y = 464;
+ SDL_BlitSurface(img, &imgrect, screen, &surfacerect);
+ SDL_Flip(screen);
+ SDL_Delay(500);
+
+ imgrect.x = 240;
+ imgrect.y = 464;
+ SDL_BlitSurface(img, &imgrect, screen, &surfacerect);
+ SDL_Flip(screen);
+ SDL_Delay(500);
+
+ imgrect.x = 256;
+ imgrect.y = 464;
+ SDL_BlitSurface(img, &imgrect, screen, &surfacerect);
+ SDL_Flip(screen);
+ SDL_Delay(500);
+
+ imgrect.x = 256;
+ imgrect.y = 448;
+ SDL_BlitSurface(img, &imgrect, screen, &surfacerect);
+ SDL_Flip(screen);
+ SDL_Delay(500);
+
+ quit(0);
+
+ /* Control doesn't actually reach here. */
+ return 0;
+}