Mercurial > hg > pub > prymula > com
diff lamertetris/sources/shape.h @ 0:2787f5e749ae
INIT
author | prymula <prymula76@outlook.com> |
---|---|
date | Thu, 21 Sep 2023 22:33:57 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lamertetris/sources/shape.h Thu Sep 21 22:33:57 2023 +0200 @@ -0,0 +1,171 @@ +#include <SDL2/SDL.h> +#include <stdio.h> + +#ifndef SZLAM_H +#define SZLAM_H + +class Shape { + public: + Shape(); + SDL_Surface * createField(int w,int h, int r, int g, int b); + void setColor(int color, int *r, int *g, int*b); + char elements [7][16][4] = { + { + {1,0,0,0}, + {1,0,0,0}, + {1,0,0,0}, + {1,0,0,0}, + + {0,0,0,0}, + {0,0,0,0}, + {1,1,1,1}, + {0,0,0,0}, + + {1,0,0,0}, + {1,0,0,0}, + {1,0,0,0}, + {1,0,0,0}, + + {0,0,0,0}, + {0,0,0,0}, + {1,1,1,1}, + {0,0,0,0} + }, +{ + {1,1,0,0}, + {1,0,0,0}, + {1,0,0,0}, + {1,0,0,0}, + + {0,0,0,0}, + {1,1,1,1}, + {0,0,0,1}, + {0,0,0,0}, + + {0,1,0,0}, + {0,1,0,0}, + {0,1,0,0}, + {1,1,0,0}, + + {0,0,0,0}, + {1,0,0,0}, + {1,1,1,1}, + {0,0,0,0} + }, + + { + {1,1,0,0}, + {0,1,0,0}, + {0,1,0,0}, + {0,1,0,0}, + + {0,0,0,0}, + {0,0,0,1}, + {1,1,1,1}, + {0,0,0,0}, + + {1,0,0,0}, + {1,0,0,0}, + {1,0,0,0}, + {1,1,0,0}, + + {0,0,0,0}, + {1,1,1,1}, + {1,0,0,0}, + {0,0,0,0} + }, + +{ + {0,0,0,0}, + {1,0,0,0}, + {1,1,0,0}, + {1,0,0,0}, + + {0,0,0,0}, + {1,1,1,0}, + {0,1,0,0}, + {0,0,0,0}, + + {0,0,0,0}, + {0,1,0,0}, + {1,1,0,0}, + {0,1,0,0}, + + {0,0,0,0}, + {0,1,0,0}, + {1,1,1,0}, + {0,0,0,0} + }, + { + {0,0,0,0}, + {0,0,0,0}, + {1,1,0,0}, + {1,1,0,0}, + + {0,0,0,0}, + {0,0,0,0}, + {1,1,0,0}, + {1,1,0,0}, + + {0,0,0,0}, + {0,0,0,0}, + {1,1,0,0}, + {1,1,0,0}, + + {0,0,0,0}, + {0,0,0,0}, + {1,1,0,0}, + {1,1,0,0} + }, +{ + {0,0,0,0}, + {0,1,1,1}, + {1,1,1,0}, + {0,0,0,0}, + + {1,0,0,0}, + {1,1,0,0}, + {1,1,0,0}, + {0,1,0,0}, + + {0,0,0,0}, + {0,1,1,1}, + {1,1,1,0}, + {0,0,0,0}, + + {1,0,0,0}, + {1,1,0,0}, + {1,1,0,0}, + {0,1,0,0} + + }, +{ + {0,0,0,0}, + {1,1,1,0}, + {0,1,1,1}, + {0,0,0,0}, + + {0,1,0,0}, + {1,1,0,0}, + {1,1,0,0}, + {1,0,0,0}, + + {0,0,0,0}, + {1,1,1,0}, + {0,1,1,1}, + {0,0,0,0}, + + {0,1,0,0}, + {1,1,0,0}, + {1,1,0,0}, + {1,0,0,0} + + } + +}; + private: + SDL_Surface * createBoxMask(int width, int height); + +}; + +#endif // szlam