commit 12bdabfa7b3ced93bf144a14be99dd6a3766f6f5
parent d3c893d57791e587bccf5ae0fd7c135cc7179beb
Author: M. Yamanaka <myamanaka@live.com>
Date: Fri, 22 Jan 2021 22:58:56 -0500
simplified components
Diffstat:
5 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/biblekaruta.c b/biblekaruta.c
@@ -22,11 +22,12 @@ int initBibleKG(BibleKG** G){
(*G)->w = 800;
(*G)->h = 600;
(*G)->t = "Bible Karuta";
- (*G)->C.pos[0] = 0;
+ /*(*G)->C.pos[0] = 0;
(*G)->C.pos[1] = 0;
(*G)->C.gs = 0;
(*G)->C.as = 0;
- (*G)->C.fn = "sprite.png";
+ (*G)->C.fn = "sprite.png";*/
+ for(int i = 0; i < 5; i++) (*G)->C[i] = 0;
return 0;
}
diff --git a/biblekaruta.h b/biblekaruta.h
@@ -37,7 +37,7 @@ typedef struct BibleKG{
SDL_Event e;
SDL_Window* win;
SDL_Renderer* main;
- Crosshair C;
+ Xhair C;
int cards[500];
} BibleKG;
diff --git a/crosshair.c b/crosshair.c
@@ -9,7 +9,7 @@
#include "crosshair.h"
-int drawCrosshair(const Crosshair C){
+int drawCrosshair(Xhair C){
/*
Draw crosshair object
Arguments:
diff --git a/crosshair.h b/crosshair.h
@@ -20,6 +20,22 @@
typedef struct Crosshair{ int pos[2], gs, as; const char* fn; } Crosshair;
/*
+ On second thought, there may not be a need for an entire crosshair
+ object. I might just need an integer array to encapsulate all the
+ information that I need. Of course this would mean that the spritesheet
+ file information will not be included but I may just draw it out with
+ SDL functions.
+ The five indicies of the "Xhair" data are:
+ 0 ... x position
+ 1 ... y position
+ 2 ... state
+ 3 ... animation index
+ 4 ... radius
+*/
+typedef int Xhair[5];
+
+
+/*
Draw crosshair object
The crosshair struct should have all of the necessary information
required to draw the object so the crosshair object is the only
@@ -30,4 +46,4 @@ typedef struct Crosshair{ int pos[2], gs, as; const char* fn; } Crosshair;
This function returns an integer indicating the successfulnes of its
execution.
*/
-int drawCrosshair(const Crosshair);
+int drawCrosshair(Xhair);
diff --git a/devnotes b/devnotes
@@ -3,3 +3,11 @@ Thurs, 21st of January, 2021
- The "initBibleKG" function takes a double pointer at this time
not a big fan of this because it looks messy. May change later
TODO: implement drawing functions with SDL
+
+Fri, 22nd of January, 2021
+ - The crosshair used in the game can probably drawn using SDL's
+ drawing functions so it's probably not necessary to use a
+ spritesheet or anything like that. I kept the Crosshair struct
+ in crosshair.h just in case but I'll be using Xhair (which is
+ just int[5]) for the foreseeable future.
+ TODO: Still need to implement the SDL drawing functions