summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gfx.cpp9
-rw-r--r--gfx.obin9008 -> 9328 bytes
-rw-r--r--gui.cpp3
-rw-r--r--gui.obin92736 -> 92744 bytes
-rw-r--r--libgfx.abin9470 -> 9840 bytes
-rw-r--r--libgui.abin103782 -> 103790 bytes
6 files changed, 9 insertions, 3 deletions
diff --git a/gfx.cpp b/gfx.cpp
index ca597d5..1a8649e 100644
--- a/gfx.cpp
+++ b/gfx.cpp
@@ -4,6 +4,8 @@ SDL_Window *mwindowp; // main window were everything foes
SDL_DisplayMode * screenp;
SDL_Renderer * renderp;
TTF_Font * fontp;
+SDL_Surface * msurface;
+bool surface;
int maxx;
int maxy;
int initgfx(int x, int y,const char * title) {
@@ -34,6 +36,9 @@ int initgfx(int x, int y,const char * title) {
}
return 0;
}
+int surfacerender(int w, int h) {
+ msurface = SDL_CreateRGBSurface(0, w, h, 32, 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff);
+}
//two draw functions for convenience
int drawimg(int x, int y, int w, int h,SDL_Texture * tex) {
SDL_Rect r;
@@ -55,7 +60,7 @@ SDL_Texture * loadtexture(const char * file) {
SDL_Texture * ttp;
tsp = SDL_LoadBMP(file);
ttp = SDL_CreateTextureFromSurface(renderp, tsp);
- SDL_SetTextureBlendMode(ttp, SDL_BLENDMODE_ADD);
+ SDL_SetTextureBlendMode(ttp, SDL_BLENDMODE_BLEND);
SDL_FreeSurface(tsp);
return ttp;
}
@@ -98,7 +103,7 @@ int drawrect (int x, int y, int w, int h,int r, int g, int b, int a) {
rect.w = w;
rect.h = h;
SDL_SetRenderDrawColor(renderp,r,g,b,a);
- SDL_SetRenderDrawBlendMode(renderp, SDL_BLENDMODE_ADD);
+ SDL_SetRenderDrawBlendMode(renderp, SDL_BLENDMODE_BLEND);
SDL_RenderFillRect(renderp,&rect);
SDL_SetRenderDrawColor(renderp,0,0,0,255);
return 0;
diff --git a/gfx.o b/gfx.o
index 485e58e..7ff5ff5 100644
--- a/gfx.o
+++ b/gfx.o
Binary files differ
diff --git a/gui.cpp b/gui.cpp
index 30889b9..82feb94 100644
--- a/gui.cpp
+++ b/gui.cpp
@@ -63,8 +63,9 @@ int butt::press(int x, int y) {
int c = boxes.check(x, y);
if (c != -1) {
states[c] = states[c] ^ TOGGLE;
+ return 0;
}
- return 0;
+ return -1;
}
//doesn't do anything for now because just press will do the trick
int butt::unpress(int index) {
diff --git a/gui.o b/gui.o
index 7032d20..ed22f81 100644
--- a/gui.o
+++ b/gui.o
Binary files differ
diff --git a/libgfx.a b/libgfx.a
index 2964b8d..1ef166d 100644
--- a/libgfx.a
+++ b/libgfx.a
Binary files differ
diff --git a/libgui.a b/libgui.a
index 0b25307..65325c6 100644
--- a/libgui.a
+++ b/libgui.a
Binary files differ