So long...
This commit is contained in:
26
Makefile
Executable file
26
Makefile
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
NAME = so_long
|
||||||
|
CFLAGS = -Wextra -Wall -Werror
|
||||||
|
|
||||||
|
SRC = ./src/so_long.c ./src/check_map.c ./src/controllers.c ./src/extra.c ./src/flood_fill.c ./src/free_game.c ./src/ft_itoa.c ./src/map.c ./src/open_images.c ./src/put_player.c
|
||||||
|
|
||||||
|
OBJS = $(SRC:.c=.o)
|
||||||
|
GETNEXTLINE := get_next_line/*.c
|
||||||
|
MLX_LIB = minilibx/
|
||||||
|
MLX_FLAGS = -Lmlx -L/usr/lib/X11 -lXext -lX11
|
||||||
|
|
||||||
|
all: $(NAME)
|
||||||
|
|
||||||
|
$(NAME): $(OBJS)
|
||||||
|
make -C $(MLX_LIB)
|
||||||
|
$(CC) -g $(CFLAGS) $(OBJS) $(GETNEXTLINE) $(MLX_LIB)libmlx_Linux.a $(MLX_FLAGS) -o $(NAME)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(OBJS)
|
||||||
|
|
||||||
|
fclean: clean
|
||||||
|
make clean -C $(MLX_LIB); \
|
||||||
|
rm -f $(NAME)
|
||||||
|
|
||||||
|
re: fclean all
|
||||||
|
|
||||||
|
.PHONY: all clean fclean re
|
||||||
214
assets/coin.xpm
Executable file
214
assets/coin.xpm
Executable file
@@ -0,0 +1,214 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *b56bbe29a5d4451b8e9019257dd12a5c43MXd2fOmViHDy2o[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 176 2 ",
|
||||||
|
" c #0F5917",
|
||||||
|
". c #0F5918",
|
||||||
|
"X c #115D1B",
|
||||||
|
"o c #006E01",
|
||||||
|
"O c #006F08",
|
||||||
|
"+ c #007200",
|
||||||
|
"@ c #027B0D",
|
||||||
|
"# c #087A14",
|
||||||
|
"$ c #077819",
|
||||||
|
"% c #187E1E",
|
||||||
|
"& c #165D24",
|
||||||
|
"* c #196A28",
|
||||||
|
"= c #0C7625",
|
||||||
|
"- c #147823",
|
||||||
|
"; c #1A7F20",
|
||||||
|
": c #117730",
|
||||||
|
"> c #23662A",
|
||||||
|
", c #256A2C",
|
||||||
|
"< c #286E2E",
|
||||||
|
"1 c #27752E",
|
||||||
|
"2 c #2A712E",
|
||||||
|
"3 c #296E31",
|
||||||
|
"4 c #266838",
|
||||||
|
"5 c #32683D",
|
||||||
|
"6 c #2D7431",
|
||||||
|
"7 c #2D7933",
|
||||||
|
"8 c #24783B",
|
||||||
|
"9 c #307635",
|
||||||
|
"0 c #327C34",
|
||||||
|
"q c #38753E",
|
||||||
|
"w c #357C3C",
|
||||||
|
"e c #355847",
|
||||||
|
"r c #2A7B47",
|
||||||
|
"t c #397845",
|
||||||
|
"y c #3C7B4C",
|
||||||
|
"u c #3F7F53",
|
||||||
|
"i c #455859",
|
||||||
|
"p c #4B5F5B",
|
||||||
|
"a c #42764F",
|
||||||
|
"s c #427B48",
|
||||||
|
"d c #476756",
|
||||||
|
"f c #4D7F53",
|
||||||
|
"g c #527D5F",
|
||||||
|
"h c #4E5E64",
|
||||||
|
"j c #515F64",
|
||||||
|
"k c #4E6564",
|
||||||
|
"l c #526864",
|
||||||
|
"z c #5A6B6A",
|
||||||
|
"x c #587765",
|
||||||
|
"c c #58776E",
|
||||||
|
"v c #636F77",
|
||||||
|
"b c #647878",
|
||||||
|
"n c #697879",
|
||||||
|
"m c #008703",
|
||||||
|
"M c #008C02",
|
||||||
|
"N c #009701",
|
||||||
|
"B c #009B03",
|
||||||
|
"V c #01990B",
|
||||||
|
"C c #078918",
|
||||||
|
"Z c #168619",
|
||||||
|
"A c #009514",
|
||||||
|
"S c #009C13",
|
||||||
|
"D c #029C1A",
|
||||||
|
"F c #00A100",
|
||||||
|
"G c #00AD04",
|
||||||
|
"H c #03A50A",
|
||||||
|
"J c #08A709",
|
||||||
|
"K c #08AB09",
|
||||||
|
"L c #00B300",
|
||||||
|
"P c #01BA04",
|
||||||
|
"I c #01A317",
|
||||||
|
"U c #00AF10",
|
||||||
|
"Y c #098B26",
|
||||||
|
"T c #19832B",
|
||||||
|
"R c #119C2E",
|
||||||
|
"E c #198D3B",
|
||||||
|
"W c #368236",
|
||||||
|
"Q c #398637",
|
||||||
|
"! c #3A8837",
|
||||||
|
"~ c #378538",
|
||||||
|
"^ c #398639",
|
||||||
|
"/ c #3B8938",
|
||||||
|
"( c #06BE21",
|
||||||
|
") c #418D3E",
|
||||||
|
"_ c #00C403",
|
||||||
|
"` c #00CC02",
|
||||||
|
"' c #00C009",
|
||||||
|
"] c #03CC0F",
|
||||||
|
"[ c #00D101",
|
||||||
|
"{ c #00D803",
|
||||||
|
"} c #05C514",
|
||||||
|
"| c #00D211",
|
||||||
|
" . c #00D31C",
|
||||||
|
".. c #00E401",
|
||||||
|
"X. c #00EA00",
|
||||||
|
"o. c #00E608",
|
||||||
|
"O. c #00ED0C",
|
||||||
|
"+. c #00F20C",
|
||||||
|
"@. c #00E813",
|
||||||
|
"#. c #00E01C",
|
||||||
|
"$. c #01EE1C",
|
||||||
|
"%. c #00CC2E",
|
||||||
|
"&. c #12DB24",
|
||||||
|
"*. c #18C439",
|
||||||
|
"=. c #00D632",
|
||||||
|
"-. c #10E23F",
|
||||||
|
";. c #00F730",
|
||||||
|
":. c #398143",
|
||||||
|
">. c #3A8946",
|
||||||
|
",. c #38864A",
|
||||||
|
"<. c #3C924A",
|
||||||
|
"1. c #3D8650",
|
||||||
|
"2. c #438E43",
|
||||||
|
"3. c #44844A",
|
||||||
|
"4. c #4B844E",
|
||||||
|
"5. c #458B4A",
|
||||||
|
"6. c #4A8A4F",
|
||||||
|
"7. c #459045",
|
||||||
|
"8. c #47934A",
|
||||||
|
"9. c #4B944D",
|
||||||
|
"0. c #478556",
|
||||||
|
"q. c #478C50",
|
||||||
|
"w. c #518C54",
|
||||||
|
"e. c #419053",
|
||||||
|
"r. c #4B9351",
|
||||||
|
"t. c #56985A",
|
||||||
|
"y. c #5E876A",
|
||||||
|
"u. c #549664",
|
||||||
|
"i. c #569B65",
|
||||||
|
"p. c #599867",
|
||||||
|
"a. c #5F9E76",
|
||||||
|
"s. c #629767",
|
||||||
|
"d. c #679B6C",
|
||||||
|
"f. c #6A8F79",
|
||||||
|
"g. c #5DA06C",
|
||||||
|
"h. c #03F648",
|
||||||
|
"j. c #1EEF52",
|
||||||
|
"k. c #01FB57",
|
||||||
|
"l. c #1DF155",
|
||||||
|
"z. c #1DF15B",
|
||||||
|
"x. c #20ED58",
|
||||||
|
"c. c #3DC669",
|
||||||
|
"v. c #10F96B",
|
||||||
|
"b. c #24F56A",
|
||||||
|
"n. c #2FE871",
|
||||||
|
"m. c #6E6D85",
|
||||||
|
"M. c #706E84",
|
||||||
|
"N. c #677180",
|
||||||
|
"B. c #697082",
|
||||||
|
"V. c #778488",
|
||||||
|
"C. c #77848A",
|
||||||
|
"Z. c #60A282",
|
||||||
|
"A. c #72AC88",
|
||||||
|
"S. c #7CB995",
|
||||||
|
"D. c #36F180",
|
||||||
|
"F. c #63D391",
|
||||||
|
"G. c #76DE9E",
|
||||||
|
"H. c #5CF89F",
|
||||||
|
"J. c #69F49C",
|
||||||
|
"K. c #6FEEA4",
|
||||||
|
"L. c #7CFBB3",
|
||||||
|
"P. c #84BB8F",
|
||||||
|
"I. c #96BFAF",
|
||||||
|
"U. c #80DDA4",
|
||||||
|
"Y. c #9DC3B6",
|
||||||
|
"T. c #AED5BD",
|
||||||
|
"R. c #86FCBE",
|
||||||
|
"E. c #91FABB",
|
||||||
|
"W. c #BFDFD4",
|
||||||
|
"Q. c #96FDC4",
|
||||||
|
"!. c #9CFCC5",
|
||||||
|
"~. c #ADE1C8",
|
||||||
|
"^. c #A0FCC7",
|
||||||
|
"/. c #A3F0C9",
|
||||||
|
"(. c #B0F0D1",
|
||||||
|
"). c #C3DFD6",
|
||||||
|
/* pixels */
|
||||||
|
"> > > 2 W / / ! W , > > > , W ! / / W 2 > > > , 0 / / / / 6 > > ",
|
||||||
|
"< < < 6 Q / / / W 6 , , > , W ! / / W 2 > , , 3 0 / / / Q 9 < < ",
|
||||||
|
"W W W W / / / / ^ W W 6 > , 0 ! / / W 2 > < 0 W Q / / / / Q W W ",
|
||||||
|
"/ / / / / / / / / / ^ 9 3 6 ^ / / / Q 6 , 6 Q / / / / / / / / / ",
|
||||||
|
"/ / / / / / / / / / ! ^ s a 4.2./ / Q 9 6 9 Q / / / / / / / / / ",
|
||||||
|
"/ / / / / / / / / / / 4.x e 4 >.8./ / Q Q Q / / / / / / / / / / ",
|
||||||
|
"/ / / / / / Q ~ ^ 5.f z V.Z.E - <.8./ / / ^ ~ ~ ~ W W ^ / / / / ",
|
||||||
|
"/ / / / / Q 9 9 4.y.v V.I.G.*.V T e.7./ / W 6 < < < 6 ~ / / / / ",
|
||||||
|
"! / ! ! / Q 9 y f.n V.Y.(.J.&._ A 8 >.9.9.^ , > > > 2 ~ / ! / / ",
|
||||||
|
"9 0 9 0 Q ^ w g n c S./.R.n.} _ H $ * r.P.9.6 6 , > 2 ~ Q 0 9 0 ",
|
||||||
|
", , , 6 W Q q l z a.F.H.b.( M N m @ = 4 A.t.Q ~ 6 > < W Q 6 , , ",
|
||||||
|
", > > < W ^ t i l S.K.b.$.` N + M H C & p.t.) Q 6 , 2 W Q 6 > > ",
|
||||||
|
"9 < > 2 ~ / 3.p v T.E.l.O...L o N _ A X q.r./ Q W 0 W ^ Q 6 > > ",
|
||||||
|
"^ 6 > 3 ~ / 4.p n ).!.j.O.X.L + F ` V X 5.2./ / ! ! / / ^ 6 > > ",
|
||||||
|
"Q 9 2 7 ^ ) w.j M.).Q.l.+...L + F ` B 3.^ Q / / / / / Q 9 6 3 ",
|
||||||
|
"/ Q Q Q / ) w.h m.).!.l.+.X.L o F ` B y w Q / / / / / / Q Q Q ",
|
||||||
|
"/ / / / / 2.t.k B.).^.x.+.X.L o F [ B . y w ~ / / / / / / / / / ",
|
||||||
|
"/ / / / ! 7.s.k N.).!.z.O.X.L o F [ B X u w Q / / / / / / / / / ",
|
||||||
|
"/ / / / ! 7.d.k v W.!.z.+.X.L + F ` B X 0.w ~ / / / / / / / / / ",
|
||||||
|
"^ W W W Q 2.p.d b ~.L.z.$...G o B ` V * 0.:.Q / / / / / / W W 0 ",
|
||||||
|
"Q 6 , 2 W ) w.d x U.D.v.h. .S O N ' D 1 u.2.! / / / / / Q 7 , , ",
|
||||||
|
"~ 6 > < W / 5.d y c.-.h.k.=.A D B V Y 6 p.7.! / Q ^ ^ / Q 6 > > ",
|
||||||
|
"7 , > 2 W ^ t a 8 R ] @.;.#.U %.I @ : 1.g.7.! Q 9 6 9 Q ^ 6 > > ",
|
||||||
|
"> > > 2 W Q 9 3 , ; K [ o...{ | I = r i.9./ / Q 6 , < W Q 6 > > ",
|
||||||
|
", , , 6 ~ Q 6 > , 7 Z J [ ....P Z ,.i.r./ Q ~ W 2 > < W Q 9 < , ",
|
||||||
|
"W W W W / ^ 6 > > , , % J ` P Z >.p.r./ Q 0 2 , , > < ~ / Q W W ",
|
||||||
|
"/ / / / / ^ 6 > > > , 7 T # - :.i.9./ / ! 0 , > > > 3 ~ / / / / ",
|
||||||
|
"/ / / / / Q 0 6 6 6 6 w w > 5 6.7./ / / / W 6 6 6 6 9 Q / / / / ",
|
||||||
|
"/ / / / / / Q Q Q Q Q / / W ^ / / / / / / / Q Q Q Q Q / / / / / ",
|
||||||
|
"/ / / / / / / / / / / ^ ~ ~ ! / / / / Q ~ Q / / / / / / / / / / ",
|
||||||
|
"/ / / / / / / / / / / 0 6 6 W / / / Q 6 2 6 Q / / / / / / / / / ",
|
||||||
|
"/ / / / / / / / / / / 7 , , 0 ! / / W 2 > 6 ^ / / / / / / / / / "
|
||||||
|
};
|
||||||
264
assets/dirt.xpm
Executable file
264
assets/dirt.xpm
Executable file
@@ -0,0 +1,264 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *_eb1e2b557dd4636e9a9486f8f810299WjAS3xDwT9wvpzWl[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 226 2 ",
|
||||||
|
" c #226629",
|
||||||
|
". c #216529",
|
||||||
|
"X c #276D2C",
|
||||||
|
"o c #3A8838",
|
||||||
|
"O c #3B8938",
|
||||||
|
"+ c #388536",
|
||||||
|
"@ c #24682A",
|
||||||
|
"# c #226529",
|
||||||
|
"$ c #23682A",
|
||||||
|
"% c #378436",
|
||||||
|
"& c #3B8838",
|
||||||
|
"* c #286E2D",
|
||||||
|
"= c #21622B",
|
||||||
|
"- c #347F38",
|
||||||
|
"; c #3C8B39",
|
||||||
|
": c #3D8D3A",
|
||||||
|
"> c #2E7835",
|
||||||
|
", c #216329",
|
||||||
|
"< c #25662E",
|
||||||
|
"1 c #256A2C",
|
||||||
|
"2 c #24662E",
|
||||||
|
"3 c #296C31",
|
||||||
|
"4 c #388437",
|
||||||
|
"5 c #26692F",
|
||||||
|
"6 c #23692A",
|
||||||
|
"7 c #25682F",
|
||||||
|
"8 c #25672D",
|
||||||
|
"9 c #348038",
|
||||||
|
"0 c #3B8A38",
|
||||||
|
"q c #2F7632",
|
||||||
|
"w c #25682D",
|
||||||
|
"e c #398638",
|
||||||
|
"r c #3A8737",
|
||||||
|
"t c #3A8738",
|
||||||
|
"y c #3A8638",
|
||||||
|
"u c #3B8939",
|
||||||
|
"i c #307B34",
|
||||||
|
"p c #286E2C",
|
||||||
|
"a c #216429",
|
||||||
|
"s c #296E31",
|
||||||
|
"d c #3B8B3A",
|
||||||
|
"f c #398637",
|
||||||
|
"g c #3A8837",
|
||||||
|
"h c #2F7635",
|
||||||
|
"j c #216229",
|
||||||
|
"k c #23662A",
|
||||||
|
"l c #378336",
|
||||||
|
"z c #276C2D",
|
||||||
|
"x c #206328",
|
||||||
|
"c c #276A2F",
|
||||||
|
"v c #358035",
|
||||||
|
"b c #2F7831",
|
||||||
|
"n c #2F7533",
|
||||||
|
"m c #398538",
|
||||||
|
"M c #317835",
|
||||||
|
"N c #2E7731",
|
||||||
|
"B c #317935",
|
||||||
|
"V c #3C8A38",
|
||||||
|
"C c #3A8839",
|
||||||
|
"Z c #3B8C3B",
|
||||||
|
"A c #398738",
|
||||||
|
"S c #398737",
|
||||||
|
"D c #2D7333",
|
||||||
|
"F c #256B2B",
|
||||||
|
"G c #266C2C",
|
||||||
|
"H c #24692B",
|
||||||
|
"J c #2F7633",
|
||||||
|
"K c #368339",
|
||||||
|
"L c #25692E",
|
||||||
|
"P c #256A2B",
|
||||||
|
"I c #286D2F",
|
||||||
|
"U c #3C8C3A",
|
||||||
|
"Y c #3C8A39",
|
||||||
|
"T c #2C7431",
|
||||||
|
"R c #206229",
|
||||||
|
"E c #2F7836",
|
||||||
|
"W c #3C8D3A",
|
||||||
|
"Q c #3C8C39",
|
||||||
|
"! c #358138",
|
||||||
|
"~ c #21612B",
|
||||||
|
"^ c #266B2F",
|
||||||
|
"/ c #3C8D3C",
|
||||||
|
"( c #317B32",
|
||||||
|
") c #338136",
|
||||||
|
"_ c #337D33",
|
||||||
|
"` c #2D7535",
|
||||||
|
"' c #2C7434",
|
||||||
|
"] c #2B7031",
|
||||||
|
"[ c #337C36",
|
||||||
|
"{ c #327935",
|
||||||
|
"} c #317C33",
|
||||||
|
"| c #398537",
|
||||||
|
" . c #2C7330",
|
||||||
|
".. c #2B7032",
|
||||||
|
"X. c #3A8938",
|
||||||
|
"o. c #357E36",
|
||||||
|
"O. c #327D35",
|
||||||
|
"+. c #328035",
|
||||||
|
"@. c #26682F",
|
||||||
|
"#. c #2C742F",
|
||||||
|
"$. c #216528",
|
||||||
|
"%. c #3A893A",
|
||||||
|
"&. c #25682C",
|
||||||
|
"*. c #21632B",
|
||||||
|
"=. c #358137",
|
||||||
|
"-. c #3D8E3B",
|
||||||
|
";. c #2B7432",
|
||||||
|
":. c #216428",
|
||||||
|
">. c #266C2B",
|
||||||
|
",. c #2C7331",
|
||||||
|
"<. c #22622C",
|
||||||
|
"1. c #2C7131",
|
||||||
|
"2. c #22652A",
|
||||||
|
"3. c #25672E",
|
||||||
|
"4. c #26682E",
|
||||||
|
"5. c #22632B",
|
||||||
|
"6. c #22652B",
|
||||||
|
"7. c #226129",
|
||||||
|
"8. c #378338",
|
||||||
|
"9. c #2A6F31",
|
||||||
|
"0. c #26692E",
|
||||||
|
"q. c #2D762F",
|
||||||
|
"w. c #368238",
|
||||||
|
"e. c #29702E",
|
||||||
|
"r. c #388337",
|
||||||
|
"t. c #368135",
|
||||||
|
"y. c #368136",
|
||||||
|
"u. c #368036",
|
||||||
|
"i. c #367F34",
|
||||||
|
"p. c #3A8537",
|
||||||
|
"a. c #388436",
|
||||||
|
"s. c #368235",
|
||||||
|
"d. c #368137",
|
||||||
|
"f. c #2D7632",
|
||||||
|
"g. c #22642A",
|
||||||
|
"h. c #296F32",
|
||||||
|
"j. c #266A30",
|
||||||
|
"k. c #3C8D3B",
|
||||||
|
"l. c #2E7631",
|
||||||
|
"z. c #296F2D",
|
||||||
|
"x. c #2C7034",
|
||||||
|
"c. c #3B8A39",
|
||||||
|
"v. c #378237",
|
||||||
|
"b. c #358439",
|
||||||
|
"n. c #348034",
|
||||||
|
"m. c #368138",
|
||||||
|
"M. c #358337",
|
||||||
|
"N. c #358134",
|
||||||
|
"B. c #307734",
|
||||||
|
"V. c #296F2E",
|
||||||
|
"C. c #296C30",
|
||||||
|
"Z. c #2E7532",
|
||||||
|
"A. c #23642C",
|
||||||
|
"S. c #388438",
|
||||||
|
"D. c #286E30",
|
||||||
|
"F. c #286B30",
|
||||||
|
"G. c #307C33",
|
||||||
|
"H. c #24682B",
|
||||||
|
"J. c #398A3A",
|
||||||
|
"K. c #286F2D",
|
||||||
|
"L. c #286E2E",
|
||||||
|
"P. c #2F7735",
|
||||||
|
"I. c #21632A",
|
||||||
|
"U. c #297130",
|
||||||
|
"Y. c #3C8E3B",
|
||||||
|
"T. c #2F7731",
|
||||||
|
"R. c #23672A",
|
||||||
|
"E. c #378739",
|
||||||
|
"W. c #388439",
|
||||||
|
"Q. c #266B2D",
|
||||||
|
"!. c #2B6F32",
|
||||||
|
"~. c #266B2C",
|
||||||
|
"^. c #38883A",
|
||||||
|
"/. c #296D30",
|
||||||
|
"(. c #2D7232",
|
||||||
|
"). c #3D903C",
|
||||||
|
"_. c #2A732F",
|
||||||
|
"`. c #2E7831",
|
||||||
|
"'. c #2E7838",
|
||||||
|
"]. c #266D2D",
|
||||||
|
"[. c #2C7532",
|
||||||
|
"{. c #2E7535",
|
||||||
|
"}. c #2D7731",
|
||||||
|
"|. c #2D7733",
|
||||||
|
" X c #2D7534",
|
||||||
|
".X c #307634",
|
||||||
|
"XX c #25692B",
|
||||||
|
"oX c #2A702F",
|
||||||
|
"OX c #266A2C",
|
||||||
|
"+X c #2D7430",
|
||||||
|
"@X c #24672D",
|
||||||
|
"#X c #24662D",
|
||||||
|
"$X c #24652D",
|
||||||
|
"%X c #256C2C",
|
||||||
|
"&X c #388939",
|
||||||
|
"*X c #25662D",
|
||||||
|
"=X c #358036",
|
||||||
|
"-X c #3A8A3B",
|
||||||
|
";X c #3A8B3A",
|
||||||
|
":X c #2B7430",
|
||||||
|
">X c #2E7433",
|
||||||
|
",X c #2D7533",
|
||||||
|
"<X c #226729",
|
||||||
|
"1X c #246A2B",
|
||||||
|
"2X c #23672B",
|
||||||
|
"3X c #347E36",
|
||||||
|
"4X c #2C7233",
|
||||||
|
"5X c #206329",
|
||||||
|
"6X c #347F34",
|
||||||
|
"7X c #21642A",
|
||||||
|
"8X c #256731",
|
||||||
|
"9X c #337A35",
|
||||||
|
"0X c #2D7332",
|
||||||
|
"qX c #2D7531",
|
||||||
|
"wX c #347D36",
|
||||||
|
"eX c #2F7634",
|
||||||
|
"rX c #3B8D3C",
|
||||||
|
"tX c #317A36",
|
||||||
|
"yX c #256B2D",
|
||||||
|
"uX c #2A6E32",
|
||||||
|
"iX c #256B2C",
|
||||||
|
"pX c #2B7030",
|
||||||
|
"aX c #307C34",
|
||||||
|
"sX c #296F31",
|
||||||
|
"dX c #3C8E3C",
|
||||||
|
"fX c white",
|
||||||
|
/* pixels */
|
||||||
|
" . X o O O O + @ # $ % O O O & * # = - ; O O : > , ",
|
||||||
|
"< 1 2 3 o O O O 4 5 < @ $ % O O O & * . 6 7 8 9 ; O O 0 q 8 w ",
|
||||||
|
"e r e t O O O O O y u i . $ % O O O & p a s d f o O O O O g r r ",
|
||||||
|
"O O O O O O O O O O ; h j k l O O O & z x c O O O O O O O O O O ",
|
||||||
|
"O O O O O O O O O O O v b n m O O O O M N B O O O O O O O O O O ",
|
||||||
|
"O O O O O O O O O O O O V V O O O O O 0 V 0 O O O O O O O O O O ",
|
||||||
|
"O O O O O O C Z o Z f g O O O O O O O O O t Z o Z A S O O O O O ",
|
||||||
|
"O O O O O 0 D 1 F G H J 0 O O O O O O O V K L F G P I t O O O O ",
|
||||||
|
"V U Y 0 O Y T a a R E W O V Y Q V V O V ! ~ a # . ^ / O 0 ; ; ",
|
||||||
|
"( ) ( _ & W ` a H ' ] [ 0 o { } ) ( ( | 0 l ...F . X X.O o.O.+.",
|
||||||
|
" # . @.o O #.$.2 %.0 O O r &.. *.=.V O O -.;.:.>.g 0 ,.a # ",
|
||||||
|
"<. # X o 0 1.2.3.| O O O r 4.5.5.6.7.8.Y O O 0 9.# 0.t 0 q.. ",
|
||||||
|
"w.e.$.X o O r.t.y.& O O O & y.u.u.y.i.p.O O O O a.s.d.& ; f.a g.",
|
||||||
|
"-.h.x j.k.O O 0 0 O O 0 ; V 0 0 0 0 0 V ; 0 O O O 0 0 O U ` , ~ ",
|
||||||
|
"O l.z.x.c.O O O O O O v.b.n.r O O O & m.M.N.O O O O O O O B.V.C.",
|
||||||
|
"O O O O O O O O O O V Z.a A.S.O O O k.D.a F.O O O O O O O O O O ",
|
||||||
|
"O O O O O O O O O O ; G.. H.J.O O O c.K.$.L.O O O O O O O O O O ",
|
||||||
|
"O O O O O O O O O O ; P.I.$ % O O O & p :.U.Y.O O O O O O O O O ",
|
||||||
|
"O O 0 0 O O O O O O V T.a R.% O O O & p :.F.O O O O O O O O V 0 ",
|
||||||
|
"O v.E.W.& O O O O O 0 M Q.c r.O O O & !.~...O O O O O O O S.^.s.",
|
||||||
|
"O /.2.c o O O O O O O & o o O O O O O o o o O O O O O O 0 (.2.<.",
|
||||||
|
")._.$.X o O O U U O O O O O ; U U W W O O O O O O U ; O ; `.. g.",
|
||||||
|
"'.].. X o O M [.{.y O O O t {.}.}.|. Xa.O O O O .Xf.h t U {.a ",
|
||||||
|
", # . X o 0 .:.H.f O O O r XX:.$.a a N.0 O O 0 oXx OXr 0 +X. ",
|
||||||
|
"@X#X$XC.o O #.$.%X&X+ S O t c $XXX#X*X=X0 t -X;X:X$.G g 0 >X$X@X",
|
||||||
|
"f f f e O U ,Xa <X1X2Xn V O e | f f f o V 3X@X1X$ G o O t f f ",
|
||||||
|
"O O O O O ; 4XR a a 5XE W O O O O O O O V 6X7XI.. , 8X/ O O O O ",
|
||||||
|
"O O O O O O 9X0X0X0XqXwX0 O O O O O O O 0 v.0X0Xl.(.eX& O O O O ",
|
||||||
|
"O O O O O O 0 V V V V 0 O O O O O O O O O O V V 0 V 0 O O O O O ",
|
||||||
|
"O O O O O O O O O O O o rXg O O O O O u Z g O O O O O O O O O O ",
|
||||||
|
"O O O O O O O O O O ; tXyXQ.4 O O O & uXiXpXO O O O O O O O O O ",
|
||||||
|
"O O O O O O O O O O U aX$.A.l O O O & p :.sXdXO O O O O O O O O "
|
||||||
|
};
|
||||||
232
assets/door.xpm
Executable file
232
assets/door.xpm
Executable file
@@ -0,0 +1,232 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *_4ba6b2ebbb84cfbe1d9f4e35a1ffd26JvpIrceUYDT10zkE[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 194 2 ",
|
||||||
|
" c #251725",
|
||||||
|
". c #2B1526",
|
||||||
|
"X c #2B1A25",
|
||||||
|
"o c #2B192B",
|
||||||
|
"O c #351726",
|
||||||
|
"+ c #341B2C",
|
||||||
|
"@ c #3B1A2D",
|
||||||
|
"# c #2F1E32",
|
||||||
|
"$ c #331D31",
|
||||||
|
"% c #3B1F30",
|
||||||
|
"& c #2A2B2A",
|
||||||
|
"* c #31202E",
|
||||||
|
"= c #332134",
|
||||||
|
"- c #3A2336",
|
||||||
|
"; c #372539",
|
||||||
|
": c #3B263C",
|
||||||
|
"> c #3D283D",
|
||||||
|
", c #3D333B",
|
||||||
|
"< c #421C2F",
|
||||||
|
"1 c #44252C",
|
||||||
|
"2 c #52242D",
|
||||||
|
"3 c #483728",
|
||||||
|
"4 c #50332A",
|
||||||
|
"5 c #4D2333",
|
||||||
|
"6 c #4E233A",
|
||||||
|
"7 c #472939",
|
||||||
|
"8 c #522234",
|
||||||
|
"9 c #5A2633",
|
||||||
|
"0 c #512A37",
|
||||||
|
"q c #5D2E32",
|
||||||
|
"w c #542439",
|
||||||
|
"e c #57293C",
|
||||||
|
"r c #5C2A3A",
|
||||||
|
"t c #5C3133",
|
||||||
|
"y c #602C2F",
|
||||||
|
"u c #632D35",
|
||||||
|
"i c #632B39",
|
||||||
|
"p c #6C2D3D",
|
||||||
|
"a c #663139",
|
||||||
|
"s c #6B313B",
|
||||||
|
"d c #693839",
|
||||||
|
"f c #75323D",
|
||||||
|
"g c #7A363E",
|
||||||
|
"h c #7A3C3B",
|
||||||
|
"j c #1F5A26",
|
||||||
|
"k c #234D23",
|
||||||
|
"l c #265728",
|
||||||
|
"z c #355227",
|
||||||
|
"x c #395529",
|
||||||
|
"c c #3D593C",
|
||||||
|
"v c #23662A",
|
||||||
|
"b c #2C612B",
|
||||||
|
"n c #266A2C",
|
||||||
|
"m c #296D2E",
|
||||||
|
"M c #29702E",
|
||||||
|
"N c #2A6F30",
|
||||||
|
"B c #366D39",
|
||||||
|
"V c #2D7531",
|
||||||
|
"C c #2F7832",
|
||||||
|
"Z c #327C34",
|
||||||
|
"A c #3A723B",
|
||||||
|
"S c #56452B",
|
||||||
|
"D c #40543E",
|
||||||
|
"F c #7C5337",
|
||||||
|
"G c #40743C",
|
||||||
|
"H c #432843",
|
||||||
|
"J c #4B2D4A",
|
||||||
|
"K c #4E324E",
|
||||||
|
"L c #53324D",
|
||||||
|
"P c #5D314B",
|
||||||
|
"I c #543654",
|
||||||
|
"U c #563856",
|
||||||
|
"Y c #5D3C53",
|
||||||
|
"T c #5D3C5D",
|
||||||
|
"R c #6A3E4C",
|
||||||
|
"E c #7D3640",
|
||||||
|
"W c #7A3A44",
|
||||||
|
"Q c #6B3D52",
|
||||||
|
"! c #613E5E",
|
||||||
|
"~ c #613E60",
|
||||||
|
"^ c #4A4543",
|
||||||
|
"/ c #564E4B",
|
||||||
|
"( c #465F41",
|
||||||
|
") c #5D5553",
|
||||||
|
"_ c #6B424E",
|
||||||
|
"` c #624455",
|
||||||
|
"' c #65435E",
|
||||||
|
"] c #754B59",
|
||||||
|
"[ c #7A4958",
|
||||||
|
"{ c #605656",
|
||||||
|
"} c #625957",
|
||||||
|
"| c #6E505E",
|
||||||
|
" . c #635958",
|
||||||
|
".. c #7A555F",
|
||||||
|
"X. c #4C6446",
|
||||||
|
"o. c #4C6843",
|
||||||
|
"O. c #4F6648",
|
||||||
|
"+. c #506548",
|
||||||
|
"@. c #536C4A",
|
||||||
|
"#. c #4F7649",
|
||||||
|
"$. c #57714C",
|
||||||
|
"%. c #58704D",
|
||||||
|
"&. c #5E7C53",
|
||||||
|
"*. c #647B58",
|
||||||
|
"=. c #664261",
|
||||||
|
"-. c #664862",
|
||||||
|
";. c #6B4A65",
|
||||||
|
":. c #784E66",
|
||||||
|
">. c #755466",
|
||||||
|
",. c #7C566A",
|
||||||
|
"<. c #7C5969",
|
||||||
|
"1. c #7E5D71",
|
||||||
|
"2. c #7B6967",
|
||||||
|
"3. c #833A3F",
|
||||||
|
"4. c #8B413F",
|
||||||
|
"5. c #87493D",
|
||||||
|
"6. c #954C3F",
|
||||||
|
"7. c #855039",
|
||||||
|
"8. c #9E563F",
|
||||||
|
"9. c #965A3E",
|
||||||
|
"0. c #853742",
|
||||||
|
"q. c #843A41",
|
||||||
|
"w. c #8D3D42",
|
||||||
|
"e. c #923E42",
|
||||||
|
"r. c #864447",
|
||||||
|
"t. c #8A4244",
|
||||||
|
"y. c #8C4148",
|
||||||
|
"u. c #944143",
|
||||||
|
"i. c #9B4443",
|
||||||
|
"p. c #944C42",
|
||||||
|
"a. c #994947",
|
||||||
|
"s. c #954B4B",
|
||||||
|
"d. c #9A5741",
|
||||||
|
"f. c #8E4C54",
|
||||||
|
"g. c #89565D",
|
||||||
|
"h. c #94595D",
|
||||||
|
"j. c #945A5E",
|
||||||
|
"k. c #A14A42",
|
||||||
|
"l. c #A14948",
|
||||||
|
"z. c #A25D43",
|
||||||
|
"x. c #A76345",
|
||||||
|
"c. c #A46D5E",
|
||||||
|
"v. c #875A69",
|
||||||
|
"b. c #945F64",
|
||||||
|
"n. c #84676C",
|
||||||
|
"m. c #9D6061",
|
||||||
|
"M. c #8B6876",
|
||||||
|
"N. c #8F6C75",
|
||||||
|
"B. c #956B73",
|
||||||
|
"V. c #996E73",
|
||||||
|
"C. c #9A7174",
|
||||||
|
"Z. c #9B767B",
|
||||||
|
"A. c #9C7A7B",
|
||||||
|
"S. c #A26361",
|
||||||
|
"D. c #A37A7B",
|
||||||
|
"F. c #368335",
|
||||||
|
"G. c #398637",
|
||||||
|
"H. c #3A8937",
|
||||||
|
"J. c #378638",
|
||||||
|
"K. c #3C8339",
|
||||||
|
"L. c #3B8938",
|
||||||
|
"P. c #40863B",
|
||||||
|
"I. c #42893D",
|
||||||
|
"U. c #448340",
|
||||||
|
"Y. c #698A5A",
|
||||||
|
"T. c #708A5E",
|
||||||
|
"R. c #6F8160",
|
||||||
|
"E. c #7A8D65",
|
||||||
|
"W. c #828B6E",
|
||||||
|
"Q. c #958D76",
|
||||||
|
"!. c #998E7A",
|
||||||
|
"~. c #8E9277",
|
||||||
|
"^. c #98957E",
|
||||||
|
"/. c #9E7F81",
|
||||||
|
"(. c #A37E81",
|
||||||
|
"). c #A58283",
|
||||||
|
"_. c #AB8988",
|
||||||
|
"`. c #B18A84",
|
||||||
|
"'. c #B98D85",
|
||||||
|
"]. c #B28E89",
|
||||||
|
"[. c #B09087",
|
||||||
|
"{. c #B3938C",
|
||||||
|
"}. c #B59691",
|
||||||
|
"|. c #BA9A92",
|
||||||
|
" X c #9AA684",
|
||||||
|
".X c #B5A394",
|
||||||
|
"XX c #BFA79F",
|
||||||
|
"oX c #BFA89F",
|
||||||
|
"OX c #BFA7A0",
|
||||||
|
"+X c #C0A79F",
|
||||||
|
"@X c #C4AFA1",
|
||||||
|
"#X c #CDB6A8",
|
||||||
|
"$X c #D0B9AB",
|
||||||
|
"%X c #D0BAAC",
|
||||||
|
/* pixels */
|
||||||
|
"v v v M F.L.L.H.F.n B #.W.^. X X X X X~.R.B v n Z L.L.L.L.V v v ",
|
||||||
|
"m m m V G.L.L.L.U.Y.^..X#X%X%X%X%X%X$X#X@X^.*.A Z L.L.L.G.Z m m ",
|
||||||
|
"F.F.F.F.L.H.I.T.!.{.|.OXOXoXOX+X+X+X+XoXXX+X|.!.T.I.H.L.L.G.F.F.",
|
||||||
|
"L.L.L.L.L.I.E.[.{._.N.;.' -.;.;.;.;.;.;.;.1.).].[.E.I.L.L.L.L.L.",
|
||||||
|
"L.L.L.L.L.E.[._.N.;.T T I T T T T T T T T T ' ,._.[.Y.H.L.L.L.L.",
|
||||||
|
"L.L.L.L.I.Q.).,.! T I ; $ = = = = = = = : T T ! >._.T.H.L.L.L.L.",
|
||||||
|
"L.L.L.L.I.2.;.! T K $ O . < < @ @ @ @ . + : T T ! >.&.H.L.L.L.L.",
|
||||||
|
"L.L.L.L.P.} ! T I $ i E p e.e.f E q.q.i g 5 > T T ' X.F.L.L.L.L.",
|
||||||
|
"H.L.H.H.K.} ~ T : 5 y.y.W s.s.W y.l.a.W s.E % K ! =.X.F.L.H.L.L.",
|
||||||
|
"Z Z Z Z K./ I J = >.D.D.).`.`.).`.'.`.A.V.v.7 ; I I c F.G.Z Z Z ",
|
||||||
|
"n n n M K.) I J ; <.).].{.{._./.{.{.{.(.M.:.- ; I Y X.F.G.V n n ",
|
||||||
|
"n v v M K. .~ I = ' v.v.V.C.B.Z.C.C.C.B.v.! $ : T =.O.F.G.V v v ",
|
||||||
|
"Z m v M K. .! I @ w 6 6 e e 6 e e e 6 w 6 o ; I =.@.H.G.V v v ",
|
||||||
|
"G.V v V K. .! I o 8 q.s i q.3.i E q.g p q.g 1 : T =.$.H.G.V v v ",
|
||||||
|
"G.Z M V K. .! I o i u.w.q.i.i.g w.i.w.E i.i.9 > T =.$.H.G.Z V N ",
|
||||||
|
"L.G.G.G.K.} ! I o r w.e.t.k.i.0.u.i.e.q.i.i.9 > T =.$.H.L.G.G.G.",
|
||||||
|
"L.L.L.L.K.{ ! I o w E e.6.k.i.0.u.s.s.r.s.s.8 > T ' @.H.L.L.L.L.",
|
||||||
|
"L.L.L.L.K./ L H . i u.u.d.k.i.E y.b.B.Z.B.g.O # J L o.L.L.L.L.L.",
|
||||||
|
"L.L.L.L.P.{ T K o s i.i.z.k.i.u r.[ n./.v.[ 5 : I ! $.H.L.L.L.L.",
|
||||||
|
"G.F.F.F.K. .~ U o u w.u.z.k.u.2 5.Q | A.` Q 8 > T =.$.H.L.F.F.Z ",
|
||||||
|
"G.V n V K.} T I o a u.u.t.k.i.f p.] <.Y 2.[ 9 > T =.%.H.G.C n n ",
|
||||||
|
"J.V v M K.} U K u i.e.f i.i.3.p.j.(.N.(.f.9 > T =.@.H.G.V v v ",
|
||||||
|
"V n v M K. .! I y l.e.p E i.4.z.y...n._ w.9 > T =.+.F.G.V v v ",
|
||||||
|
"v v v M K. .! I u i.e.q.q.i.p.x.u.g r g k.q > T =.+.F.G.V v v ",
|
||||||
|
"n n n V K. .! U 9 e.w.6.i.i.4.8.3.w.f w.i.q > T =.O.F.G.Z m n ",
|
||||||
|
"F.F.F.F.K.) ! K * R j.j.c.S.m.g.c.m.S.g.b.h.0 ; T ! ( F.L.G.F.F.",
|
||||||
|
"L.L.L.L.K.^ J H - <.(.}.|.|.}.{.|.|.|.].Z.B.7 o J L c J.L.L.L.L.",
|
||||||
|
"L.L.L.L.P.) T I - ,.Z.(.].].{.}.].].].D.N.:.- : T ! +.G.L.L.L.L.",
|
||||||
|
"L.L.L.L.P. .~ I $ P Q Q ] ] ] ] ] ] ] Q Q P + > T =.$.H.L.L.L.L.",
|
||||||
|
"L.L.L.L.P. .! I o t f i t d a i s i i 5 i r + : T =.$.H.L.L.L.L.",
|
||||||
|
"L.L.L.L.K.{ ! I + F 9.h 3 S S 4 7.9.5.1 3 3 X : T ' @.H.L.L.L.L.",
|
||||||
|
"L.L.L.L.K.D : ; & z x z l l m b z x z k j v l & ; , G L.L.L.L.L."
|
||||||
|
};
|
||||||
255
assets/link-down.xpm
Executable file
255
assets/link-down.xpm
Executable file
@@ -0,0 +1,255 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *xpm_[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 217 2 ",
|
||||||
|
" c #15170B",
|
||||||
|
". c #131D11",
|
||||||
|
"X c #2D1B0B",
|
||||||
|
"o c #251E14",
|
||||||
|
"O c #11250E",
|
||||||
|
"+ c #14350E",
|
||||||
|
"@ c #192816",
|
||||||
|
"# c #192A16",
|
||||||
|
"$ c #1A3415",
|
||||||
|
"% c #193717",
|
||||||
|
"& c #262917",
|
||||||
|
"* c #352A19",
|
||||||
|
"= c #2C311D",
|
||||||
|
"- c #25381B",
|
||||||
|
"; c #3B3C1C",
|
||||||
|
": c #1A3723",
|
||||||
|
"> c #2B3726",
|
||||||
|
", c #2D392E",
|
||||||
|
"< c #363626",
|
||||||
|
"1 c #513C14",
|
||||||
|
"2 c #493B26",
|
||||||
|
"3 c #5A3E2E",
|
||||||
|
"4 c #603E2D",
|
||||||
|
"5 c #17440E",
|
||||||
|
"6 c #194819",
|
||||||
|
"7 c #28431B",
|
||||||
|
"8 c #27521A",
|
||||||
|
"9 c #35521D",
|
||||||
|
"0 c #236F14",
|
||||||
|
"q c #386718",
|
||||||
|
"w c #23781C",
|
||||||
|
"e c #367717",
|
||||||
|
"r c #194823",
|
||||||
|
"t c #1F5522",
|
||||||
|
"y c #294827",
|
||||||
|
"u c #33452A",
|
||||||
|
"i c #285628",
|
||||||
|
"p c #385928",
|
||||||
|
"a c #375A34",
|
||||||
|
"s c #1E7722",
|
||||||
|
"d c #2B6527",
|
||||||
|
"f c #23652A",
|
||||||
|
"g c #266B2D",
|
||||||
|
"h c #2A6C2D",
|
||||||
|
"j c #366A2A",
|
||||||
|
"k c #24712D",
|
||||||
|
"l c #2B732D",
|
||||||
|
"z c #387D27",
|
||||||
|
"x c #32732F",
|
||||||
|
"c c #2C6434",
|
||||||
|
"v c #2B6D31",
|
||||||
|
"b c #376936",
|
||||||
|
"n c #2D7532",
|
||||||
|
"m c #2D7736",
|
||||||
|
"M c #347233",
|
||||||
|
"N c #337B34",
|
||||||
|
"B c #3B7C35",
|
||||||
|
"V c #387539",
|
||||||
|
"C c #51511A",
|
||||||
|
"Z c #6B5214",
|
||||||
|
"A c #497B19",
|
||||||
|
"S c #4D4827",
|
||||||
|
"D c #594A29",
|
||||||
|
"F c #58522B",
|
||||||
|
"G c #464A3A",
|
||||||
|
"H c #584A3A",
|
||||||
|
"J c #455438",
|
||||||
|
"K c #67532E",
|
||||||
|
"L c #467723",
|
||||||
|
"P c #476C3B",
|
||||||
|
"I c #447838",
|
||||||
|
"U c #537B38",
|
||||||
|
"Y c #726934",
|
||||||
|
"T c #3B6944",
|
||||||
|
"R c #565247",
|
||||||
|
"E c #575843",
|
||||||
|
"W c #465C54",
|
||||||
|
"Q c #635847",
|
||||||
|
"! c #685549",
|
||||||
|
"~ c #50684B",
|
||||||
|
"^ c #487242",
|
||||||
|
"/ c #4C6956",
|
||||||
|
"( c #6C694D",
|
||||||
|
") c #75654A",
|
||||||
|
"_ c #77764E",
|
||||||
|
"` c #7D6E51",
|
||||||
|
"' c #6F7056",
|
||||||
|
"] c #515763",
|
||||||
|
"[ c #586275",
|
||||||
|
"{ c #706F72",
|
||||||
|
"} c #8D6B1A",
|
||||||
|
"| c #865A2C",
|
||||||
|
" . c #8B7528",
|
||||||
|
".. c #98762C",
|
||||||
|
"X. c #8F6D33",
|
||||||
|
"o. c #8C744C",
|
||||||
|
"O. c #987C5B",
|
||||||
|
"+. c #A57B57",
|
||||||
|
"@. c #857062",
|
||||||
|
"#. c #178217",
|
||||||
|
"$. c #33811A",
|
||||||
|
"%. c #1A8621",
|
||||||
|
"&. c #228022",
|
||||||
|
"*. c #268336",
|
||||||
|
"=. c #368236",
|
||||||
|
"-. c #398637",
|
||||||
|
";. c #398737",
|
||||||
|
":. c #3B8539",
|
||||||
|
">. c #3B8938",
|
||||||
|
",. c #2F9839",
|
||||||
|
"<. c #47861B",
|
||||||
|
"1. c #509E1E",
|
||||||
|
"2. c #75951D",
|
||||||
|
"3. c #56AA1F",
|
||||||
|
"4. c #478828",
|
||||||
|
"5. c #539423",
|
||||||
|
"6. c #55942A",
|
||||||
|
"7. c #4A8737",
|
||||||
|
"8. c #528D3B",
|
||||||
|
"9. c #539638",
|
||||||
|
"0. c #619F26",
|
||||||
|
"q. c #5AA324",
|
||||||
|
"w. c #61A730",
|
||||||
|
"e. c #498645",
|
||||||
|
"r. c #568747",
|
||||||
|
"t. c #4C904B",
|
||||||
|
"y. c #559350",
|
||||||
|
"u. c #738852",
|
||||||
|
"i. c #6CB44E",
|
||||||
|
"p. c #578864",
|
||||||
|
"a. c #648466",
|
||||||
|
"s. c #7C8475",
|
||||||
|
"d. c #7C9375",
|
||||||
|
"f. c #4EA362",
|
||||||
|
"g. c #8E9B17",
|
||||||
|
"h. c #AA9711",
|
||||||
|
"j. c #B29710",
|
||||||
|
"k. c #99A01D",
|
||||||
|
"l. c #B8A618",
|
||||||
|
"z. c #B1AB1A",
|
||||||
|
"x. c #9B812A",
|
||||||
|
"c. c #9F8337",
|
||||||
|
"v. c #BC9928",
|
||||||
|
"b. c #AD8B33",
|
||||||
|
"n. c #B49937",
|
||||||
|
"m. c #9DA530",
|
||||||
|
"M. c #BCA729",
|
||||||
|
"N. c #CCAE1D",
|
||||||
|
"B. c #C09F34",
|
||||||
|
"V. c #CAB034",
|
||||||
|
"C. c #B9CC39",
|
||||||
|
"Z. c #D6D31D",
|
||||||
|
"A. c #D6C726",
|
||||||
|
"S. c #D3CF35",
|
||||||
|
"D. c #E2C528",
|
||||||
|
"F. c #E2DC27",
|
||||||
|
"G. c #E5D537",
|
||||||
|
"H. c #EBD63C",
|
||||||
|
"J. c #CCE339",
|
||||||
|
"K. c #E8E428",
|
||||||
|
"L. c #F1EB2A",
|
||||||
|
"P. c #F3E43C",
|
||||||
|
"I. c #89884F",
|
||||||
|
"U. c #AB934D",
|
||||||
|
"Y. c #BEA843",
|
||||||
|
"T. c #B1A556",
|
||||||
|
"R. c #94846D",
|
||||||
|
"E. c #8D8D70",
|
||||||
|
"W. c #989577",
|
||||||
|
"Q. c #AA9C6E",
|
||||||
|
"!. c #AC967E",
|
||||||
|
"~. c #B5B16B",
|
||||||
|
"^. c #C39A46",
|
||||||
|
"/. c #D2BB45",
|
||||||
|
"(. c #C4A659",
|
||||||
|
"). c #D2AB52",
|
||||||
|
"_. c #C7AB66",
|
||||||
|
"`. c #CCB374",
|
||||||
|
"'. c #8AC356",
|
||||||
|
"]. c #A1DA69",
|
||||||
|
"[. c #DBC843",
|
||||||
|
"{. c #E3CA44",
|
||||||
|
"}. c #F3CE45",
|
||||||
|
"|. c #E3D343",
|
||||||
|
" X c #E8D644",
|
||||||
|
".X c #F1D942",
|
||||||
|
"XX c #F4E74A",
|
||||||
|
"oX c #C2C36F",
|
||||||
|
"OX c #747C87",
|
||||||
|
"+X c #759386",
|
||||||
|
"@X c #8D9486",
|
||||||
|
"#X c #989D9B",
|
||||||
|
"$X c #B19C8A",
|
||||||
|
"%X c #95B793",
|
||||||
|
"&X c #ACA38D",
|
||||||
|
"*X c #B4A68E",
|
||||||
|
"=X c #B6BB83",
|
||||||
|
"-X c #94AFA3",
|
||||||
|
";X c #BAB2A8",
|
||||||
|
":X c #BDB9B3",
|
||||||
|
">X c #C5A984",
|
||||||
|
",X c #D6AA8B",
|
||||||
|
"<X c #C1B38C",
|
||||||
|
"1X c #D7B68A",
|
||||||
|
"2X c #D9B89A",
|
||||||
|
"3X c #CABEAE",
|
||||||
|
"4X c #B8C28A",
|
||||||
|
"5X c #A7C2A2",
|
||||||
|
"6X c #DEC199",
|
||||||
|
"7X c #E7C696",
|
||||||
|
"8X c #DECBB4",
|
||||||
|
"9X c #EDD6AA",
|
||||||
|
"0X c #EBCEB0",
|
||||||
|
"qX c #ECDBB4",
|
||||||
|
"wX c #DCD8C7",
|
||||||
|
"eX c #FAECC7",
|
||||||
|
"rX c #F8F0D5",
|
||||||
|
/* pixels */
|
||||||
|
"f f f k =.>.>.>.t.d./ W y.f.f.f.p.T T t.v f f g m >.>.>.;.m g f ",
|
||||||
|
"h g h n :.>.>.>.p.a.y r m *.*.*.T r r T b g g v =.>.>.>.;.m l g ",
|
||||||
|
"=.=.=.=.;.>.>.e.^ i i l ,.,.,.,.,.k r r c m =.=.;.>.>.>.>.=.=.=.",
|
||||||
|
">.>.>.>.>.;.B T r r s %.%.%.%.%.%.%.s r : T :.;.>.>.>.>.>.>.>.>.",
|
||||||
|
">.>.>.>.>.:.V r 6 k &.#.#.#.%.&.#.w $.l 6 i M ;.>.>.>.>.>.>.>.>.",
|
||||||
|
">.>.>.:.:.v - u P 9.6.1.3.q.6.6.0.q.0.6.j 6 % l >.>.>.>.>.>.>.>.",
|
||||||
|
">.>.>.:.j 7 ; Y I.m.g.z.J.C.m.k.J.J.C.2.5.e t t V =.=.>.>.>.>.>.",
|
||||||
|
">.>.>.z & C U.Y.l.C.F.L.Z.l.h.A.K.|.g.2.<.9 + i h l =.>.>.>.>.",
|
||||||
|
">.>.>.I * X } [.[.l.F.L.F.l.j.j.l.A.A.z.k.2.C @ i d m :.:.>.>.>.",
|
||||||
|
"N I y.u.K Z N.H.H.A.K.Z.z.|..X.X[.V.M.[.[.m.Z 2 ~ ^ P =.;.N m N ",
|
||||||
|
"v P @.<X+.../.D.D.D.A.l.h. XXXH.[.n.n./.XXS.b.U.*X*X( 7.>.l g g ",
|
||||||
|
"v P _ <XQ.T.).N.D.G.l.h.j.{.}.V.n.(.(.Y.{.{.(.6X8X&XP I >.l f f ",
|
||||||
|
"N M P ' W.Q. .v.D.P.H.H.H.V.B..._.1X7X`.).^.U.~.W.~ V ;.;.n f f ",
|
||||||
|
"=.m a , s.W. .x.V.{.}.}.}.B.....`.0X9X7XU.b._.Q.8.B ;.>.;.n f f ",
|
||||||
|
":.m f # / E.T.x. .c.^.).^...| +.,X2X,XU.} n.oX8.7.:.>.>.;.N n v ",
|
||||||
|
":.>.x % y u.~. .1 3 o.+.X.| +.,X,XO.H 2 Y (.oXJ x :.>.>.>.>.=.=.",
|
||||||
|
">.>.:.b = F T. .) @X] ] ) +.,X2XO.! ' OXo.U.Q.j M ;.>.>.>.>.:.>.",
|
||||||
|
">.>.>.7.J H Y D O.3X[ ] O.1X0X0XO.! OX3X` K _ B :.>.>.>.>.>.>.>.",
|
||||||
|
">.>.;.>.r.d.G * ) :XOX#XwXeXeXeXwX#X@X;XH X 7 B >.>.>.>.>.>.>.>.",
|
||||||
|
":.=.=.=.y.5X@X= 2 $X:XwXeXeXeXeXrXwX;X@X; u M :.>.>.>.>.;.=.=.=.",
|
||||||
|
";.n g n t.%Xd., < ` $X2X9X9X9XqXqX2X!.) - p M :.>.:.>.>.;.n g g ",
|
||||||
|
"=.n f f T p.G W E S F u.=X=X=X4X=XI.F S p i 6 x B N ;.>.;.l f d ",
|
||||||
|
"m v i $ # , W -X@Xu 8 j 8.8.7.r.r.I 7 ; j n 7 - - i l >.>.n f f ",
|
||||||
|
"f i i @ o = W +Xp.i d 0 0 0 0 w g d 9 7 d M a = o & i =.;.n f f ",
|
||||||
|
"v y > E ! H , > 6 p j q q <.4.<.0 q C p % : G Q ) H - h -.N g g ",
|
||||||
|
"V a , W.>X@.= . 8 7.L q A '.].'.L e L U y O , { &XR.> M >.-.=.=.",
|
||||||
|
">.:.V E ! Q i % 8 7.4.e e w.i.9.e 4.6.8.7 y i T R a c =.>.>.>.>.",
|
||||||
|
">.>.V - o , i # + I 9.4.e $.$.$.L 7.7.V + a v y O % v :.>.>.>.>.",
|
||||||
|
">.>.-.x M c @ $ p =.8.4.7.7.e.j % O # b B B x x =.-.>.>.>.>.",
|
||||||
|
">.>.>.>.>.M . o * * 7 8 q 6 5 5 % - @ . a ^ >.>.>.>.>.>.>.>.>.>.",
|
||||||
|
">.>.>.>.:.B u < 2 3 2 & . + + + $ % & - b N >.>.>.>.>.>.>.>.>.>.",
|
||||||
|
">.>.>.>.;.;.j = X 4 3 * i l M b u # t g n ;.>.>.>.>.>.>.>.>.>."
|
||||||
|
};
|
||||||
262
assets/link-left.xpm
Executable file
262
assets/link-left.xpm
Executable file
@@ -0,0 +1,262 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *xpm_[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 224 2 ",
|
||||||
|
" c #080903",
|
||||||
|
". c #130C07",
|
||||||
|
"X c #151709",
|
||||||
|
"o c #111C12",
|
||||||
|
"O c #1D1D11",
|
||||||
|
"+ c #311F0D",
|
||||||
|
"@ c #281A12",
|
||||||
|
"# c #0A2609",
|
||||||
|
"$ c #15240A",
|
||||||
|
"% c #02370B",
|
||||||
|
"& c #18320E",
|
||||||
|
"* c #1A2617",
|
||||||
|
"= c #122A14",
|
||||||
|
"- c #1A2B16",
|
||||||
|
"; c #1A3816",
|
||||||
|
": c #262A0B",
|
||||||
|
"> c #222515",
|
||||||
|
", c #282C17",
|
||||||
|
"< c #232B1C",
|
||||||
|
"1 c #382715",
|
||||||
|
"2 c #253719",
|
||||||
|
"3 c #373618",
|
||||||
|
"4 c #1E3C22",
|
||||||
|
"5 c #322E28",
|
||||||
|
"6 c #293926",
|
||||||
|
"7 c #363926",
|
||||||
|
"8 c #3C3D34",
|
||||||
|
"9 c #472B1B",
|
||||||
|
"0 c #4B3118",
|
||||||
|
"q c #4C3A28",
|
||||||
|
"w c #593C28",
|
||||||
|
"e c #403630",
|
||||||
|
"r c #613C23",
|
||||||
|
"t c #0C4A06",
|
||||||
|
"y c #124E0A",
|
||||||
|
"u c #065709",
|
||||||
|
"i c #14530D",
|
||||||
|
"p c #0A4715",
|
||||||
|
"a c #194717",
|
||||||
|
"s c #1A451B",
|
||||||
|
"d c #164A1D",
|
||||||
|
"f c #0C5A16",
|
||||||
|
"g c #12571A",
|
||||||
|
"h c #1B521D",
|
||||||
|
"j c #21451B",
|
||||||
|
"k c #305615",
|
||||||
|
"l c #395B1B",
|
||||||
|
"z c #17670D",
|
||||||
|
"x c #0F621B",
|
||||||
|
"c c #1B6D12",
|
||||||
|
"v c #127619",
|
||||||
|
"b c #2C700E",
|
||||||
|
"n c #256514",
|
||||||
|
"m c #316A10",
|
||||||
|
"M c #27771B",
|
||||||
|
"N c #3A7814",
|
||||||
|
"B c #175823",
|
||||||
|
"V c #1C5B23",
|
||||||
|
"C c #2B4323",
|
||||||
|
"Z c #264926",
|
||||||
|
"A c #364729",
|
||||||
|
"S c #295828",
|
||||||
|
"D c #325325",
|
||||||
|
"F c #335D2D",
|
||||||
|
"G c #2C4630",
|
||||||
|
"H c #394730",
|
||||||
|
"J c #3C4C36",
|
||||||
|
"K c #395434",
|
||||||
|
"L c #355934",
|
||||||
|
"P c #3D5B35",
|
||||||
|
"I c #166C29",
|
||||||
|
"U c #186B28",
|
||||||
|
"Y c #0E7A23",
|
||||||
|
"T c #147827",
|
||||||
|
"R c #14732A",
|
||||||
|
"E c #1D7233",
|
||||||
|
"W c #2B6524",
|
||||||
|
"Q c #23662A",
|
||||||
|
"! c #256A2C",
|
||||||
|
"~ c #2A6E2E",
|
||||||
|
"^ c #316B2A",
|
||||||
|
"/ c #2A712E",
|
||||||
|
"( c #257A29",
|
||||||
|
") c #33742F",
|
||||||
|
"_ c #276233",
|
||||||
|
"` c #2A6D31",
|
||||||
|
"' c #356A34",
|
||||||
|
"] c #2D7531",
|
||||||
|
"[ c #2F7832",
|
||||||
|
"{ c #337532",
|
||||||
|
"} c #3B7535",
|
||||||
|
"| c #337B34",
|
||||||
|
" . c #3A7D35",
|
||||||
|
".. c #3A753A",
|
||||||
|
"X. c #3D7D3B",
|
||||||
|
"o. c #544E15",
|
||||||
|
"O. c #49751C",
|
||||||
|
"+. c #656816",
|
||||||
|
"@. c #726A15",
|
||||||
|
"#. c #484825",
|
||||||
|
"$. c #465C37",
|
||||||
|
"%. c #545331",
|
||||||
|
"&. c #6C592A",
|
||||||
|
"*. c #775626",
|
||||||
|
"=. c #466729",
|
||||||
|
"-. c #4E702E",
|
||||||
|
";. c #46783E",
|
||||||
|
":. c #716E26",
|
||||||
|
">. c #365556",
|
||||||
|
",. c #3E7346",
|
||||||
|
"<. c #4B5244",
|
||||||
|
"1. c #6F5D53",
|
||||||
|
"2. c #486D47",
|
||||||
|
"3. c #726F4C",
|
||||||
|
"4. c #776B53",
|
||||||
|
"5. c #596366",
|
||||||
|
"6. c #7C7A68",
|
||||||
|
"7. c #6F7870",
|
||||||
|
"8. c #88721F",
|
||||||
|
"9. c #856429",
|
||||||
|
"0. c #9C7C2B",
|
||||||
|
"q. c #8E7731",
|
||||||
|
"w. c #A37C32",
|
||||||
|
"e. c #8C724A",
|
||||||
|
"r. c #8E7D64",
|
||||||
|
"t. c #21891C",
|
||||||
|
"y. c #138320",
|
||||||
|
"u. c #248D29",
|
||||||
|
"i. c #328F2F",
|
||||||
|
"p. c #2F9B25",
|
||||||
|
"a. c #37992A",
|
||||||
|
"s. c #368236",
|
||||||
|
"d. c #398537",
|
||||||
|
"f. c #3A8837",
|
||||||
|
"g. c #378638",
|
||||||
|
"h. c #3A8538",
|
||||||
|
"j. c #3B8938",
|
||||||
|
"k. c #399831",
|
||||||
|
"l. c #3CA334",
|
||||||
|
"z. c #5C961D",
|
||||||
|
"x. c #498538",
|
||||||
|
"c. c #438B3E",
|
||||||
|
"v. c #588B30",
|
||||||
|
"b. c #439532",
|
||||||
|
"n. c #439B31",
|
||||||
|
"m. c #41A42D",
|
||||||
|
"M. c #45A432",
|
||||||
|
"N. c #6EA62B",
|
||||||
|
"B. c #3E8C41",
|
||||||
|
"V. c #438B43",
|
||||||
|
"C. c #468648",
|
||||||
|
"Z. c #558C42",
|
||||||
|
"A. c #57934A",
|
||||||
|
"S. c #569255",
|
||||||
|
"D. c #6A924B",
|
||||||
|
"F. c #619452",
|
||||||
|
"G. c #7F8A7D",
|
||||||
|
"H. c #A8961E",
|
||||||
|
"J. c #92922A",
|
||||||
|
"K. c #A78525",
|
||||||
|
"L. c #A79625",
|
||||||
|
"P. c #B89827",
|
||||||
|
"I. c #AF8F37",
|
||||||
|
"U. c #B18D38",
|
||||||
|
"Y. c #90AE33",
|
||||||
|
"T. c #BBAA28",
|
||||||
|
"R. c #ADB436",
|
||||||
|
"E. c #C9AC3F",
|
||||||
|
"W. c #CCCB3D",
|
||||||
|
"Q. c #D7C93A",
|
||||||
|
"!. c #8F8B4D",
|
||||||
|
"~. c #95954A",
|
||||||
|
"^. c #B79D42",
|
||||||
|
"/. c #B19051",
|
||||||
|
"(. c #89A84D",
|
||||||
|
"). c #ABAC48",
|
||||||
|
"_. c #BBA944",
|
||||||
|
"`. c #B8AA53",
|
||||||
|
"'. c #8E8D70",
|
||||||
|
"]. c #9A977C",
|
||||||
|
"[. c #A48C69",
|
||||||
|
"{. c #AB9578",
|
||||||
|
"}. c #B99879",
|
||||||
|
"|. c #94A260",
|
||||||
|
" X c #B1AE70",
|
||||||
|
".X c #C6A84A",
|
||||||
|
"XX c #D8B748",
|
||||||
|
"oX c #C2A959",
|
||||||
|
"OX c #C9BC55",
|
||||||
|
"+X c #D9BC67",
|
||||||
|
"@X c #C9B173",
|
||||||
|
"#X c #D3BA79",
|
||||||
|
"$X c #D8C548",
|
||||||
|
"%X c #D1CA4E",
|
||||||
|
"&X c #E2C55A",
|
||||||
|
"*X c #E4D152",
|
||||||
|
"=X c #F3D857",
|
||||||
|
"-X c #DDCE7F",
|
||||||
|
";X c #F3EA77",
|
||||||
|
":X c #6E7B85",
|
||||||
|
">X c #758C8F",
|
||||||
|
",X c #76A781",
|
||||||
|
"<X c #7DC083",
|
||||||
|
"1X c #93978E",
|
||||||
|
"2X c #94B08A",
|
||||||
|
"3X c #AAA388",
|
||||||
|
"4X c #8D9AAA",
|
||||||
|
"5X c #9DA8B0",
|
||||||
|
"6X c #BEB2B0",
|
||||||
|
"7X c #C0BA9F",
|
||||||
|
"8X c #BACA91",
|
||||||
|
"9X c #ACCFB0",
|
||||||
|
"0X c #A7D5B3",
|
||||||
|
"qX c #DAC690",
|
||||||
|
"wX c #CDC1A1",
|
||||||
|
"eX c #C2C3B3",
|
||||||
|
"rX c #C8D0BA",
|
||||||
|
"tX c #E6CFA1",
|
||||||
|
"yX c #E6DCBC",
|
||||||
|
"uX c #EFE1C0",
|
||||||
|
"iX c #F3E8C7",
|
||||||
|
"pX c #F8EBDA",
|
||||||
|
"aX c #F5F2DD",
|
||||||
|
"sX c #EBE9E9",
|
||||||
|
/* pixels */
|
||||||
|
"Q Q Q / s.f.c.A.|.oXK.+.l k t z i.a.p.t.( <X0X,XC.g.g.j.j.[ Q Q ",
|
||||||
|
"~ ~ ` ] g.A.D.~.}.+X&X%XY.O.i b b.M.m.a.k.B.C.,.C.V.c.h.d.| ~ ~ ",
|
||||||
|
"s.s.s.h.F.|.`.OX.X/..X&XOXY.) M M n.m.m.k.i.( Q 2.S.V.g.f.d.s.s.",
|
||||||
|
"f.f.g.A. X`.T.$X.Xw.w.XXXX).v.z z b.M.m.l.l.u.I V ,.B.h.f.f.f.f.",
|
||||||
|
"j.j.c.Z.(.$XQ.E.^.U.K.*X$XJ.z.M z b.n.M.a.u.y.Y x h S .j.j.j.j.",
|
||||||
|
"j.j.j.;.:.*X=XP.0.K.E.=X*XL.R.N.b n c c v v Y Y T f p | j.j.j.j.",
|
||||||
|
"j.j.j.h.:.OX$XU.0./.&X&XE.H.W.Y.N t u u u v Y T T x g ] V.j.j.j.",
|
||||||
|
"j.j.j.h.Z.~.e.*.[.@X#X_.H.H.W.Y.m y f x E E I R T U V h V.V.j.j.",
|
||||||
|
"f.f.f.f.j.F.'.q [.tXtX@X$XW.T.J.-.n f x U g p f E / U d ,.j.h.j.",
|
||||||
|
"s.[ ( s.g.S.'.8 4.3X7XqX;X*XL.q.-.k y y V p % % g E _ d X.s.| | ",
|
||||||
|
"Q ! ! / g.C.7.8 e e 1.7X;X&XI.@.o.#.l ^ S a # # % B _ d { { ! ! ",
|
||||||
|
"! Q Q / | K <.6.5.r.6XtX-X_.^.9.&.|.8XqX2X$.j h S d d d { ] Q U ",
|
||||||
|
"| ~ Q / ] * 5 1X:X4XsXpX7X0..X8.&.wXiXuX8X$.^ .) V Z Z | [ Q U ",
|
||||||
|
"f./ Q ] ..6 8 G.:X5XsXpX}.9..X@.#.eXuXwX4.2 } h.s.| ' W | [ ! S ",
|
||||||
|
"f.[ / [ d. .' J r.eXaXiX}.9.E.+.6 >X1X4.1 : ) h. .d.h.d.g.| ] ` ",
|
||||||
|
"f.g.f.d.f.f.d.P 5.].yXyX}.9._.+.; >.<.H #.=.;.h.h.g.j.j.h.g.g.g.",
|
||||||
|
"j.j.j.j.j.j.f.} K %.].{.4.*.`.+.# = = 2 3.D.V.j.j.j.j.j.j.j.j.j.",
|
||||||
|
"j.j.f.f.j.f.f.h.;.2.A A : 3 !.o.O C j & 2 ..c.j.j.j.j.j.j.j.j.j.",
|
||||||
|
"j.f.f.f.j.j.f.c.;.D a h a a #.3 : ; s ; # Q g.f.j.j.j.j.f.i.j.j.",
|
||||||
|
"g.g.s.d.f.j.f. .=.l W ~ Q s * 6 6 $ s Z = Q d.j.j.j.j.j.f.s.s.s.",
|
||||||
|
"g.] ~ / g.j.;.D (.(.N W a = L 2.J o 4 G - ] j.j.j.j.f.f.f.[ ! ! ",
|
||||||
|
"g.] Q ~ g.V...2 v.z.m l , 2 2X9X'.* * 6 2 ~ d.f.g.f.f.f.f.] Q Q ",
|
||||||
|
"[ ! Q / | j...; k N O.=.2 6 3XrX1X- * 7 7 s .d.| ] | g.g.] Q Q ",
|
||||||
|
"Q Q Q / g.h...4 S Z.v.D.A O e %.7 X * 7 H Z | d.] ! ~ g.f.] Q Q ",
|
||||||
|
"~ ~ ~ ] s.f.| _ Z F x.x.j O 9 r 9 X j J C ` g.g.] Q ~ s.d.| ! ~ ",
|
||||||
|
"s.s.s.g.g.g.] ` 2.$.D j # @ r.{.1.O 2 F { | ` ! Q U ~ d.f.g.| s.",
|
||||||
|
"g.j.j.j.j.g.{ Q ' $.> . 5 3X7X4.> = S | | ! Q Q Q ` g.j.j.f.f.",
|
||||||
|
"f.f.j.j.j.g.| ' H 5 9 1 + 1 H H , - F .d.d.{ ] { ] | g.j.j.j.f.",
|
||||||
|
"j.j.j.j.j.j.f.{ < @ r r 0 1 . o L h.f.f.j.f.g.f.f.f.f.j.j.j.j.",
|
||||||
|
"j.j.j.j.j.j.j. .C , q w 9 + X * 6 ..g.d.g.g.j.f.f.f.f.j.j.j.j.j.",
|
||||||
|
"j.j.j.j.j.j.j.j.X.' , @ @ > S { .g.d.{ ! [ f.j.f.f.j.j.j.j.j.j.",
|
||||||
|
"j.j.j.j.j.j.j.j.j.X.P J J K .f.j.f.d.~ ! ] g.j.j.j.j.j.j.j.j.j."
|
||||||
|
};
|
||||||
270
assets/link-right.xpm
Executable file
270
assets/link-right.xpm
Executable file
@@ -0,0 +1,270 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *b9b6c34c7e25447ddc337435fe134c0aNQrozVqCFCZ21TJN[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 232 2 ",
|
||||||
|
" c #030E01",
|
||||||
|
". c #091A0A",
|
||||||
|
"X c #14150D",
|
||||||
|
"o c #171E14",
|
||||||
|
"O c #230C06",
|
||||||
|
"+ c #25180B",
|
||||||
|
"@ c #281D1A",
|
||||||
|
"# c #062706",
|
||||||
|
"$ c #13290E",
|
||||||
|
"% c #083809",
|
||||||
|
"& c #143707",
|
||||||
|
"* c #0D2711",
|
||||||
|
"= c #122514",
|
||||||
|
"- c #132A15",
|
||||||
|
"; c #1C2917",
|
||||||
|
": c #0E3414",
|
||||||
|
"> c #173915",
|
||||||
|
", c #262C0C",
|
||||||
|
"< c #2C350E",
|
||||||
|
"1 c #28211D",
|
||||||
|
"2 c #362419",
|
||||||
|
"3 c #253813",
|
||||||
|
"4 c #1B2F2A",
|
||||||
|
"5 c #262E24",
|
||||||
|
"6 c #2A3A25",
|
||||||
|
"7 c #383A24",
|
||||||
|
"8 c #431C09",
|
||||||
|
"9 c #52270D",
|
||||||
|
"0 c #4A2D19",
|
||||||
|
"q c #6D331B",
|
||||||
|
"w c #4D3630",
|
||||||
|
"e c #733828",
|
||||||
|
"r c #064608",
|
||||||
|
"t c #025305",
|
||||||
|
"y c #085D09",
|
||||||
|
"u c #175B0E",
|
||||||
|
"i c #0D4613",
|
||||||
|
"p c #18481C",
|
||||||
|
"a c #0A5B13",
|
||||||
|
"s c #29530C",
|
||||||
|
"d c #284C1A",
|
||||||
|
"f c #30491F",
|
||||||
|
"g c #046609",
|
||||||
|
"h c #07780D",
|
||||||
|
"j c #17750B",
|
||||||
|
"k c #096615",
|
||||||
|
"l c #156817",
|
||||||
|
"z c #047A16",
|
||||||
|
"x c #25760E",
|
||||||
|
"c c #347907",
|
||||||
|
"v c #246916",
|
||||||
|
"b c #1B4E23",
|
||||||
|
"n c #1B5724",
|
||||||
|
"m c #344C2A",
|
||||||
|
"M c #265927",
|
||||||
|
"N c #385837",
|
||||||
|
"B c #1B7122",
|
||||||
|
"V c #2A6526",
|
||||||
|
"C c #23662A",
|
||||||
|
"Z c #266B2C",
|
||||||
|
"A c #296D2E",
|
||||||
|
"S c #346B29",
|
||||||
|
"D c #23722E",
|
||||||
|
"F c #2A702E",
|
||||||
|
"G c #36772F",
|
||||||
|
"H c #2E6634",
|
||||||
|
"J c #2B6D32",
|
||||||
|
"K c #376837",
|
||||||
|
"L c #2D7531",
|
||||||
|
"P c #2F7933",
|
||||||
|
"I c #337435",
|
||||||
|
"U c #327B34",
|
||||||
|
"Y c #397A38",
|
||||||
|
"T c #414913",
|
||||||
|
"R c #7B6211",
|
||||||
|
"E c #4C472C",
|
||||||
|
"W c #4E4C2E",
|
||||||
|
"Q c #5D542B",
|
||||||
|
"! c #494B35",
|
||||||
|
"~ c #59573B",
|
||||||
|
"^ c #6F542C",
|
||||||
|
"/ c #526F2C",
|
||||||
|
"( c #447738",
|
||||||
|
") c #766B28",
|
||||||
|
"_ c #253E48",
|
||||||
|
"` c #2C4754",
|
||||||
|
"' c #397745",
|
||||||
|
"] c #4F5043",
|
||||||
|
"[ c #6E5A5A",
|
||||||
|
"{ c #486445",
|
||||||
|
"} c #546746",
|
||||||
|
"| c #467A47",
|
||||||
|
" . c #567A4F",
|
||||||
|
".. c #5C6D61",
|
||||||
|
"X. c #895414",
|
||||||
|
"o. c #854F2D",
|
||||||
|
"O. c #89692A",
|
||||||
|
"+. c #927328",
|
||||||
|
"@. c #BC7F31",
|
||||||
|
"#. c #8A6D57",
|
||||||
|
"$. c #967E78",
|
||||||
|
"%. c #09840D",
|
||||||
|
"&. c #128F0D",
|
||||||
|
"*. c #068517",
|
||||||
|
"=. c #039B17",
|
||||||
|
"-. c #3B860B",
|
||||||
|
";. c #29900C",
|
||||||
|
":. c #11B10F",
|
||||||
|
">. c #05A618",
|
||||||
|
",. c #13AA18",
|
||||||
|
"<. c #0EB315",
|
||||||
|
"1. c #29AB17",
|
||||||
|
"2. c #1D8526",
|
||||||
|
"3. c #039424",
|
||||||
|
"4. c #238727",
|
||||||
|
"5. c #368236",
|
||||||
|
"6. c #398637",
|
||||||
|
"7. c #3B8937",
|
||||||
|
"8. c #378438",
|
||||||
|
"9. c #3A8639",
|
||||||
|
"0. c #3B8938",
|
||||||
|
"q. c #279436",
|
||||||
|
"w. c #1AB820",
|
||||||
|
"e. c #2BB42C",
|
||||||
|
"r. c #2DB336",
|
||||||
|
"t. c #418617",
|
||||||
|
"y. c #799513",
|
||||||
|
"u. c #4CB211",
|
||||||
|
"i. c #6BB910",
|
||||||
|
"p. c #548F2E",
|
||||||
|
"a. c #42843E",
|
||||||
|
"s. c #438B3D",
|
||||||
|
"d. c #598A39",
|
||||||
|
"f. c #68962A",
|
||||||
|
"g. c #7C933C",
|
||||||
|
"h. c #09C10E",
|
||||||
|
"j. c #14CA18",
|
||||||
|
"k. c #0DD515",
|
||||||
|
"l. c #15D815",
|
||||||
|
"z. c #2CC118",
|
||||||
|
"x. c #0EE317",
|
||||||
|
"c. c #13E217",
|
||||||
|
"v. c #25C82E",
|
||||||
|
"b. c #3D8D42",
|
||||||
|
"n. c #39B742",
|
||||||
|
"m. c #478944",
|
||||||
|
"M. c #479545",
|
||||||
|
"N. c #538653",
|
||||||
|
"B. c #679849",
|
||||||
|
"V. c #749553",
|
||||||
|
"C. c #57A05A",
|
||||||
|
"Z. c #70A84F",
|
||||||
|
"A. c #719168",
|
||||||
|
"S. c #7E827D",
|
||||||
|
"D. c #76B569",
|
||||||
|
"F. c #74AB70",
|
||||||
|
"G. c #ACB10B",
|
||||||
|
"H. c #BAAB14",
|
||||||
|
"J. c #8F873A",
|
||||||
|
"K. c #989839",
|
||||||
|
"L. c #B39130",
|
||||||
|
"P. c #ADAC2F",
|
||||||
|
"I. c #B1AE2E",
|
||||||
|
"U. c #CB9217",
|
||||||
|
"Y. c #D0B312",
|
||||||
|
"T. c #CD8826",
|
||||||
|
"R. c #DAA926",
|
||||||
|
"E. c #D5A43B",
|
||||||
|
"W. c #CFB032",
|
||||||
|
"Q. c #E6BC32",
|
||||||
|
"!. c #90C812",
|
||||||
|
"~. c #B5CB17",
|
||||||
|
"^. c #ABD624",
|
||||||
|
"/. c #9AE833",
|
||||||
|
"(. c #D6DA13",
|
||||||
|
"). c #E5C41B",
|
||||||
|
"_. c #E6D818",
|
||||||
|
"`. c #DEE815",
|
||||||
|
"'. c #E3ED17",
|
||||||
|
"]. c #D3CA35",
|
||||||
|
"[. c #E6CB29",
|
||||||
|
"{. c #E5CE2D",
|
||||||
|
"}. c #C8E123",
|
||||||
|
"|. c #EEE927",
|
||||||
|
" X c #E7E534",
|
||||||
|
".X c #F0EA34",
|
||||||
|
"XX c #AA9845",
|
||||||
|
"oX c #95B54E",
|
||||||
|
"OX c #858571",
|
||||||
|
"+X c #ABB973",
|
||||||
|
"@X c #CF934B",
|
||||||
|
"#X c #C3B452",
|
||||||
|
"$X c #C09768",
|
||||||
|
"%X c #DDAC63",
|
||||||
|
"&X c #CAB767",
|
||||||
|
"*X c #D9C84D",
|
||||||
|
"=X c #CEC755",
|
||||||
|
"-X c #E6C548",
|
||||||
|
";X c #ECDA4C",
|
||||||
|
":X c #D3E743",
|
||||||
|
">X c #F3E94D",
|
||||||
|
",X c #CEC36F",
|
||||||
|
"<X c #ECD46B",
|
||||||
|
"1X c #578489",
|
||||||
|
"2X c #62979D",
|
||||||
|
"3X c #939287",
|
||||||
|
"4X c #A69188",
|
||||||
|
"5X c #B4978F",
|
||||||
|
"6X c #89B888",
|
||||||
|
"7X c #96AB94",
|
||||||
|
"8X c #A3A898",
|
||||||
|
"9X c #AAB494",
|
||||||
|
"0X c #98B1A2",
|
||||||
|
"qX c #B4A7A2",
|
||||||
|
"wX c #BAB4A8",
|
||||||
|
"eX c #C5B688",
|
||||||
|
"rX c #D3BA99",
|
||||||
|
"tX c #9FC59B",
|
||||||
|
"yX c #B6C6B4",
|
||||||
|
"uX c #D9CF9D",
|
||||||
|
"iX c #DAD29F",
|
||||||
|
"pX c #EED88B",
|
||||||
|
"aX c #F7EE8F",
|
||||||
|
"sX c #D2CCAE",
|
||||||
|
"dX c #F4D5A1",
|
||||||
|
"fX c #E5EEB9",
|
||||||
|
"gX c #BEDECD",
|
||||||
|
"hX c #D6D6C4",
|
||||||
|
"jX c #F8F1CC",
|
||||||
|
"kX c #EEEAD0",
|
||||||
|
"lX c #FAF7D5",
|
||||||
|
"zX c #F2ECE5",
|
||||||
|
/* pixels */
|
||||||
|
"C C C F 5.0.0.0.5.I I 9.M.C.D.F.6XtX9X9XA.I C Z U 0.0.0.0.L C C ",
|
||||||
|
"A A A L 8.0.0.0.b.b.4.e.r.n.n.4.V G / ) K.d.I I Y 0.0.0.6.U A A ",
|
||||||
|
"5.5.5.5.0.0.0.m.M.r.,.j.j.v.v.h t c y.H.].oXZ.B.s.0.0.0.0.6.5.5.",
|
||||||
|
"0.0.0.0.0.9.5.B &.<.k.x.l.l.w.%.j i.}. X;X*XW.K.p.7.0.0.0.0.0.0.",
|
||||||
|
"0.0.0.0.9.D l %.h.k.x.x.c.j.h &.u.^.`._.R.R.[.].P.f.7.0.0.0.0.0.",
|
||||||
|
"0.0.0.m.U l h =.h.k.c.c.c.<.g ;.i.~.'._.U.R.)._._.~.p.0.0.0.0.0.",
|
||||||
|
"0.0.0.a.p k =.=.>.>.<.:.:.:.%.u.!.G.`.|.Q.E.R.).|.(.p.6.0.0.0.0.",
|
||||||
|
"0.0.m.Y i h =.>.=.z g y t g 1./.:XH.(..X-X@.T.{. X~.p.5.0.0.0.0.",
|
||||||
|
"0.0.N.' k *.=.>.3.3.*.h y t ;./.:XH.Y.{.<X%X@XL.I.f.G 8.0.0.0.0.",
|
||||||
|
"U Y ' b *.>.=.*.z 3.3.*.h y -.^. XY.Y.Q.pXdX$XQ / A F 8.6.Y U U ",
|
||||||
|
"C J K i *.=.%.t t g z g g x y.H._. X;X<XuXrX#.( A C A 5.6.L Z C ",
|
||||||
|
"Z J N : z h r # % r a l l s R U.).>XaX,X~ ~ E K L Z F 5.6.L C C ",
|
||||||
|
"U J m * k t # # S B.D.Z.) X.T.Q.;XaXuX[ ] ! } I U 5.6.6.L C C ",
|
||||||
|
"8.I N * r % # . ; A.sXkXfXeXO.E.-XE.pXjXhXS.OX8XN U 0.0.9.L C C ",
|
||||||
|
"6.I N - n # : M ; E eXjXlXsXQ I.*X+.&XlXzX3X4XqXN L 0.0.6.U L J ",
|
||||||
|
"0.9.N = p . $ V 3 + o.rXhXwXE P.=X) &XlXzXwX4XOX( 6.0.0.0.6.6.6.",
|
||||||
|
"0.0.K - . . > G W 7 w #.S.A.7 P.=X) &XjXkXwXOXm.0.0.0.0.0.0.0.0.",
|
||||||
|
"0.0.6.V > V U M.+X+X#.2 = - , P.=X) XXiXwX} ( 0.0.0.0.0.0.0.0.0.",
|
||||||
|
"0.0.0.6.Y 6.0.s.B.V.m # # % , L.#X0 T / ~ } a.0.0.0.0.0.0.0.0.0.",
|
||||||
|
"9.5.5.5.0.0.0.0.0.I : r k a 3 O.J.3 % i > | a.0.0.0.0.0.0.5.5.U ",
|
||||||
|
"6.L Z L 6.0.0.0.0.I : k a % 3 < 3 u z *.l M Y 0.0.0.0.0.6.P Z Z ",
|
||||||
|
"8.L C A 8.0.6.9.0.I > B i # d d : % k &.;.Z.B.( a.0.9.0.6.L C C ",
|
||||||
|
"L Z C F 5.6.U L A M > V & = .F. .= r x t.oXg.m A.m.U 6.9.L C C ",
|
||||||
|
"C C C F 5.6.L M - $ v v & 5 0XgX0X5 & c -.t.s 6 3X| A 5.6.L C C ",
|
||||||
|
"Z Z Z L 8.6.L n * # &.1.u 4 1X2X..- u 1.z.1.y 6 8X| Z 5.6.U A Z ",
|
||||||
|
"5.5.5.5.0.9.L C b % j e.l = _ ` 4 . u e.v.,.l { 7X| Z 8.0.6.5.5.",
|
||||||
|
"0.0.0.0.0.9.L C C M p 5.d o ] [ w X % 2.q.H N.7XA.J J 8.0.0.0.0.",
|
||||||
|
"0.0.0.0.0.6.U L L I K 6 X 1 4XsX5X1 . f 3XyXA.Y L U 6.0.0.0.0.",
|
||||||
|
"0.0.0.0.0.0.6.6.9.9.a.{ 5 @ #.5X$.2 O O 0 $.8Xm.8.6.6.0.0.0.0.0.",
|
||||||
|
"0.0.0.0.0.0.0.0.0.0.0.m.{ ; X @ @ 2 9 e e w ] a.0.0.0.0.0.0.0.0.",
|
||||||
|
"0.0.0.0.0.0.0.0.0.0.0.Y I M = . X 2 q o.^ 2 ! Y 0.0.0.0.0.0.0.0.",
|
||||||
|
"0.0.0.0.0.0.0.0.0.0.0.P C C K N 7 + 8 9 9 E .s.0.0.0.0.0.0.0.0."
|
||||||
|
};
|
||||||
265
assets/link-up.xpm
Executable file
265
assets/link-up.xpm
Executable file
@@ -0,0 +1,265 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *_d7417aa2c564d47e7c81b3a9a32022fGlnMjNco5pVliEoH[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 227 2 ",
|
||||||
|
" c #020601",
|
||||||
|
". c #010B01",
|
||||||
|
"X c #0D0C04",
|
||||||
|
"o c #031502",
|
||||||
|
"O c #0E1205",
|
||||||
|
"+ c #041C04",
|
||||||
|
"@ c #0B1A08",
|
||||||
|
"# c #181D07",
|
||||||
|
"$ c #13120A",
|
||||||
|
"% c #1D150B",
|
||||||
|
"& c #1B1D14",
|
||||||
|
"* c #24180A",
|
||||||
|
"= c #032503",
|
||||||
|
"- c #0B2405",
|
||||||
|
"; c #032B05",
|
||||||
|
": c #042D09",
|
||||||
|
"> c #142D0A",
|
||||||
|
", c #033504",
|
||||||
|
"< c #04380B",
|
||||||
|
"1 c #153909",
|
||||||
|
"2 c #172A12",
|
||||||
|
"3 c #033510",
|
||||||
|
"4 c #173816",
|
||||||
|
"5 c #292E0A",
|
||||||
|
"6 c #282918",
|
||||||
|
"7 c #372815",
|
||||||
|
"8 c #253B17",
|
||||||
|
"9 c #363A19",
|
||||||
|
"0 c #1C3E20",
|
||||||
|
"q c #332B25",
|
||||||
|
"w c #333924",
|
||||||
|
"e c #383B28",
|
||||||
|
"r c #4C3D16",
|
||||||
|
"t c #03440A",
|
||||||
|
"y c #054D0B",
|
||||||
|
"u c #0C4D0B",
|
||||||
|
"i c #174507",
|
||||||
|
"p c #04550A",
|
||||||
|
"a c #035C0B",
|
||||||
|
"s c #10570E",
|
||||||
|
"d c #19451A",
|
||||||
|
"f c #025A16",
|
||||||
|
"g c #1C5319",
|
||||||
|
"h c #214619",
|
||||||
|
"j c #295916",
|
||||||
|
"k c #365311",
|
||||||
|
"l c #056C02",
|
||||||
|
"z c #066709",
|
||||||
|
"x c #156B0F",
|
||||||
|
"c c #067309",
|
||||||
|
"v c #197A01",
|
||||||
|
"b c #076816",
|
||||||
|
"n c #196815",
|
||||||
|
"m c #067319",
|
||||||
|
"M c #35790A",
|
||||||
|
"N c #2F6C10",
|
||||||
|
"B c #145521",
|
||||||
|
"V c #274626",
|
||||||
|
"C c #324520",
|
||||||
|
"Z c #285A28",
|
||||||
|
"A c #3B5625",
|
||||||
|
"S c #186227",
|
||||||
|
"D c #057438",
|
||||||
|
"F c #23662A",
|
||||||
|
"G c #29642C",
|
||||||
|
"H c #256A2C",
|
||||||
|
"J c #296D2D",
|
||||||
|
"K c #386829",
|
||||||
|
"L c #287D21",
|
||||||
|
"P c #2A712F",
|
||||||
|
"I c #3A702C",
|
||||||
|
"U c #2C6530",
|
||||||
|
"Y c #2B6E31",
|
||||||
|
"T c #346B32",
|
||||||
|
"R c #3F6D3E",
|
||||||
|
"E c #2D7432",
|
||||||
|
"W c #2F7832",
|
||||||
|
"Q c #347533",
|
||||||
|
"! c #397537",
|
||||||
|
"~ c #327C34",
|
||||||
|
"^ c #494F15",
|
||||||
|
"/ c #586D0F",
|
||||||
|
"( c #6A6409",
|
||||||
|
") c #4C4937",
|
||||||
|
"_ c #544C35",
|
||||||
|
"` c #4C5936",
|
||||||
|
"' c #605D2F",
|
||||||
|
"] c #6D5030",
|
||||||
|
"[ c #695538",
|
||||||
|
"{ c #446B2C",
|
||||||
|
"} c #476B38",
|
||||||
|
"| c #4E7135",
|
||||||
|
" . c #646824",
|
||||||
|
".. c #656831",
|
||||||
|
"X. c #3A5C42",
|
||||||
|
"o. c #465641",
|
||||||
|
"O. c #67594B",
|
||||||
|
"+. c #4C6B47",
|
||||||
|
"@. c #457A42",
|
||||||
|
"#. c #557941",
|
||||||
|
"$. c #606F44",
|
||||||
|
"%. c #666857",
|
||||||
|
"&. c #797658",
|
||||||
|
"*. c #7E7A6C",
|
||||||
|
"=. c #866A2B",
|
||||||
|
"-. c #A97B20",
|
||||||
|
";. c #82654C",
|
||||||
|
":. c #867848",
|
||||||
|
">. c #1A850A",
|
||||||
|
",. c #06980B",
|
||||||
|
"<. c #098517",
|
||||||
|
"1. c #058A11",
|
||||||
|
"2. c #158A11",
|
||||||
|
"3. c #059614",
|
||||||
|
"4. c #039E14",
|
||||||
|
"5. c #059A1A",
|
||||||
|
"6. c #2A8519",
|
||||||
|
"7. c #229616",
|
||||||
|
"8. c #03A60C",
|
||||||
|
"9. c #07AB0D",
|
||||||
|
"0. c #08B70D",
|
||||||
|
"q. c #10BB0F",
|
||||||
|
"w. c #03A314",
|
||||||
|
"e. c #05AC19",
|
||||||
|
"r. c #07BB15",
|
||||||
|
"t. c #11B718",
|
||||||
|
"y. c #30AF0D",
|
||||||
|
"u. c #2BA814",
|
||||||
|
"i. c #25B813",
|
||||||
|
"p. c #0B8320",
|
||||||
|
"a. c #059627",
|
||||||
|
"s. c #398326",
|
||||||
|
"d. c #2E9223",
|
||||||
|
"f. c #368236",
|
||||||
|
"g. c #3A8537",
|
||||||
|
"h. c #3A8837",
|
||||||
|
"j. c #378538",
|
||||||
|
"k. c #3A8639",
|
||||||
|
"l. c #3B8938",
|
||||||
|
"z. c #00A121",
|
||||||
|
"x. c #11B121",
|
||||||
|
"c. c #2DB726",
|
||||||
|
"v. c #408203",
|
||||||
|
"b. c #47B215",
|
||||||
|
"n. c #6DB20E",
|
||||||
|
"m. c #50922E",
|
||||||
|
"M. c #488535",
|
||||||
|
"N. c #418B3C",
|
||||||
|
"B. c #708B32",
|
||||||
|
"V. c #0EC00C",
|
||||||
|
"C. c #0CDA0F",
|
||||||
|
"Z. c #09C413",
|
||||||
|
"A. c #0FCA15",
|
||||||
|
"S. c #10C111",
|
||||||
|
"D. c #0DD716",
|
||||||
|
"F. c #11DD13",
|
||||||
|
"G. c #13D41C",
|
||||||
|
"H. c #34C109",
|
||||||
|
"J. c #29C81C",
|
||||||
|
"K. c #0FE806",
|
||||||
|
"L. c #0EE50D",
|
||||||
|
"P. c #0FE808",
|
||||||
|
"I. c #10E50C",
|
||||||
|
"U. c #11EA09",
|
||||||
|
"Y. c #0EE516",
|
||||||
|
"T. c #12E214",
|
||||||
|
"R. c #14E715",
|
||||||
|
"E. c #25CE23",
|
||||||
|
"W. c #29C629",
|
||||||
|
"Q. c #33C229",
|
||||||
|
"!. c #4DC90D",
|
||||||
|
"~. c #68CC12",
|
||||||
|
"^. c #77D314",
|
||||||
|
"/. c #34934E",
|
||||||
|
"(. c #4F8647",
|
||||||
|
"). c #448C41",
|
||||||
|
"_. c #5A864A",
|
||||||
|
"`. c #4C904C",
|
||||||
|
"'. c #5A8556",
|
||||||
|
"]. c #5A9956",
|
||||||
|
"[. c #6F8C53",
|
||||||
|
"{. c #71976B",
|
||||||
|
"}. c #749171",
|
||||||
|
"|. c #BD911F",
|
||||||
|
" X c #86AB17",
|
||||||
|
".X c #B6AB12",
|
||||||
|
"XX c #9D8136",
|
||||||
|
"oX c #B09E3B",
|
||||||
|
"OX c #90A12D",
|
||||||
|
"+X c #B5AF2D",
|
||||||
|
"@X c #D1B12D",
|
||||||
|
"#X c #AED10F",
|
||||||
|
"$X c #B7D51C",
|
||||||
|
"%X c #B5DB2D",
|
||||||
|
"&X c #A2DF31",
|
||||||
|
"*X c #D2D219",
|
||||||
|
"=X c #CBC436",
|
||||||
|
"-X c #DDDF36",
|
||||||
|
";X c #D7F739",
|
||||||
|
":X c #8D904E",
|
||||||
|
">X c #A28244",
|
||||||
|
",X c #95AD45",
|
||||||
|
"<X c #979B75",
|
||||||
|
"1X c #AE956F",
|
||||||
|
"2X c #95A572",
|
||||||
|
"3X c #B2AC6C",
|
||||||
|
"4X c #A9A777",
|
||||||
|
"5X c #C5AA57",
|
||||||
|
"6X c #C7B368",
|
||||||
|
"7X c #D6AF73",
|
||||||
|
"8X c #BEC67B",
|
||||||
|
"9X c #D0D44C",
|
||||||
|
"0X c #DFF949",
|
||||||
|
"qX c #919488",
|
||||||
|
"wX c #B09880",
|
||||||
|
"eX c #9AB38B",
|
||||||
|
"rX c #A3AA8E",
|
||||||
|
"tX c #B3A88C",
|
||||||
|
"yX c #A2BC91",
|
||||||
|
"uX c #A3B8A3",
|
||||||
|
"iX c #DBBE8F",
|
||||||
|
"pX c #C8B999",
|
||||||
|
"aX c #A3C28D",
|
||||||
|
"sX c #B9C5B3",
|
||||||
|
"dX c #DCCA9A",
|
||||||
|
"fX c #E9D8AE",
|
||||||
|
"gX c #F0DFBD",
|
||||||
|
/* pixels */
|
||||||
|
"F F F P f.l.l.h.f.J F F F E k.N.N.N.k.E F F F H ~ l.h.l.l.E F F ",
|
||||||
|
"J J J E g.l.l.l.f.E J E '.eXyXaXaXyXyX{.Y F J Y ~ h.l.l.g.~ J J ",
|
||||||
|
"f.f.f.f.l.l.l.l.j.f.~ (.<X1X3X6X7X7X1X4X{.! ~ f.g.l.l.l.l.g.f.f.",
|
||||||
|
"l.l.l.l.l.l.l.l.l.l.Q A :.oX=X=X@X|.-.5X8X_.g.l.l.l.l.l.l.l.l.l.",
|
||||||
|
"l.l.l.l.l.l.l.l.l.N.! i / %X0X;X$Xn. X9X9XOXM.l.l.l.l.l.l.l.l.l.",
|
||||||
|
"l.l.l.l.l.l.l.l.N.@.G 6.b.~.^.^.!.H.!.&X-X.XB.M.l.l.l.l.l.l.l.l.",
|
||||||
|
"l.l.l.l.l.l.j.~ T Z n 2.>.v v v >.>.>.n.$X*X=X,XM.f.f.j.l.l.l.l.",
|
||||||
|
"l.l.l.l.l.g.~ U 4 u <.c l l l l l l l >.n.#X*X+X{ J E j.l.l.l.l.",
|
||||||
|
"h.l.h.h.l.j.G 4 u z <.t.t.q.q.q.V.S.q.,.v v./ ^ K F P j.l.h.l.l.",
|
||||||
|
"~ ~ ~ ~ j.l.Z @ y 1.x.G.T.I.U.U.I.R.R.A.3.a o 4 Y F P j.g.~ ~ ~ ",
|
||||||
|
"F F H E k.N.Z + p 1.t.G.L.P.K.I.L.L.T.A.3.a + V _.! P f.g.E H F ",
|
||||||
|
"H F F T [.4X[.4 c c 1.G.L.P.I.I.T.T.F.9.c b < ` 3X2X_.f.g.E F F ",
|
||||||
|
"~ J F #.pXgXtXh <.,.4.D.L.P.P.I.T.T.F.0.1.<.p $.fXfX2Xg.g.E F F ",
|
||||||
|
"j.E F | 3XdX<Xg <.3.,.Z.C.L.P.L.L.F.A.8.1.a.f | iXiX:Xk.j.E F F ",
|
||||||
|
"g.~ P ! B.:X#.S m b a 4.Z.F.L.L.L.C.0.c y D D } >X>XM.l.g.~ E Y ",
|
||||||
|
"l.g.g.g.k.{ { `.S ; < <.w.Z.F.Y.D.0.8.p + B /._. .M.l.l.l.g.g.g.",
|
||||||
|
"l.l.l.l.l.I ` 3X .# : p.w.9.r.Z.e.w.4.p o k ,X:XA g.l.l.l.l.l.l.",
|
||||||
|
"l.l.l.l.l.I ..6XXX7 - m 5.w.w.z.z.5.1.t # ( +X,XK g.l.l.l.l.l.l.",
|
||||||
|
"l.l.l.l.l.g.{ ' =.r @ t c w.w.4.w.3.p = 5 ./ { g.l.l.l.l.l.l.l.",
|
||||||
|
"j.f.f.f.j.l.f.K ^ # + p 5.w.8.9.1., . O 9 K Q l.l.l.l.l.f.f.~ ",
|
||||||
|
"g.E H E j.l.).} 4 o . < <.4.8.,.z o . 4 T k.l.l.l.l.g.W J H ",
|
||||||
|
"j.E F J f.k.R V Z V + o = b 5.5.c , o o 0 X.V V ~ j.j.l.g.E F F ",
|
||||||
|
"E J F P ! 8 & e uX}.d d ; t a.a.f ; y y +.sX}.6 d E ~ g.j.E F F ",
|
||||||
|
"F F F ! } 7 * ) qX'.g N 1 : m b 3 = z x } rX*.q 6 V F f.g.E F F ",
|
||||||
|
"H H E R e ] ] [ w h N N 1 + < : o - s M j w _ ;.[ 6 d f.g.~ J J ",
|
||||||
|
"f.f.k.@.) wXpX<XC j m.M N i = + > j M d.s.C :.pXtX_ 4 f.l.g.f.f.",
|
||||||
|
"l.l.l.(.&.;.O.) > n c.u.u.7.c c >.u.y.Q.d.> e O.%.+.G j.l.l.l.l.",
|
||||||
|
"l.l.l.N.#._ q O o u 7.i.J.E.E.E.E.J.i.u.n o $ V ! ~ g.l.l.l.l.",
|
||||||
|
"l.l.l.l.k.'.qXq O - 1 6.c.W.W.c.W.W.7.u @ O $ 8 Q j.g.l.l.l.l.l.",
|
||||||
|
"l.l.l.l.h.].rX*.6 X # A s.L u u x d.s.8 X & o.(.l.l.h.l.l.l.l.l.",
|
||||||
|
"l.l.l.l.l.l.].{.` 6 * 9 9 8 1 1 1 8 9 7 % e '.).l.l.l.l.l.l.l.l.",
|
||||||
|
"l.l.l.l.l.l.l.)._.%.& $ $ 2 G Q Z # * % 2 U N.l.l.l.l.l.l.l.l.l."
|
||||||
|
};
|
||||||
271
assets/wall.xpm
Executable file
271
assets/wall.xpm
Executable file
@@ -0,0 +1,271 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *de2d12bd2f574f4af4c3afc79c975912QuC4254oOeojB6bZ[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 233 2 ",
|
||||||
|
" c #05290C",
|
||||||
|
". c #07320B",
|
||||||
|
"X c #042712",
|
||||||
|
"o c #0B3613",
|
||||||
|
"O c #0B391E",
|
||||||
|
"+ c #0A351A",
|
||||||
|
"@ c #113E15",
|
||||||
|
"# c #103A1C",
|
||||||
|
"$ c #163519",
|
||||||
|
"% c #11240E",
|
||||||
|
"& c #1A2828",
|
||||||
|
"* c #093A26",
|
||||||
|
"= c #133D24",
|
||||||
|
"- c #1C3A25",
|
||||||
|
"; c #143B2C",
|
||||||
|
": c #18362B",
|
||||||
|
"> c #1B3B33",
|
||||||
|
", c #0E2F24",
|
||||||
|
"< c #283A2B",
|
||||||
|
"1 c #2B353A",
|
||||||
|
"2 c #283938",
|
||||||
|
"3 c #323C3B",
|
||||||
|
"4 c #232D2F",
|
||||||
|
"5 c #12491D",
|
||||||
|
"6 c #0B4016",
|
||||||
|
"7 c #1C6A1D",
|
||||||
|
"8 c #23721F",
|
||||||
|
"9 c #20661D",
|
||||||
|
"0 c #154324",
|
||||||
|
"q c #194324",
|
||||||
|
"w c #1B4A24",
|
||||||
|
"e c #15432B",
|
||||||
|
"r c #19442A",
|
||||||
|
"t c #1C4A2C",
|
||||||
|
"y c #1F552A",
|
||||||
|
"u c #1E4633",
|
||||||
|
"i c #1A4B35",
|
||||||
|
"p c #1A563A",
|
||||||
|
"a c #064228",
|
||||||
|
"s c #25452A",
|
||||||
|
"d c #25512D",
|
||||||
|
"f c #235A27",
|
||||||
|
"g c #234333",
|
||||||
|
"h c #254B34",
|
||||||
|
"j c #2A4D35",
|
||||||
|
"k c #264A39",
|
||||||
|
"l c #36423A",
|
||||||
|
"z c #2A5434",
|
||||||
|
"x c #2C5C33",
|
||||||
|
"c c #2C533B",
|
||||||
|
"v c #26593A",
|
||||||
|
"b c #335E3C",
|
||||||
|
"n c #38563A",
|
||||||
|
"m c #1E6328",
|
||||||
|
"M c #226725",
|
||||||
|
"N c #226A24",
|
||||||
|
"B c #24652C",
|
||||||
|
"V c #266C2D",
|
||||||
|
"C c #2B6B2E",
|
||||||
|
"Z c #28612A",
|
||||||
|
"A c #287528",
|
||||||
|
"S c #2B6A33",
|
||||||
|
"D c #296538",
|
||||||
|
"F c #34643C",
|
||||||
|
"G c #3D6C3C",
|
||||||
|
"H c #3B653F",
|
||||||
|
"J c #2E7733",
|
||||||
|
"K c #337A33",
|
||||||
|
"L c #367E38",
|
||||||
|
"P c #3C7D3B",
|
||||||
|
"I c #37733B",
|
||||||
|
"U c #357E2D",
|
||||||
|
"Y c #407A3D",
|
||||||
|
"T c #2F3D40",
|
||||||
|
"R c #323D41",
|
||||||
|
"E c #1D5C42",
|
||||||
|
"W c #1C5B48",
|
||||||
|
"Q c #3B4345",
|
||||||
|
"! c #364546",
|
||||||
|
"~ c #2C5642",
|
||||||
|
"^ c #235D44",
|
||||||
|
"/ c #2C5B42",
|
||||||
|
"( c #2D5C4C",
|
||||||
|
") c #235948",
|
||||||
|
"_ c #345C44",
|
||||||
|
"` c #375B47",
|
||||||
|
"' c #2D5B51",
|
||||||
|
"] c #1D6140",
|
||||||
|
"[ c #2C654A",
|
||||||
|
"{ c #2C6B4C",
|
||||||
|
"} c #276545",
|
||||||
|
"| c #356643",
|
||||||
|
" . c #3A6345",
|
||||||
|
".. c #3C654C",
|
||||||
|
"X. c #346C4C",
|
||||||
|
"o. c #3B6C4B",
|
||||||
|
"O. c #396847",
|
||||||
|
"+. c #3D7243",
|
||||||
|
"@. c #37714B",
|
||||||
|
"#. c #3B7748",
|
||||||
|
"$. c #2B6752",
|
||||||
|
"%. c #346552",
|
||||||
|
"&. c #366E52",
|
||||||
|
"*. c #3B6C54",
|
||||||
|
"=. c #3A6E59",
|
||||||
|
"-. c #376657",
|
||||||
|
";. c #3B7454",
|
||||||
|
":. c #3E7A52",
|
||||||
|
">. c #3D755B",
|
||||||
|
",. c #377858",
|
||||||
|
"<. c #2A7350",
|
||||||
|
"1. c #366A60",
|
||||||
|
"2. c #3D7061",
|
||||||
|
"3. c #424A49",
|
||||||
|
"4. c #494E54",
|
||||||
|
"5. c #55585B",
|
||||||
|
"6. c #48554C",
|
||||||
|
"7. c #426D4D",
|
||||||
|
"8. c #426449",
|
||||||
|
"9. c #437B44",
|
||||||
|
"0. c #42734D",
|
||||||
|
"q. c #437C4C",
|
||||||
|
"w. c #497E49",
|
||||||
|
"e. c #467846",
|
||||||
|
"r. c #446D52",
|
||||||
|
"t. c #4C6A56",
|
||||||
|
"y. c #466959",
|
||||||
|
"u. c #536B58",
|
||||||
|
"i. c #447253",
|
||||||
|
"p. c #4B7155",
|
||||||
|
"a. c #447B53",
|
||||||
|
"s. c #447A5B",
|
||||||
|
"d. c #4D7C5B",
|
||||||
|
"f. c #49775A",
|
||||||
|
"g. c #527B5D",
|
||||||
|
"h. c #587557",
|
||||||
|
"j. c #4F5A60",
|
||||||
|
"k. c #5C5D63",
|
||||||
|
"l. c #555A60",
|
||||||
|
"z. c #5A6166",
|
||||||
|
"x. c #4C7D61",
|
||||||
|
"c. c #447A63",
|
||||||
|
"v. c #527C63",
|
||||||
|
"b. c #5B7C65",
|
||||||
|
"n. c #537662",
|
||||||
|
"m. c #636469",
|
||||||
|
"M. c #627169",
|
||||||
|
"N. c #6A747A",
|
||||||
|
"B. c #6B797A",
|
||||||
|
"V. c #727679",
|
||||||
|
"C. c #2E842F",
|
||||||
|
"Z. c #35832E",
|
||||||
|
"A. c #2E8034",
|
||||||
|
"S. c #358435",
|
||||||
|
"D. c #3B8634",
|
||||||
|
"F. c #348A34",
|
||||||
|
"G. c #3B8A35",
|
||||||
|
"H. c #35843A",
|
||||||
|
"J. c #3C843A",
|
||||||
|
"K. c #3C8A3B",
|
||||||
|
"L. c #378A3B",
|
||||||
|
"P. c #408A35",
|
||||||
|
"I. c #43863C",
|
||||||
|
"U. c #428B3D",
|
||||||
|
"Y. c #3E8442",
|
||||||
|
"T. c #3D8C42",
|
||||||
|
"R. c #3E825D",
|
||||||
|
"E. c #438443",
|
||||||
|
"W. c #438B43",
|
||||||
|
"Q. c #4A8B4B",
|
||||||
|
"!. c #47864A",
|
||||||
|
"~. c #4E8253",
|
||||||
|
"^. c #4C845C",
|
||||||
|
"/. c #478756",
|
||||||
|
"(. c #528B54",
|
||||||
|
"). c #54845C",
|
||||||
|
"_. c #5A855D",
|
||||||
|
"`. c #538C5A",
|
||||||
|
"'. c #5B8D5E",
|
||||||
|
"]. c #548655",
|
||||||
|
"[. c #5B935C",
|
||||||
|
"{. c #579659",
|
||||||
|
"}. c #499453",
|
||||||
|
"|. c #609A5F",
|
||||||
|
" X c #608A5A",
|
||||||
|
".X c #448262",
|
||||||
|
"XX c #4C8262",
|
||||||
|
"oX c #4B8969",
|
||||||
|
"OX c #558364",
|
||||||
|
"+X c #538B64",
|
||||||
|
"@X c #5B8C63",
|
||||||
|
"#X c #53836B",
|
||||||
|
"$X c #5A856B",
|
||||||
|
"%X c #5D8767",
|
||||||
|
"&X c #5C9267",
|
||||||
|
"*X c #5E8872",
|
||||||
|
"=X c #64896A",
|
||||||
|
"-X c #659767",
|
||||||
|
";X c #6A8C7A",
|
||||||
|
":X c #668772",
|
||||||
|
">X c #76837E",
|
||||||
|
",X c #689973",
|
||||||
|
"<X c #7A9D7E",
|
||||||
|
"1X c #6DA36F",
|
||||||
|
"2X c #7C7B82",
|
||||||
|
"3X c #7B8888",
|
||||||
|
"4X c #6F9180",
|
||||||
|
"5X c #749786",
|
||||||
|
"6X c #7BA888",
|
||||||
|
"7X c #828B8F",
|
||||||
|
"8X c #839888",
|
||||||
|
"9X c #8F9997",
|
||||||
|
"0X c #84A887",
|
||||||
|
"qX c #85A593",
|
||||||
|
"wX c #8FB193",
|
||||||
|
"eX c #93BA96",
|
||||||
|
"rX c #8DB38A",
|
||||||
|
"tX c #99A4A0",
|
||||||
|
"yX c #ABBBB4",
|
||||||
|
"uX c #A5B0AC",
|
||||||
|
"iX c #9ECFA2",
|
||||||
|
"pX c #A9C6AB",
|
||||||
|
"aX c #AEDDB1",
|
||||||
|
"sX c #B4DBB6",
|
||||||
|
"dX c #ACD3AF",
|
||||||
|
"fX c #BFEABF",
|
||||||
|
"gX c #BFCCC2",
|
||||||
|
"hX c #B7E5C0",
|
||||||
|
"jX c #CDDFCF",
|
||||||
|
"kX c #D3DFDB",
|
||||||
|
"lX c #C7E9CD",
|
||||||
|
"zX c #CBEDD5",
|
||||||
|
"xX c #D8EAE0",
|
||||||
|
/* pixels */
|
||||||
|
"7 7 M C Y.J.K.F.Z.8 M Z x F 7.x _.@Xq.S B m B 9 Z.D.G.G.J.J B B ",
|
||||||
|
"N A N J Y.H.J.K.S.A C S x w b O.@ +.`.S B V M J U D.G.G.S.K V V ",
|
||||||
|
"S.H.L Y.Y.Y.T.H.J.K !.e.@ H ,X). .. F 9.f V J.K J.K.K.K.K.H.H.H.",
|
||||||
|
"K.K.W.J.K.K.J.Y.!.(.+.w 0.d.g.d.i. .d x +.S Y.W.K.K.J.J.K.K.K.T.",
|
||||||
|
"D.P.G.Z.K.S.Y.Q.~.F z i.g.v.f.OXs.@.0.d x q.!.!.T.L.J.J.K.J.J.D.",
|
||||||
|
"D.P.D.G.K.J.(.F o b g.*.d.XXx.;.:.X.O.O.b F ^./.}.T.K.K.I.I.I.J.",
|
||||||
|
"J.J.D.U.J.!.G q g.f.OXOX^.^.^.+X:.s.i.n.:X8.q @ /.Y.J.J.D.D.K.K.",
|
||||||
|
"Y.K.K.J.E.w.o j t...r.i.+X+X+X+XXXo..._ ` ` z 7.0.I P I.J.K.K.F.",
|
||||||
|
"L.L.S.K.E.].<Xu.X ; e 0 0 t q h r r = O O e j p.h.wXsX-XE.J.K.F.",
|
||||||
|
"J A.L K Q.,X%Xn u.y.*.s.o.| _ ..` ~ [ [ ^ | j $ n u.<XfX`.K C.C.",
|
||||||
|
"S B f w.h. s 8.n.$XXX/././.a.^.x.%.&.>.{ v ..:XM.< s sX[.C 9 7 ",
|
||||||
|
"M B f 7.wXt.- j p.XX:.:././.a.+XOXx.c.>.&.v c ` < l pXlX@XI M N ",
|
||||||
|
"H.V S ).eXqXs - = 0 w x F | | O.7.v | / i = g g t.j r.hX@XS B m ",
|
||||||
|
"K.J 5 | 7.c ` %X7.O.x d q t t t y y z b _ ..v.$X*X$Xt w q.q.S y ",
|
||||||
|
"P Y d # y.;X:XOX@X'.).@X&XXX;.XX+X,X&X&X+X:.;.s.#Xf. . b -Xe.I ",
|
||||||
|
"I.E.'.b X h .o.^.^._.OXf.XX.X;.s.a.a.).a.:.&.[ ^ e + q p.-X(.9.",
|
||||||
|
"J.P ~.).o h = O z b 7.d.x.x.x.s.f.7.o.i.| v p a * ^ *.c @ [.W.U.",
|
||||||
|
"E.Q.].. b OXi./ e t 0 O r r e p t r 0 q = O * i ) ) ~ O F -X{.J.",
|
||||||
|
" X].. z OXXX.X<.>..Xd.i.O.o.i.s.c.>.X.%.y.*.-.c.1.' * ; OX=X@X!.",
|
||||||
|
"s $ n p.*.;.,.<.,.R.oX^.a.d.OXXXoXoXs.*.#X#X=.$.1.-.( ; u .%X6X",
|
||||||
|
"s q 7.v.x.;.{ } ] } { @.^.^.o.@.{ ,.&.[ ;.>.$.W W W ) ( ~ n 8.h.",
|
||||||
|
"=Xz X ..v.$X&.[ { D } ;.s.@.D { ] } ^ p p E E W p } ) i ` b.h.8X",
|
||||||
|
"@.0.5 o i.$X$XOXs.X.s.s.;.o.X.&.$.$.E p E E ^ [ ^ ) %.=..., :XxX",
|
||||||
|
"B S q.+.o 0 _ p._ i.$X#X$X#X*.%.=.2.( ( =.*.=.>.=.>.*.k O b.zXlX",
|
||||||
|
"C I I q.(.~.d z < - g g g > : , : > , > u ` ~ e h r t r.<XpXsX%X",
|
||||||
|
"J.P L E.{.1X0XwX8X3X9X3X& 4 2 2 3 & ! ;Xy.g _ n...7.=XeXaXaX'.e.",
|
||||||
|
"K.D.W.W.#.w._.pXjXkXkXkX5.1 z.4.3.l : 4X5X6X$Xd.d.).-X`.(.{.P J.",
|
||||||
|
"G.K.D.J.(.-X=XpXgXuXyX7X& 4.m.k.5.5.& t.qX4X;Xb.g._.].9.P J.D.K.",
|
||||||
|
"F.K.K.Q.-XG n 6.< 3 1 1 4.l.5.k.5.4.4.4 3 Q l l < h.rX[.E.J.U.K.",
|
||||||
|
"G.K.S.Q.|.x n u.M.3XN.N.j.k.m.m.m.m.z.N.N.2X2XV.6.% eX-XI.J.D.D.",
|
||||||
|
"J.J.J.W.`.~.s < 3.Q R ! T 1 1 3 3 3 ! R Q R Q 3.6.0XiX{.Y.K.P.P.",
|
||||||
|
"I.J.J.Y.#.^.%Xu.M.B.3X3X3X3X>X3XB.>X7X3X3X7X9XtXpXwX1X!.Y.K.D.D."
|
||||||
|
};
|
||||||
256
assets/walle.xpm
Executable file
256
assets/walle.xpm
Executable file
@@ -0,0 +1,256 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *d229b57443f641a9a67c1e5632b0f398KmHrbkYPEa3XHUZT[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"32 32 218 2 ",
|
||||||
|
" c #2A2F24",
|
||||||
|
". c #2E3329",
|
||||||
|
"X c #353B2C",
|
||||||
|
"o c #383E2F",
|
||||||
|
"O c #363C36",
|
||||||
|
"+ c #144F3F",
|
||||||
|
"@ c #0E513C",
|
||||||
|
"# c #12553D",
|
||||||
|
"$ c #135C3B",
|
||||||
|
"% c #185F3E",
|
||||||
|
"& c #3C4333",
|
||||||
|
"* c #3E433D",
|
||||||
|
"= c #15613D",
|
||||||
|
"- c #1A653D",
|
||||||
|
"; c #1C683A",
|
||||||
|
": c #226F3C",
|
||||||
|
"> c #22723F",
|
||||||
|
", c #464E3A",
|
||||||
|
"< c #4B533E",
|
||||||
|
"1 c #313E4A",
|
||||||
|
"2 c #1F4243",
|
||||||
|
"3 c #154C41",
|
||||||
|
"4 c #1B4B43",
|
||||||
|
"5 c #0F5541",
|
||||||
|
"6 c #115541",
|
||||||
|
"7 c #145B43",
|
||||||
|
"8 c #1B5C44",
|
||||||
|
"9 c #155748",
|
||||||
|
"0 c #1A5449",
|
||||||
|
"q c #155B4A",
|
||||||
|
"w c #195C4B",
|
||||||
|
"e c #1D5C52",
|
||||||
|
"r c #244143",
|
||||||
|
"t c #34424C",
|
||||||
|
"y c #23594B",
|
||||||
|
"u c #2B594C",
|
||||||
|
"i c #3C4852",
|
||||||
|
"p c #245E51",
|
||||||
|
"a c #335858",
|
||||||
|
"s c #166342",
|
||||||
|
"d c #1B6444",
|
||||||
|
"f c #1D6B44",
|
||||||
|
"g c #16614D",
|
||||||
|
"h c #1B644B",
|
||||||
|
"j c #1E6B4B",
|
||||||
|
"k c #1F7145",
|
||||||
|
"l c #1E724C",
|
||||||
|
"z c #1A6451",
|
||||||
|
"x c #1C6852",
|
||||||
|
"c c #246642",
|
||||||
|
"v c #216D45",
|
||||||
|
"b c #24634B",
|
||||||
|
"n c #226D4B",
|
||||||
|
"m c #29684C",
|
||||||
|
"M c #316D4F",
|
||||||
|
"N c #247345",
|
||||||
|
"B c #257945",
|
||||||
|
"V c #297D45",
|
||||||
|
"C c #23744C",
|
||||||
|
"Z c #2C734D",
|
||||||
|
"A c #267A4D",
|
||||||
|
"S c #2A7B4C",
|
||||||
|
"D c #33774F",
|
||||||
|
"F c #276757",
|
||||||
|
"G c #2A6454",
|
||||||
|
"H c #236E53",
|
||||||
|
"J c #2C6C55",
|
||||||
|
"K c #2A665B",
|
||||||
|
"L c #336D53",
|
||||||
|
"P c #3C6C55",
|
||||||
|
"I c #366F5C",
|
||||||
|
"U c #3A6959",
|
||||||
|
"Y c #257452",
|
||||||
|
"T c #297552",
|
||||||
|
"R c #277953",
|
||||||
|
"E c #2A7C54",
|
||||||
|
"W c #2C755A",
|
||||||
|
"Q c #277C58",
|
||||||
|
"! c #2C7B58",
|
||||||
|
"~ c #337654",
|
||||||
|
"^ c #317C53",
|
||||||
|
"/ c #3B7B54",
|
||||||
|
"( c #3B725B",
|
||||||
|
") c #3A775C",
|
||||||
|
"_ c #347D5A",
|
||||||
|
"` c #366C60",
|
||||||
|
"' c #2A7960",
|
||||||
|
"] c #3A7661",
|
||||||
|
"[ c #414640",
|
||||||
|
"{ c #424A43",
|
||||||
|
"} c #454B49",
|
||||||
|
"| c #495642",
|
||||||
|
" . c #4C5944",
|
||||||
|
".. c #49534C",
|
||||||
|
"X. c #4F5B49",
|
||||||
|
"o. c #505D47",
|
||||||
|
"O. c #47445A",
|
||||||
|
"+. c #4C4B5F",
|
||||||
|
"@. c #49565A",
|
||||||
|
"#. c #565A5F",
|
||||||
|
"$. c #4E604C",
|
||||||
|
"%. c #566047",
|
||||||
|
"&. c #55624C",
|
||||||
|
"*. c #5B664D",
|
||||||
|
"=. c #5D684F",
|
||||||
|
"-. c #456B59",
|
||||||
|
";. c #4D6958",
|
||||||
|
":. c #556451",
|
||||||
|
">. c #5B6752",
|
||||||
|
",. c #5D6A51",
|
||||||
|
"<. c #58655B",
|
||||||
|
"1. c #566B5A",
|
||||||
|
"2. c #5E6B59",
|
||||||
|
"3. c #447455",
|
||||||
|
"4. c #43765E",
|
||||||
|
"5. c #4A715D",
|
||||||
|
"6. c #4B7C5F",
|
||||||
|
"7. c #55725C",
|
||||||
|
"8. c #5D735E",
|
||||||
|
"9. c #626E53",
|
||||||
|
"0. c #616E5C",
|
||||||
|
"q. c #667256",
|
||||||
|
"w. c #687457",
|
||||||
|
"e. c #66745A",
|
||||||
|
"r. c #64785F",
|
||||||
|
"t. c #6A785E",
|
||||||
|
"y. c #464A64",
|
||||||
|
"u. c #4D4C63",
|
||||||
|
"i. c #514962",
|
||||||
|
"p. c #4C5164",
|
||||||
|
"a. c #4A5963",
|
||||||
|
"s. c #43506B",
|
||||||
|
"d. c #4B546C",
|
||||||
|
"f. c #4C5A76",
|
||||||
|
"g. c #565972",
|
||||||
|
"h. c #446C65",
|
||||||
|
"j. c #4C6964",
|
||||||
|
"k. c #566669",
|
||||||
|
"l. c #447463",
|
||||||
|
"z. c #4C7062",
|
||||||
|
"x. c #467768",
|
||||||
|
"c. c #4C7C6A",
|
||||||
|
"v. c #527567",
|
||||||
|
"b. c #597965",
|
||||||
|
"n. c #547B6B",
|
||||||
|
"m. c #5B7C6B",
|
||||||
|
"M. c #4E607D",
|
||||||
|
"N. c #536473",
|
||||||
|
"B. c #5E6C72",
|
||||||
|
"V. c #54647B",
|
||||||
|
"C. c #576A7D",
|
||||||
|
"Z. c #4D7573",
|
||||||
|
"A. c #5B777A",
|
||||||
|
"S. c #5D737C",
|
||||||
|
"D. c #60696D",
|
||||||
|
"F. c #647464",
|
||||||
|
"G. c #637A64",
|
||||||
|
"H. c #6B7A63",
|
||||||
|
"J. c #637B6B",
|
||||||
|
"K. c #6C7C6B",
|
||||||
|
"L. c #727F66",
|
||||||
|
"P. c #727D6B",
|
||||||
|
"I. c #636779",
|
||||||
|
"U. c #637675",
|
||||||
|
"Y. c #637E74",
|
||||||
|
"T. c #6B757C",
|
||||||
|
"R. c #71797A",
|
||||||
|
"E. c #2D8346",
|
||||||
|
"W. c #2D814B",
|
||||||
|
"Q. c #31854D",
|
||||||
|
"!. c #34894B",
|
||||||
|
"~. c #2D8353",
|
||||||
|
"^. c #2F8359",
|
||||||
|
"/. c #378566",
|
||||||
|
"(. c #4C826C",
|
||||||
|
"). c #578363",
|
||||||
|
"_. c #4E8E72",
|
||||||
|
"`. c #558678",
|
||||||
|
"'. c #69846B",
|
||||||
|
"]. c #6B816C",
|
||||||
|
"[. c #73826D",
|
||||||
|
"{. c #628476",
|
||||||
|
"}. c #738471",
|
||||||
|
"|. c #76887C",
|
||||||
|
" X c #556882",
|
||||||
|
".X c #5B7486",
|
||||||
|
"XX c #626784",
|
||||||
|
"oX c #6B6C85",
|
||||||
|
"OX c #677888",
|
||||||
|
"+X c #65798B",
|
||||||
|
"@X c #737B87",
|
||||||
|
"#X c #667890",
|
||||||
|
"$X c #777E93",
|
||||||
|
"%X c #698C82",
|
||||||
|
"&X c #76878A",
|
||||||
|
"*X c #6C9A89",
|
||||||
|
"=X c #769489",
|
||||||
|
"-X c #788695",
|
||||||
|
";X c #779692",
|
||||||
|
":X c #779C96",
|
||||||
|
">X c #7B9C93",
|
||||||
|
",X c #7C9C9A",
|
||||||
|
"<X c #7AA0A3",
|
||||||
|
"1X c #829485",
|
||||||
|
"2X c #84889C",
|
||||||
|
"3X c #8B9A93",
|
||||||
|
"4X c #869F99",
|
||||||
|
"5X c #87A39B",
|
||||||
|
"6X c #8D9CAC",
|
||||||
|
"7X c #969CA5",
|
||||||
|
"8X c #84A6A5",
|
||||||
|
"9X c #95A6A5",
|
||||||
|
"0X c #96A7B6",
|
||||||
|
"qX c #9EB0B4",
|
||||||
|
"wX c #A3B7B7",
|
||||||
|
"eX c #A2B9C2",
|
||||||
|
"rX c #AAC2CA",
|
||||||
|
"tX c #B3CCD3",
|
||||||
|
/* pixels */
|
||||||
|
"| | | &.q.w.w.w.9.X.| | | o.e.].].t.q.&.| | | .,.w.w.w.q.&. .| ",
|
||||||
|
"o.o.o.&.q.w.w.q.9.&.o. . .&.G.'.{.].r.&.| .o.o.9.w.w.w.q.&.o.o.",
|
||||||
|
"9.9.9.q.q.w.w.w.q.9.9.&.$.7.).6.4.n.J.&.| o.9.9.q.w.w.w.q.q.9.9.",
|
||||||
|
"w.w.w.w.w.w.w.w.w.w.e.1.;.3./ / M L -.1.X.&.q.w.w.w.w.w.w.w.w.w.",
|
||||||
|
"w.w.w.w.w.w.w.w.w.r.b.z.( ~ ~ ~ Z m L 6.7.,.e.w.w.w.w.w.w.w.w.w.",
|
||||||
|
"w.w.w.w.w.w.w.t.H.b.l.I ~ ^ S Z C n b L 4.7.G.H.H.w.w.w.w.w.w.w.",
|
||||||
|
"w.w.w.w.w.q.e.].m.4.~ ^ S W.E.E.S n n T _ ) c.m.].e.9.q.w.w.w.w.",
|
||||||
|
"w.w.w.w.w.q.2.Y.c.L Z S W.E.E.E.S Y j j n J x.m.G.,.0.q.w.w.w.w.",
|
||||||
|
"q.w.q.q.w.w.K.=X`.b 8 f l k f N f d 7 7 # 8 ] b.F.|.3X}.w.q.q.w.",
|
||||||
|
"=.,.=.,.e.K.=X:X`.J j C C j f n j 7 # # # # G c.%X5XwX9XH.,.,.,.",
|
||||||
|
" . . .o.F.&X{.l.) ^ E S W.S B S Y j h j h # 8 ] c.n.,XwXP.&. . .",
|
||||||
|
" . .| o.H.4X*X( c N B N B V B S E Y C n s # # b J l.8XrX[.&.| | ",
|
||||||
|
",.o. .:.[.5X*X) c - ; ; ; f n C R N v v d % s h J (.>XwX[.&. .| ",
|
||||||
|
"q.&.:.J.=X*X_._ S N : > N v j C A S S W.S v C ! /./.`.;X}.2.X.| ",
|
||||||
|
"q.,.F.Y.c.] _ ~.W.E.E.E.S S C C W.Q.!.!.Q.B N C Q H b ( n.Y.0.&.",
|
||||||
|
"q.q.H.].5.b d ; N V W.Q.Q.~.E C B V V W.S C f = 7 7 6 p h.Y.P.e.",
|
||||||
|
"w.w.w.H.b.b 8 # $ - v v C C C C k ; ; f d $ # @ @ 6 w G m.].L.w.",
|
||||||
|
"w.w.t.r.b.) Y h s d d d d f k C A N d d s 6 6 6 6 6 e K n.}.[.w.",
|
||||||
|
"t.H.].b.( ! Q l j C R T C N A ~.^.^.C n H H h z z q 9 y 5.K.[.H.",
|
||||||
|
"G.v.l.I H C l f f C E E S C A R E ! Y n W ' x g z g 9 0 P 8.|.1X",
|
||||||
|
"G.v.U J W Y l s $ = d f Y R n f d j h 8 h H h 7 6 5 @ + u z.:XrX",
|
||||||
|
"H.b.-.U L E A f - = s f C n d s 7 7 6 # # # 6 @ @ 6 6 3 y z.,XtX",
|
||||||
|
">.&.:.5.P D ^ S B v N T Y n d d h g 6 @ 6 6 7 q 7 q h p u x.8XtX",
|
||||||
|
" . .1.7.5.3./ / Z c T W W W b 8 w z q 9 h z z x F G F ` h.=XeXqX",
|
||||||
|
" .o.:.2.G.J.n.c.l.( x.x.` p 4 4 3 0 e K K K K I l.l.x.`.;X9X9XK.",
|
||||||
|
"9.9.9.9.9.0.<.U.;X,X8X<XA.a r r 2 2 a Z.Z.h.h.j.;.1.J.|.3X3XP.9.",
|
||||||
|
"w.q.9.%.& X O k.qXrXrXeX-Xa.i i t 1 @.B.U.B.k...{ { } { >.t.q.q.",
|
||||||
|
"9.*., X . O } T.6X0X0X6XOXp.u.+.O.O.+.I.@X@XT.I.#.} * . o | 9.w.",
|
||||||
|
"*.< o O D.OXOXOXOX XV.d.y.u.i.i.O.O.u.g.I.I.oXoX$X&X[ X .*.*.",
|
||||||
|
"9.=.< o * k.B.N.V. XM.f.s.y.u.p.p.p.d.d.f.V.V.XXoX2X7X<.& & , & ",
|
||||||
|
"w.q.9.=.,.2.<.@.a.V.C. XV.N.N.k.N.N.C..X.X.X#X$X$X2X7XP.=.*.*.*.",
|
||||||
|
"w.w.w.w.w.9.&.X...@.N.C.S.S.U.S.N.N.S.OX.XOX#X&X@XR.P.t.w.w.w.w."
|
||||||
|
};
|
||||||
112
get_next_line/get_next_line.c
Executable file
112
get_next_line/get_next_line.c
Executable file
@@ -0,0 +1,112 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* get_next_line.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/23 12:07:52 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/02/15 09:56:00 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "get_next_line.h"
|
||||||
|
|
||||||
|
char *ft_free(char *buffer, char *buf)
|
||||||
|
{
|
||||||
|
char *temp;
|
||||||
|
|
||||||
|
temp = ft_strjoin(buffer, buf);
|
||||||
|
free(buffer);
|
||||||
|
return (temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *ft_get_line(char *save)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char *new;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
if (!save[i])
|
||||||
|
return (NULL);
|
||||||
|
while (save[i] && save[i] != '\n')
|
||||||
|
i++;
|
||||||
|
new = ft_calloc(sizeof(char), i + 2);
|
||||||
|
if (new == NULL)
|
||||||
|
return (NULL);
|
||||||
|
i = 0;
|
||||||
|
while (save[i] && save[i] != '\n')
|
||||||
|
{
|
||||||
|
new[i] = save[i];
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (save[i] && save[i] == '\n')
|
||||||
|
new[i++] = '\n';
|
||||||
|
return (new);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *ft_next(char *save)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int j;
|
||||||
|
char *line;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (save[i] && save[i] != '\n')
|
||||||
|
i++;
|
||||||
|
if (!save[i])
|
||||||
|
{
|
||||||
|
free(save);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
line = ft_calloc((ft_strlen(save) - i + 1), sizeof(char));
|
||||||
|
i++;
|
||||||
|
j = 0;
|
||||||
|
while (save[i])
|
||||||
|
line[j++] = save[i++];
|
||||||
|
free(save);
|
||||||
|
return (line);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *read_file(int fd, char *save)
|
||||||
|
{
|
||||||
|
int bytes_read;
|
||||||
|
char *buffer;
|
||||||
|
|
||||||
|
if (!save)
|
||||||
|
save = ft_calloc(1, 1);
|
||||||
|
buffer = ft_calloc(BUFFER_SIZE + 1, sizeof(char));
|
||||||
|
if (buffer == NULL)
|
||||||
|
return (NULL);
|
||||||
|
bytes_read = 1;
|
||||||
|
while (bytes_read > 0)
|
||||||
|
{
|
||||||
|
bytes_read = read(fd, buffer, BUFFER_SIZE);
|
||||||
|
if (bytes_read == -1)
|
||||||
|
{
|
||||||
|
free(buffer);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
buffer[bytes_read] = 0;
|
||||||
|
save = ft_free(save, buffer);
|
||||||
|
if (ft_strchr(buffer, '\n'))
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
free(buffer);
|
||||||
|
return (save);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *get_next_line(int fd)
|
||||||
|
{
|
||||||
|
static char *save;
|
||||||
|
char *line;
|
||||||
|
|
||||||
|
if (fd < 0 || BUFFER_SIZE <= 0 || read(fd, 0, 0) < 0)
|
||||||
|
return (0);
|
||||||
|
save = read_file(fd, save);
|
||||||
|
if (save == NULL)
|
||||||
|
return (NULL);
|
||||||
|
line = ft_get_line(save);
|
||||||
|
save = ft_next(save);
|
||||||
|
return (line);
|
||||||
|
}
|
||||||
31
get_next_line/get_next_line.h
Executable file
31
get_next_line/get_next_line.h
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* get_next_line.h :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/23 12:07:56 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/02/15 09:56:03 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#ifndef GET_NEXT_LINE_H
|
||||||
|
# define GET_NEXT_LINE_H
|
||||||
|
|
||||||
|
# ifndef BUFFER_SIZE
|
||||||
|
# define BUFFER_SIZE 1
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <fcntl.h>
|
||||||
|
# include <unistd.h>
|
||||||
|
|
||||||
|
char *get_next_line(int fd);
|
||||||
|
size_t ft_strlen(const char *s);
|
||||||
|
void *ft_calloc(size_t n, size_t size);
|
||||||
|
char *ft_strjoin(char const *s1, char const *s2);
|
||||||
|
char *ft_strchr(const char *s, int c);
|
||||||
|
void ft_bzero(void *s, size_t n);
|
||||||
|
|
||||||
|
#endif
|
||||||
89
get_next_line/get_next_line_utils.c
Executable file
89
get_next_line/get_next_line_utils.c
Executable file
@@ -0,0 +1,89 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* get_next_line_utils.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/23 12:07:48 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/02/15 09:55:55 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "get_next_line.h"
|
||||||
|
|
||||||
|
void ft_bzero(void *s, size_t n)
|
||||||
|
{
|
||||||
|
char *str;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
str = (char *)s;
|
||||||
|
i = 0;
|
||||||
|
while (i < n)
|
||||||
|
{
|
||||||
|
str[i] = '\0';
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void *ft_calloc(size_t n, size_t size)
|
||||||
|
{
|
||||||
|
char *ptr;
|
||||||
|
|
||||||
|
ptr = malloc(n * size);
|
||||||
|
if (!ptr)
|
||||||
|
return (NULL);
|
||||||
|
ft_bzero(ptr, n * size);
|
||||||
|
return (ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t ft_strlen(const char *str)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (str[i])
|
||||||
|
i++;
|
||||||
|
return (i);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *ft_strchr(const char *s, int c)
|
||||||
|
{
|
||||||
|
char *str;
|
||||||
|
|
||||||
|
str = (char *)s;
|
||||||
|
while (*str != c && *str != 0)
|
||||||
|
str++;
|
||||||
|
if (*str == c)
|
||||||
|
return (str);
|
||||||
|
else
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *ft_strjoin(char const *s1, char const *s2)
|
||||||
|
{
|
||||||
|
char *new;
|
||||||
|
int i;
|
||||||
|
int len1;
|
||||||
|
int len2;
|
||||||
|
|
||||||
|
len1 = ft_strlen(s1);
|
||||||
|
len2 = ft_strlen(s2);
|
||||||
|
new = (char *)malloc(sizeof(char) * (len1 + len2 + 1));
|
||||||
|
if (!new || !s1 || !s2)
|
||||||
|
return (NULL);
|
||||||
|
i = 0;
|
||||||
|
while (s1[i] != 0)
|
||||||
|
{
|
||||||
|
new[i] = s1[i];
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while (s2[i] != 0)
|
||||||
|
{
|
||||||
|
new[len1 + i] = s2[i];
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
new[len1 + len2] = '\0';
|
||||||
|
return (new);
|
||||||
|
}
|
||||||
7
maps/map.ber
Executable file
7
maps/map.ber
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
1111111111111111111111111111111111
|
||||||
|
10C0000C000000000000C0000C00000001
|
||||||
|
1P0000000C00000000C000000000000001
|
||||||
|
1E00000000000000000000000C00000001
|
||||||
|
10000000C000000000C000000000000001
|
||||||
|
1000000000C00C000000000000C000C0C1
|
||||||
|
1111111111111111111111111111111111
|
||||||
5
maps/map_error.ber
Normal file
5
maps/map_error.ber
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
111111111111111
|
||||||
|
100000000000001
|
||||||
|
100000C00000E01
|
||||||
|
10P000000000000
|
||||||
|
111111111111111
|
||||||
25
minilibx/LICENSE
Executable file
25
minilibx/LICENSE
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
BSD 2-Clause License
|
||||||
|
|
||||||
|
Copyright (c) 2021, Ecole 42
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
22
minilibx/Makefile
Executable file
22
minilibx/Makefile
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
##
|
||||||
|
## Makefile for MiniLibX in /home/boulon/work/c/raytraceur/minilibx
|
||||||
|
##
|
||||||
|
## Made by Olivier Crouzet
|
||||||
|
## Login <ol@epitech.net>
|
||||||
|
##
|
||||||
|
## Started on Tue Oct 5 15:56:43 2004 Olivier Crouzet
|
||||||
|
## Last update Tue May 15 15:44:41 2007 Olivier Crouzet
|
||||||
|
##
|
||||||
|
|
||||||
|
## Please use configure script
|
||||||
|
|
||||||
|
|
||||||
|
all : do_configure
|
||||||
|
|
||||||
|
do_configure :
|
||||||
|
./configure
|
||||||
|
|
||||||
|
clean :
|
||||||
|
./configure clean
|
||||||
|
|
||||||
|
re : clean all
|
||||||
66
minilibx/Makefile.gen
Executable file
66
minilibx/Makefile.gen
Executable file
@@ -0,0 +1,66 @@
|
|||||||
|
INC=/usr/include
|
||||||
|
##
|
||||||
|
## Makefile for MiniLibX in /home/boulon/work/c/raytraceur/minilibx
|
||||||
|
##
|
||||||
|
## Made by Olivier Crouzet
|
||||||
|
## Login <ol@epitech.net>
|
||||||
|
##
|
||||||
|
## Started on Tue Oct 5 15:56:43 2004 Olivier Crouzet
|
||||||
|
## Last update Tue May 15 15:41:20 2007 Olivier Crouzet
|
||||||
|
##
|
||||||
|
|
||||||
|
## Please use configure script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
UNAME = $(shell uname)
|
||||||
|
CC = gcc
|
||||||
|
ifeq ($(UNAME),FreeBSD)
|
||||||
|
CC = clang
|
||||||
|
endif
|
||||||
|
|
||||||
|
NAME = libmlx.a
|
||||||
|
NAME_UNAME = libmlx_$(UNAME).a
|
||||||
|
|
||||||
|
SRC = mlx_init.c mlx_new_window.c mlx_pixel_put.c mlx_loop.c \
|
||||||
|
mlx_mouse_hook.c mlx_key_hook.c mlx_expose_hook.c mlx_loop_hook.c \
|
||||||
|
mlx_int_anti_resize_win.c mlx_int_do_nothing.c \
|
||||||
|
mlx_int_wait_first_expose.c mlx_int_get_visual.c \
|
||||||
|
mlx_flush_event.c mlx_string_put.c mlx_set_font.c \
|
||||||
|
mlx_new_image.c mlx_get_data_addr.c \
|
||||||
|
mlx_put_image_to_window.c mlx_get_color_value.c mlx_clear_window.c \
|
||||||
|
mlx_xpm.c mlx_int_str_to_wordtab.c mlx_destroy_window.c \
|
||||||
|
mlx_int_param_event.c mlx_int_set_win_event_mask.c mlx_hook.c \
|
||||||
|
mlx_rgb.c mlx_destroy_image.c mlx_mouse.c mlx_screen_size.c \
|
||||||
|
mlx_destroy_display.c
|
||||||
|
|
||||||
|
OBJ_DIR = obj
|
||||||
|
OBJ = $(addprefix $(OBJ_DIR)/,$(SRC:%.c=%.o))
|
||||||
|
CFLAGS = -O3 -I$(INC)
|
||||||
|
|
||||||
|
all : $(NAME)
|
||||||
|
|
||||||
|
$(OBJ_DIR)/%.o: %.c
|
||||||
|
@mkdir -p $(OBJ_DIR)
|
||||||
|
$(CC) $(CFLAGS) $(IFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
$(NAME) : $(OBJ)
|
||||||
|
ar -r $(NAME) $(OBJ)
|
||||||
|
ranlib $(NAME)
|
||||||
|
cp $(NAME) $(NAME_UNAME)
|
||||||
|
|
||||||
|
check: all
|
||||||
|
@test/run_tests.sh
|
||||||
|
|
||||||
|
show:
|
||||||
|
@printf "NAME : $(NAME)\n"
|
||||||
|
@printf "NAME_UNAME : $(NAME_UNAME)\n"
|
||||||
|
@printf "CC : $(CC)\n"
|
||||||
|
@printf "CFLAGS : $(CFLAGS)\n"
|
||||||
|
@printf "SRC :\n $(SRC)\n"
|
||||||
|
@printf "OBJ :\n $(OBJ)\n"
|
||||||
|
|
||||||
|
clean :
|
||||||
|
rm -rf $(OBJ_DIR)/ $(NAME) $(NAME_UNAME) *~ core *.core
|
||||||
|
|
||||||
|
.PHONY: all check show clean
|
||||||
66
minilibx/Makefile.mk
Executable file
66
minilibx/Makefile.mk
Executable file
@@ -0,0 +1,66 @@
|
|||||||
|
##
|
||||||
|
## Makefile for MiniLibX in /home/boulon/work/c/raytraceur/minilibx
|
||||||
|
##
|
||||||
|
## Made by Olivier Crouzet
|
||||||
|
## Login <ol@epitech.net>
|
||||||
|
##
|
||||||
|
## Started on Tue Oct 5 15:56:43 2004 Olivier Crouzet
|
||||||
|
## Last update Tue May 15 15:41:20 2007 Olivier Crouzet
|
||||||
|
##
|
||||||
|
|
||||||
|
## Please use configure script
|
||||||
|
|
||||||
|
|
||||||
|
INC =%%%%
|
||||||
|
|
||||||
|
UNAME = $(shell uname)
|
||||||
|
CC = gcc
|
||||||
|
ifeq ($(UNAME),FreeBSD)
|
||||||
|
CC = clang
|
||||||
|
endif
|
||||||
|
|
||||||
|
NAME = libmlx.a
|
||||||
|
NAME_UNAME = libmlx_$(UNAME).a
|
||||||
|
|
||||||
|
SRC = mlx_init.c mlx_new_window.c mlx_pixel_put.c mlx_loop.c \
|
||||||
|
mlx_mouse_hook.c mlx_key_hook.c mlx_expose_hook.c mlx_loop_hook.c \
|
||||||
|
mlx_int_anti_resize_win.c mlx_int_do_nothing.c \
|
||||||
|
mlx_int_wait_first_expose.c mlx_int_get_visual.c \
|
||||||
|
mlx_flush_event.c mlx_string_put.c mlx_set_font.c \
|
||||||
|
mlx_new_image.c mlx_get_data_addr.c \
|
||||||
|
mlx_put_image_to_window.c mlx_get_color_value.c mlx_clear_window.c \
|
||||||
|
mlx_xpm.c mlx_int_str_to_wordtab.c mlx_destroy_window.c \
|
||||||
|
mlx_int_param_event.c mlx_int_set_win_event_mask.c mlx_hook.c \
|
||||||
|
mlx_rgb.c mlx_destroy_image.c mlx_mouse.c mlx_screen_size.c \
|
||||||
|
mlx_destroy_display.c
|
||||||
|
|
||||||
|
OBJ_DIR = obj
|
||||||
|
OBJ = $(addprefix $(OBJ_DIR)/,$(SRC:%.c=%.o))
|
||||||
|
CFLAGS = -O3 -I$(INC)
|
||||||
|
|
||||||
|
all : $(NAME)
|
||||||
|
|
||||||
|
$(OBJ_DIR)/%.o: %.c
|
||||||
|
@mkdir -p $(OBJ_DIR)
|
||||||
|
$(CC) $(CFLAGS) $(IFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
$(NAME) : $(OBJ)
|
||||||
|
ar -r $(NAME) $(OBJ)
|
||||||
|
ranlib $(NAME)
|
||||||
|
cp $(NAME) $(NAME_UNAME)
|
||||||
|
|
||||||
|
check: all
|
||||||
|
@test/run_tests.sh
|
||||||
|
|
||||||
|
show:
|
||||||
|
@printf "NAME : $(NAME)\n"
|
||||||
|
@printf "NAME_UNAME : $(NAME_UNAME)\n"
|
||||||
|
@printf "CC : $(CC)\n"
|
||||||
|
@printf "CFLAGS : $(CFLAGS)\n"
|
||||||
|
@printf "SRC :\n $(SRC)\n"
|
||||||
|
@printf "OBJ :\n $(OBJ)\n"
|
||||||
|
|
||||||
|
clean :
|
||||||
|
rm -rf $(OBJ_DIR)/ $(NAME) $(NAME_UNAME) *~ core *.core
|
||||||
|
|
||||||
|
.PHONY: all check show clean
|
||||||
55
minilibx/README.md
Executable file
55
minilibx/README.md
Executable file
@@ -0,0 +1,55 @@
|
|||||||
|
[](https://github.com/42Paris/minilibx-linux/actions/workflows/ci.yml)
|
||||||
|
|
||||||
|
This is the MinilibX, a simple X-Window (X11R6) programming API
|
||||||
|
in C, designed for students, suitable for X-beginners.
|
||||||
|
|
||||||
|
|
||||||
|
Contents
|
||||||
|
|
||||||
|
- source code in C to create the mlx library
|
||||||
|
- man pages (in man/ directory)
|
||||||
|
- a test program (in test/ directory) is built
|
||||||
|
with the library
|
||||||
|
- a public include file mlx.h
|
||||||
|
- a tiny configure script to generate an appropriate Makefile.gen
|
||||||
|
|
||||||
|
Requirements for Linux
|
||||||
|
|
||||||
|
- MinilibX only support TrueColor visual type (8,15,16,24 or 32 bits depth)
|
||||||
|
- gcc
|
||||||
|
- make
|
||||||
|
- X11 include files (package xorg)
|
||||||
|
- XShm extension must be present (package libxext-dev)
|
||||||
|
- Utility functions from BSD systems - development files (package libbsd-dev)
|
||||||
|
- **e.g. _sudo apt-get install gcc make xorg libxext-dev libbsd-dev_ (Debian/Ubuntu)**
|
||||||
|
|
||||||
|
Requirements for MacOS
|
||||||
|
- [Xquartz](https://www.xquartz.org/)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
➜ ~ Brew install Xquartz
|
||||||
|
➜ ~ reboot
|
||||||
|
➜ ~ xeyes # run an hello world X11 app
|
||||||
|
```
|
||||||
|
|
||||||
|
MlX Color Opacity / Transparency / Alpha (32 bits depth)
|
||||||
|
- 0xFF (fully transparent) or 0x00 (fully opaque)
|
||||||
|
|
||||||
|
Compile MinilibX
|
||||||
|
|
||||||
|
- run ./configure or make
|
||||||
|
both will make a few tests, create Makefile.gen
|
||||||
|
and then automatically run make on this generated Makefile.gen .
|
||||||
|
libmlx.a and libmlx_$(HOSTTYPE).a are created.
|
||||||
|
test/mlx-test binary is also created.
|
||||||
|
|
||||||
|
|
||||||
|
Install MinilibX
|
||||||
|
|
||||||
|
- no installation script is provided. You may want to install
|
||||||
|
- libmlx.a and/or libmlx_$(HOSTTYPE).a in /usr/X11/lib or /usr/local/lib
|
||||||
|
- mlx.h in /usr/X11/include or /usr/local/include
|
||||||
|
- man/man3/mlx*.1 in /usr/X11/man/man3 or /usr/local/man/man3
|
||||||
|
|
||||||
|
|
||||||
|
Olivier CROUZET - 2014-01-06 -
|
||||||
126
minilibx/configure
vendored
Executable file
126
minilibx/configure
vendored
Executable file
@@ -0,0 +1,126 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
BOLD="\033[1m"
|
||||||
|
RESET="\033[0m"
|
||||||
|
LIGHT_RED="\033[91m"
|
||||||
|
LIGHT_GREEN="\033[92m"
|
||||||
|
LIGHT_CYAN="\033[96m"
|
||||||
|
|
||||||
|
logging(){
|
||||||
|
local type=$1; shift
|
||||||
|
printf "${LIGHT_CYAN}${BOLD}configure${RESET} [%b] : %b\n" "$type" "$*"
|
||||||
|
}
|
||||||
|
log_info(){
|
||||||
|
logging "${LIGHT_GREEN}info${RESET}" "$@"
|
||||||
|
}
|
||||||
|
log_error(){
|
||||||
|
logging "${LIGHT_RED}error${RESET}" "$@" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
# find and print x11 header path
|
||||||
|
get_xlib_include_path(){
|
||||||
|
local result=""
|
||||||
|
|
||||||
|
for inc in \
|
||||||
|
/usr/X11/include \
|
||||||
|
/usr/X11R6/include \
|
||||||
|
/usr/X11R5/include \
|
||||||
|
/usr/X11R4/include \
|
||||||
|
\
|
||||||
|
/usr/include \
|
||||||
|
/usr/include/X11 \
|
||||||
|
/usr/include/X11R6 \
|
||||||
|
/usr/include/X11R5 \
|
||||||
|
/usr/include/X11R4 \
|
||||||
|
\
|
||||||
|
/usr/local/X11/include \
|
||||||
|
/usr/local/X11R6/include \
|
||||||
|
/usr/local/X11R5/include \
|
||||||
|
/usr/local/X11R4/include \
|
||||||
|
\
|
||||||
|
/usr/local/include/X11 \
|
||||||
|
/usr/local/include/X11R6 \
|
||||||
|
/usr/local/include/X11R5 \
|
||||||
|
/usr/local/include/X11R4 \
|
||||||
|
\
|
||||||
|
/usr/X386/include \
|
||||||
|
/usr/x386/include \
|
||||||
|
/usr/XFree86/include/X11 \
|
||||||
|
\
|
||||||
|
/usr/local/include \
|
||||||
|
/usr/athena/include \
|
||||||
|
/usr/local/x11r5/include \
|
||||||
|
/usr/lpp/Xamples/include \
|
||||||
|
\
|
||||||
|
/usr/openwin/include \
|
||||||
|
/usr/openwin/share/include
|
||||||
|
do
|
||||||
|
if [ -f "$inc/X11/Xlib.h" -a -f "$inc/X11/extensions/XShm.h" ]; then
|
||||||
|
result=$inc
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo $result
|
||||||
|
}
|
||||||
|
|
||||||
|
show_help(){
|
||||||
|
cat <<EOF
|
||||||
|
Usage :
|
||||||
|
$0 Auto-configure and make MinilibX
|
||||||
|
$0 clean Execute the clean rule of both Makefile.gen
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
clean(){
|
||||||
|
log_info 'Execute "make clean" from "makefile.gen"'
|
||||||
|
${MAKE} -f Makefile.gen clean
|
||||||
|
log_info 'Execute "make clean" from "test/makefile.gen"'
|
||||||
|
${MAKE} -f Makefile.gen -C test/ --no-print-directory clean
|
||||||
|
}
|
||||||
|
|
||||||
|
parse_args(){
|
||||||
|
case "$1" in
|
||||||
|
--help | -h)
|
||||||
|
show_help
|
||||||
|
exit 0;;
|
||||||
|
clean)
|
||||||
|
clean
|
||||||
|
exit 0;;
|
||||||
|
"") return;;
|
||||||
|
*)
|
||||||
|
log_error "unknown command \"$1\"\nRun \"./configure --help\" for usage."
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
main(){
|
||||||
|
local xlib_inc="$(get_xlib_include_path)"
|
||||||
|
|
||||||
|
case $(uname) in
|
||||||
|
FreeBSD) MAKE=gmake ;;
|
||||||
|
*) MAKE=make ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
parse_args "$@"
|
||||||
|
if [ -z "$xlib_inc" ]; then
|
||||||
|
log_error "Can't find a suitable X11 include directory."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
log_info "Found X11 include path directory: $xlib_inc"
|
||||||
|
|
||||||
|
log_info 'Generate "makefile.gen" from template "makefile.mk"'
|
||||||
|
echo "INC=$xlib_inc" > Makefile.gen
|
||||||
|
cat Makefile.mk | grep -v %%%% >> Makefile.gen
|
||||||
|
log_info 'Generate "test/makefile.gen" from template "test/makefile.mk"'
|
||||||
|
echo "INC=$xlib_inc" > test/Makefile.gen
|
||||||
|
cat test/Makefile.mk | grep -v %%%% >> test/Makefile.gen
|
||||||
|
|
||||||
|
log_info 'Execute "make all" from file "makefile.gen"'
|
||||||
|
${MAKE} -f Makefile.gen all
|
||||||
|
log_info 'Execute "make all" from file "test/makefile.gen"'
|
||||||
|
(cd test ; ${MAKE} -f Makefile.gen all )
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
93
minilibx/man/man1/mlx.1
Executable file
93
minilibx/man/man1/mlx.1
Executable file
@@ -0,0 +1,93 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Simple X-Window Interface Library for students
|
||||||
|
.SH SYNOPSYS
|
||||||
|
#include <mlx.h>
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_init
|
||||||
|
();
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
MiniLibX is an easy way to create graphical software,
|
||||||
|
without any X-Window programming knowledge. It provides
|
||||||
|
simple window creation, a drawing tool, image and basic events
|
||||||
|
management.
|
||||||
|
|
||||||
|
.SH X-WINDOW CONCEPT
|
||||||
|
|
||||||
|
X-Window is a network-oriented graphical system for Unix.
|
||||||
|
It is based on two main parts:
|
||||||
|
.br
|
||||||
|
On one side, your software wants to draw something on the screen and/or
|
||||||
|
get keyboard & mouse entries.
|
||||||
|
.br
|
||||||
|
On the other side, the X-Server manages the screen, keyboard and mouse
|
||||||
|
(It is often refered to as a "display").
|
||||||
|
.br
|
||||||
|
A network connection must be established between these two entities to send
|
||||||
|
drawing orders (from the software to the X-Server), and keyboard/mouse
|
||||||
|
events (from the X-Server to the software).
|
||||||
|
|
||||||
|
.SH INCLUDE FILE
|
||||||
|
.B mlx.h
|
||||||
|
should be included for a correct use of the MiniLibX API.
|
||||||
|
It only contains function prototypes, no structure is needed.
|
||||||
|
|
||||||
|
.SH LIBRARY FUNCTIONS
|
||||||
|
.P
|
||||||
|
First of all, you need to initialize the connection
|
||||||
|
between your software and the display.
|
||||||
|
Once this connection is established, you'll be able to
|
||||||
|
use other MiniLibX functions to send the X-Server messages,
|
||||||
|
like "I want to draw a yellow pixel in this window" or "did the
|
||||||
|
user hit a key?".
|
||||||
|
.P
|
||||||
|
The
|
||||||
|
.B mlx_init
|
||||||
|
function will create this connection. No parameters are needed, ant it will
|
||||||
|
return a
|
||||||
|
.I "void *"
|
||||||
|
identifier, used for further calls to the library routines.
|
||||||
|
.P
|
||||||
|
All other MiniLibX functions are described in the following man pages:
|
||||||
|
|
||||||
|
.TP 20
|
||||||
|
.B mlx_new_window
|
||||||
|
: manage windows
|
||||||
|
.TP 20
|
||||||
|
.B mlx_pixel_put
|
||||||
|
: draw inside window
|
||||||
|
.TP 20
|
||||||
|
.B mlx_new_image
|
||||||
|
: manipulate images
|
||||||
|
.TP 20
|
||||||
|
.B mlx_loop
|
||||||
|
: handle keyboard or mouse events
|
||||||
|
|
||||||
|
.SH LINKING MiniLibX
|
||||||
|
To use MiniLibX functions, you'll need to link
|
||||||
|
your software with several libraries, including the MiniLibX library itself.
|
||||||
|
To do this, simply add the following arguments at linking time:
|
||||||
|
|
||||||
|
.B -lmlx -lXext -lX11
|
||||||
|
|
||||||
|
You may also need to specify the path to these libraries, using
|
||||||
|
the
|
||||||
|
.B -L
|
||||||
|
flag.
|
||||||
|
|
||||||
|
|
||||||
|
.SH RETURN VALUES
|
||||||
|
If
|
||||||
|
.B mlx_init()
|
||||||
|
fails to set up the connection to the X server, it will return NULL, otherwise
|
||||||
|
a non-null pointer is returned as a connection identifier.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx_new_window(3), mlx_pixel_put(3), mlx_new_image(3), mlx_loop(3)
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
141
minilibx/man/man1/mlx_loop.1
Executable file
141
minilibx/man/man1/mlx_loop.1
Executable file
@@ -0,0 +1,141 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Handle events
|
||||||
|
.SH SYNOPSYS
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_loop
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_key_hook
|
||||||
|
(
|
||||||
|
.I void *win_ptr, int (*funct_ptr)(), void *param
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_mouse_hook
|
||||||
|
(
|
||||||
|
.I void *win_ptr, int (*funct_ptr)(), void *param
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_expose_hook
|
||||||
|
(
|
||||||
|
.I void *win_ptr, int (*funct_ptr)(), void *param
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_loop_hook
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, int (*funct_ptr)(), void *param
|
||||||
|
);
|
||||||
|
|
||||||
|
.SH X-WINDOW EVENTS
|
||||||
|
|
||||||
|
The X-Window system is bi-directionnal. On one hand, the program sends orders to
|
||||||
|
the screen to display pixels, images, and so on. On the other hand,
|
||||||
|
it can get information from the keyboard and mouse associated to
|
||||||
|
the screen. To do so, the program receives "events" from the keyboard or the
|
||||||
|
mouse.
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
|
||||||
|
To receive events, you must use
|
||||||
|
.B mlx_loop
|
||||||
|
(). This function never returns. It is an infinite loop that waits for
|
||||||
|
an event, and then calls a user-defined function associated with this event.
|
||||||
|
A single parameter is needed, the connection identifier
|
||||||
|
.I mlx_ptr
|
||||||
|
(see the
|
||||||
|
.B mlx manual).
|
||||||
|
|
||||||
|
You can assign different functions to the three following events:
|
||||||
|
.br
|
||||||
|
- A key is pressed
|
||||||
|
.br
|
||||||
|
- The mouse button is pressed
|
||||||
|
.br
|
||||||
|
- A part of the window should be re-drawn
|
||||||
|
(this is called an "expose" event, and it is your program's job to handle it).
|
||||||
|
.br
|
||||||
|
|
||||||
|
Each window can define a different function for the same event.
|
||||||
|
|
||||||
|
The three functions
|
||||||
|
.B mlx_key_hook
|
||||||
|
(),
|
||||||
|
.B mlx_mouse_hook
|
||||||
|
() and
|
||||||
|
.B mlx_expose_hook
|
||||||
|
() work exactly the same way.
|
||||||
|
.I funct_ptr
|
||||||
|
is a pointer to the function you want to be called
|
||||||
|
when an event occurs. This assignment is specific to the window defined by the
|
||||||
|
.I win_ptr
|
||||||
|
identifier. The
|
||||||
|
.I param
|
||||||
|
adress will be passed to the function everytime it is called, and should be
|
||||||
|
used to store the parameters it might need.
|
||||||
|
|
||||||
|
The syntax for the
|
||||||
|
.B mlx_loop_hook
|
||||||
|
() function is identical to the previous ones, but the given function will be
|
||||||
|
called when no event occurs.
|
||||||
|
|
||||||
|
When it catches an event, the MiniLibX calls the corresponding function
|
||||||
|
with fixed parameters:
|
||||||
|
.nf
|
||||||
|
|
||||||
|
expose_hook(void *param);
|
||||||
|
key_hook(int keycode,void *param);
|
||||||
|
mouse_hook(int button,int x,int y,void *param);
|
||||||
|
loop_hook(void *param);
|
||||||
|
|
||||||
|
.fi
|
||||||
|
These function names are arbitrary. They here are used to distinguish
|
||||||
|
parameters according to the event. These functions are NOT part of the
|
||||||
|
MiniLibX.
|
||||||
|
|
||||||
|
.I param
|
||||||
|
is the address specified in the mlx_*_hook calls. This address is never
|
||||||
|
used nor modified by the MiniLibX. On key and mouse events, additional
|
||||||
|
information is passed:
|
||||||
|
.I keycode
|
||||||
|
tells you which key is pressed (look for the X11 include file "keysymdef.h"),
|
||||||
|
(
|
||||||
|
.I x
|
||||||
|
,
|
||||||
|
.I y
|
||||||
|
) are the coordinates of the mouse click in the window, and
|
||||||
|
.I button
|
||||||
|
tells you which mouse button was pressed.
|
||||||
|
|
||||||
|
.SH GOING FURTHER WITH EVENTS
|
||||||
|
The MiniLibX provides a much generic access to all X-Window events. The
|
||||||
|
.I mlx.h
|
||||||
|
include define
|
||||||
|
.B mlx_hook()
|
||||||
|
in the same manner mlx_*_hook functions work. The event and mask values
|
||||||
|
will be taken from the X11 include file "X.h".
|
||||||
|
|
||||||
|
See source code of mlx_int_param_event.c to find out how the MiniLibX will
|
||||||
|
call your own function for a specific event.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx(3), mlx_new_window(3), mlx_pixel_put(3), mlx_new_image(3)
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
192
minilibx/man/man1/mlx_new_image.1
Executable file
192
minilibx/man/man1/mlx_new_image.1
Executable file
@@ -0,0 +1,192 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Manipulating images
|
||||||
|
.SH SYNOPSYS
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_new_image
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, int width, int height
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I char *
|
||||||
|
.fi
|
||||||
|
.B mlx_get_data_addr
|
||||||
|
(
|
||||||
|
.I void *img_ptr, int *bits_per_pixel, int *size_line, int *endian
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_put_image_to_window
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr, void *img_ptr, int x, int y
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I unsigned int
|
||||||
|
.fi
|
||||||
|
.B mlx_get_color_value
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, int color
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_xpm_to_image
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, char **xpm_data, int *width, int *height
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_xpm_file_to_image
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, char *filename, int *width, int *height
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_destroy_image
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *img_ptr
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
|
||||||
|
.B mlx_new_image
|
||||||
|
() creates a new image in memory. It returns a
|
||||||
|
.I void *
|
||||||
|
identifier needed to manipulate this image later. It only needs
|
||||||
|
the size of the image to be created, using the
|
||||||
|
.I width
|
||||||
|
and
|
||||||
|
.I height
|
||||||
|
parameters, and the
|
||||||
|
.I mlx_ptr
|
||||||
|
connection identifier (see the
|
||||||
|
.B mlx
|
||||||
|
manual).
|
||||||
|
|
||||||
|
The user can draw inside the image (see below), and
|
||||||
|
can dump the image inside a specified window at any time to
|
||||||
|
display it on the screen. This is done using
|
||||||
|
.B mlx_put_image_to_window
|
||||||
|
(). Three identifiers are needed here, for the connection to the
|
||||||
|
display, the window to use, and the image (respectively
|
||||||
|
.I mlx_ptr
|
||||||
|
,
|
||||||
|
.I win_ptr
|
||||||
|
and
|
||||||
|
.I img_ptr
|
||||||
|
). The (
|
||||||
|
.I x
|
||||||
|
,
|
||||||
|
.I y
|
||||||
|
) coordinates define where the image should be placed in the window.
|
||||||
|
|
||||||
|
.B mlx_get_data_addr
|
||||||
|
() returns information about the created image, allowing a user
|
||||||
|
to modify it later. The
|
||||||
|
.I img_ptr
|
||||||
|
parameter specifies the image to use. The three next parameters should
|
||||||
|
be the addresses of three different valid integers.
|
||||||
|
.I bits_per_pixel
|
||||||
|
will be filled with the number of bits needed to represent a pixel color
|
||||||
|
(also called the depth of the image).
|
||||||
|
.I size_line
|
||||||
|
is the number of bytes used to store one line of the image in memory.
|
||||||
|
This information is needed to move from one line to another in the image.
|
||||||
|
.I endian
|
||||||
|
tells you wether the pixel color in the image needs to be stored in
|
||||||
|
little endian (
|
||||||
|
.I endian
|
||||||
|
== 0), or big endian (
|
||||||
|
.I endian
|
||||||
|
== 1).
|
||||||
|
|
||||||
|
.B mlx_get_data_addr
|
||||||
|
returns a
|
||||||
|
.I char *
|
||||||
|
address that represents the begining of the memory area where the image
|
||||||
|
is stored. From this adress, the first
|
||||||
|
.I bits_per_pixel
|
||||||
|
bits represent the color of the first pixel in the first line of
|
||||||
|
the image. The second group of
|
||||||
|
.I bits_per_pixel
|
||||||
|
bits represent the second pixel of the first line, and so on.
|
||||||
|
Add
|
||||||
|
.I size_line
|
||||||
|
to the adress to get the begining of the second line. You can reach any
|
||||||
|
pixels of the image that way.
|
||||||
|
|
||||||
|
.B mlx_destroy_image
|
||||||
|
destroys the given image (
|
||||||
|
.I img_ptr
|
||||||
|
).
|
||||||
|
|
||||||
|
.SH STORING COLOR INSIDE IMAGES
|
||||||
|
|
||||||
|
Depending on the display, the number of bits used to store a pixel color
|
||||||
|
can change. The user usually represents a color in RGB mode, using
|
||||||
|
one byte for each component (see
|
||||||
|
.B mlx_pixel_put
|
||||||
|
manual). This must be translated to fit the
|
||||||
|
.I bits_per_pixel
|
||||||
|
requirement of the image, and make the color understandable to the X-Server.
|
||||||
|
That is the purpose of the
|
||||||
|
.B mlx_get_color_value
|
||||||
|
() function. It takes a standard RGB
|
||||||
|
.I color
|
||||||
|
parameter, and returns an
|
||||||
|
.I unsigned int
|
||||||
|
value.
|
||||||
|
The
|
||||||
|
.I bits_per_pixel
|
||||||
|
least significant bits of this value can be stored in the image.
|
||||||
|
|
||||||
|
Keep in mind that the least significant bits position depends on the local
|
||||||
|
computer's endian. If the endian of the image (in fact the endian of
|
||||||
|
the X-Server's computer) differs from the local endian, then the value should
|
||||||
|
be transformed before being used.
|
||||||
|
|
||||||
|
.SH XPM IMAGES
|
||||||
|
|
||||||
|
The
|
||||||
|
.B mlx_xpm_to_image
|
||||||
|
() and
|
||||||
|
.B mlx_xpm_file_to_image
|
||||||
|
() functions will create a new image the same way.
|
||||||
|
They will fill it using the specified
|
||||||
|
.I xpm_data
|
||||||
|
or
|
||||||
|
.I filename
|
||||||
|
, depending on which function is used.
|
||||||
|
Note that MiniLibX does not use the standard
|
||||||
|
Xpm library to deal with xpm images. You may not be able to
|
||||||
|
read all types of xpm images. It however handles transparency.
|
||||||
|
|
||||||
|
.SH RETURN VALUES
|
||||||
|
The three functions that create images,
|
||||||
|
.B mlx_new_image()
|
||||||
|
,
|
||||||
|
.B mlx_xpm_to_image()
|
||||||
|
and
|
||||||
|
.B mlx_xpm_file_to_image()
|
||||||
|
, will return NULL if an error occurs. Otherwise they return a non-null pointer
|
||||||
|
as an image identifier.
|
||||||
|
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx(3), mlx_new_window(3), mlx_pixel_put(3), mlx_loop(3)
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
79
minilibx/man/man1/mlx_new_window.1
Executable file
79
minilibx/man/man1/mlx_new_window.1
Executable file
@@ -0,0 +1,79 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Managing windows
|
||||||
|
.SH SYNOPSYS
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_new_window
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, int size_x, int size_y, char *title
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_clear_window
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_destroy_window
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.B mlx_new_window
|
||||||
|
() function creates a new window on the screen, using the
|
||||||
|
.I size_x
|
||||||
|
and
|
||||||
|
.I size_y
|
||||||
|
parameters to determine its size, and
|
||||||
|
.I title
|
||||||
|
as the text that should be displayed in the window's title bar.
|
||||||
|
The
|
||||||
|
.I mlx_ptr
|
||||||
|
parameter is the connection identifier returned by
|
||||||
|
.B mlx_init
|
||||||
|
() (see the
|
||||||
|
.B mlx
|
||||||
|
man page).
|
||||||
|
.B mlx_new_window
|
||||||
|
() returns a
|
||||||
|
.I void *
|
||||||
|
window identifier that can be used by other MiniLibX calls.
|
||||||
|
Note that the MiniLibX
|
||||||
|
can handle an arbitrary number of separate windows.
|
||||||
|
|
||||||
|
.B mlx_clear_window
|
||||||
|
() and
|
||||||
|
.B mlx_destroy_window
|
||||||
|
() respectively clear (in black) and destroy the given window. They both have
|
||||||
|
the same parameters:
|
||||||
|
.I mlx_ptr
|
||||||
|
is the screen connection identifier, and
|
||||||
|
.I win_ptr
|
||||||
|
is a window identifier.
|
||||||
|
|
||||||
|
.SH RETURN VALUES
|
||||||
|
If
|
||||||
|
.B mlx_new_window()
|
||||||
|
fails to create a new window (for wathever reason), it will return NULL,
|
||||||
|
otherwise a non-null pointer is returned as a window identifier.
|
||||||
|
.B mlx_clear_window
|
||||||
|
and
|
||||||
|
.B mlx_destroy_window
|
||||||
|
right now return nothing.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx(3), mlx_pixel_put(3), mlx_new_image(3), mlx_loop(3)
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
84
minilibx/man/man1/mlx_pixel_put.1
Executable file
84
minilibx/man/man1/mlx_pixel_put.1
Executable file
@@ -0,0 +1,84 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Drawing inside windows
|
||||||
|
.SH SYNOPSYS
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_pixel_put
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr, int x, int y, int color
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_string_put
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr, int x, int y, int color, char *string
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.B mlx_pixel_put
|
||||||
|
() function draws a defined pixel in the window
|
||||||
|
.I win_ptr
|
||||||
|
using the (
|
||||||
|
.I x
|
||||||
|
,
|
||||||
|
.I y
|
||||||
|
) coordinates, and the specified
|
||||||
|
.I color
|
||||||
|
\&. The origin (0,0) is the upper left corner of the window, the x and y axis
|
||||||
|
respectively pointing right and down. The connection
|
||||||
|
identifier,
|
||||||
|
.I mlx_ptr
|
||||||
|
, is needed (see the
|
||||||
|
.B mlx
|
||||||
|
man page).
|
||||||
|
|
||||||
|
Parameters for
|
||||||
|
.B mlx_string_put
|
||||||
|
() have the same meaning. Instead of a simple pixel, the specified
|
||||||
|
.I string
|
||||||
|
will be displayed at (
|
||||||
|
.I x
|
||||||
|
,
|
||||||
|
.I y
|
||||||
|
).
|
||||||
|
|
||||||
|
In both functions, it is impossible to display anything outside the
|
||||||
|
specified window, nor display in another window in front of the selected one.
|
||||||
|
|
||||||
|
.SH COLOR MANAGEMENT
|
||||||
|
The
|
||||||
|
.I color
|
||||||
|
parameter has an integer type. The displayed color needs to be encoded
|
||||||
|
in this integer, following a defined scheme. All displayable colors
|
||||||
|
can be split in 3 basic colors: red, green and blue. Three associated
|
||||||
|
values, in the 0-255 range, represent how much of each color is mixed up
|
||||||
|
to create the original color. Theses three values must be set inside the
|
||||||
|
integer to display the right color. The three least significant bytes of
|
||||||
|
this integer are filled as shown in the picture below:
|
||||||
|
|
||||||
|
.TS
|
||||||
|
allbox;
|
||||||
|
c s s s s
|
||||||
|
r c c c c.
|
||||||
|
Color Integer
|
||||||
|
Interpretation \[*a] R G B
|
||||||
|
Bit numbers 31..24 23..16 15..8 7..0
|
||||||
|
.TE
|
||||||
|
|
||||||
|
While filling the integer, make sure you avoid endian problems. Remember
|
||||||
|
that the "blue" byte should always be the least significant one.
|
||||||
|
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx(3), mlx_new_window(3), mlx_new_image(3), mlx_loop(3)
|
||||||
|
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
93
minilibx/man/man3/mlx.3
Executable file
93
minilibx/man/man3/mlx.3
Executable file
@@ -0,0 +1,93 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Simple X-Window Interface Library for students
|
||||||
|
.SH SYNOPSYS
|
||||||
|
#include <mlx.h>
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_init
|
||||||
|
();
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
MiniLibX is an easy way to create graphical software,
|
||||||
|
without any X-Window programming knowledge. It provides
|
||||||
|
simple window creation, a drawing tool, image and basic events
|
||||||
|
management.
|
||||||
|
|
||||||
|
.SH X-WINDOW CONCEPT
|
||||||
|
|
||||||
|
X-Window is a network-oriented graphical system for Unix.
|
||||||
|
It is based on two main parts:
|
||||||
|
.br
|
||||||
|
On one side, your software wants to draw something on the screen and/or
|
||||||
|
get keyboard & mouse entries.
|
||||||
|
.br
|
||||||
|
On the other side, the X-Server manages the screen, keyboard and mouse
|
||||||
|
(It is often refered to as a "display").
|
||||||
|
.br
|
||||||
|
A network connection must be established between these two entities to send
|
||||||
|
drawing orders (from the software to the X-Server), and keyboard/mouse
|
||||||
|
events (from the X-Server to the software).
|
||||||
|
|
||||||
|
.SH INCLUDE FILE
|
||||||
|
.B mlx.h
|
||||||
|
should be included for a correct use of the MiniLibX API.
|
||||||
|
It only contains function prototypes, no structure is needed.
|
||||||
|
|
||||||
|
.SH LIBRARY FUNCTIONS
|
||||||
|
.P
|
||||||
|
First of all, you need to initialize the connection
|
||||||
|
between your software and the display.
|
||||||
|
Once this connection is established, you'll be able to
|
||||||
|
use other MiniLibX functions to send the X-Server messages,
|
||||||
|
like "I want to draw a yellow pixel in this window" or "did the
|
||||||
|
user hit a key?".
|
||||||
|
.P
|
||||||
|
The
|
||||||
|
.B mlx_init
|
||||||
|
function will create this connection. No parameters are needed, ant it will
|
||||||
|
return a
|
||||||
|
.I "void *"
|
||||||
|
identifier, used for further calls to the library routines.
|
||||||
|
.P
|
||||||
|
All other MiniLibX functions are described in the following man pages:
|
||||||
|
|
||||||
|
.TP 20
|
||||||
|
.B mlx_new_window
|
||||||
|
: manage windows
|
||||||
|
.TP 20
|
||||||
|
.B mlx_pixel_put
|
||||||
|
: draw inside window
|
||||||
|
.TP 20
|
||||||
|
.B mlx_new_image
|
||||||
|
: manipulate images
|
||||||
|
.TP 20
|
||||||
|
.B mlx_loop
|
||||||
|
: handle keyboard or mouse events
|
||||||
|
|
||||||
|
.SH LINKING MiniLibX
|
||||||
|
To use MiniLibX functions, you'll need to link
|
||||||
|
your software with several libraries, including the MiniLibX library itself.
|
||||||
|
To do this, simply add the following arguments at linking time:
|
||||||
|
|
||||||
|
.B -lmlx -lXext -lX11
|
||||||
|
|
||||||
|
You may also need to specify the path to these libraries, using
|
||||||
|
the
|
||||||
|
.B -L
|
||||||
|
flag.
|
||||||
|
|
||||||
|
|
||||||
|
.SH RETURN VALUES
|
||||||
|
If
|
||||||
|
.B mlx_init()
|
||||||
|
fails to set up the connection to the X server, it will return NULL, otherwise
|
||||||
|
a non-null pointer is returned as a connection identifier.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx_new_window(3), mlx_pixel_put(3), mlx_new_image(3), mlx_loop(3)
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
141
minilibx/man/man3/mlx_loop.3
Executable file
141
minilibx/man/man3/mlx_loop.3
Executable file
@@ -0,0 +1,141 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Handle events
|
||||||
|
.SH SYNOPSYS
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_loop
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_key_hook
|
||||||
|
(
|
||||||
|
.I void *win_ptr, int (*funct_ptr)(), void *param
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_mouse_hook
|
||||||
|
(
|
||||||
|
.I void *win_ptr, int (*funct_ptr)(), void *param
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_expose_hook
|
||||||
|
(
|
||||||
|
.I void *win_ptr, int (*funct_ptr)(), void *param
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_loop_hook
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, int (*funct_ptr)(), void *param
|
||||||
|
);
|
||||||
|
|
||||||
|
.SH X-WINDOW EVENTS
|
||||||
|
|
||||||
|
The X-Window system is bi-directionnal. On one hand, the program sends orders to
|
||||||
|
the screen to display pixels, images, and so on. On the other hand,
|
||||||
|
it can get information from the keyboard and mouse associated to
|
||||||
|
the screen. To do so, the program receives "events" from the keyboard or the
|
||||||
|
mouse.
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
|
||||||
|
To receive events, you must use
|
||||||
|
.B mlx_loop
|
||||||
|
(). This function never returns. It is an infinite loop that waits for
|
||||||
|
an event, and then calls a user-defined function associated with this event.
|
||||||
|
A single parameter is needed, the connection identifier
|
||||||
|
.I mlx_ptr
|
||||||
|
(see the
|
||||||
|
.B mlx manual).
|
||||||
|
|
||||||
|
You can assign different functions to the three following events:
|
||||||
|
.br
|
||||||
|
- A key is pressed
|
||||||
|
.br
|
||||||
|
- The mouse button is pressed
|
||||||
|
.br
|
||||||
|
- A part of the window should be re-drawn
|
||||||
|
(this is called an "expose" event, and it is your program's job to handle it).
|
||||||
|
.br
|
||||||
|
|
||||||
|
Each window can define a different function for the same event.
|
||||||
|
|
||||||
|
The three functions
|
||||||
|
.B mlx_key_hook
|
||||||
|
(),
|
||||||
|
.B mlx_mouse_hook
|
||||||
|
() and
|
||||||
|
.B mlx_expose_hook
|
||||||
|
() work exactly the same way.
|
||||||
|
.I funct_ptr
|
||||||
|
is a pointer to the function you want to be called
|
||||||
|
when an event occurs. This assignment is specific to the window defined by the
|
||||||
|
.I win_ptr
|
||||||
|
identifier. The
|
||||||
|
.I param
|
||||||
|
adress will be passed to the function everytime it is called, and should be
|
||||||
|
used to store the parameters it might need.
|
||||||
|
|
||||||
|
The syntax for the
|
||||||
|
.B mlx_loop_hook
|
||||||
|
() function is identical to the previous ones, but the given function will be
|
||||||
|
called when no event occurs.
|
||||||
|
|
||||||
|
When it catches an event, the MiniLibX calls the corresponding function
|
||||||
|
with fixed parameters:
|
||||||
|
.nf
|
||||||
|
|
||||||
|
expose_hook(void *param);
|
||||||
|
key_hook(int keycode,void *param);
|
||||||
|
mouse_hook(int button,int x,int y,void *param);
|
||||||
|
loop_hook(void *param);
|
||||||
|
|
||||||
|
.fi
|
||||||
|
These function names are arbitrary. They here are used to distinguish
|
||||||
|
parameters according to the event. These functions are NOT part of the
|
||||||
|
MiniLibX.
|
||||||
|
|
||||||
|
.I param
|
||||||
|
is the address specified in the mlx_*_hook calls. This address is never
|
||||||
|
used nor modified by the MiniLibX. On key and mouse events, additional
|
||||||
|
information is passed:
|
||||||
|
.I keycode
|
||||||
|
tells you which key is pressed (look for the X11 include file "keysymdef.h"),
|
||||||
|
(
|
||||||
|
.I x
|
||||||
|
,
|
||||||
|
.I y
|
||||||
|
) are the coordinates of the mouse click in the window, and
|
||||||
|
.I button
|
||||||
|
tells you which mouse button was pressed.
|
||||||
|
|
||||||
|
.SH GOING FURTHER WITH EVENTS
|
||||||
|
The MiniLibX provides a much generic access to all X-Window events. The
|
||||||
|
.I mlx.h
|
||||||
|
include define
|
||||||
|
.B mlx_hook()
|
||||||
|
in the same manner mlx_*_hook functions work. The event and mask values
|
||||||
|
will be taken from the X11 include file "X.h".
|
||||||
|
|
||||||
|
See source code of mlx_int_param_event.c to find out how the MiniLibX will
|
||||||
|
call your own function for a specific event.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx(3), mlx_new_window(3), mlx_pixel_put(3), mlx_new_image(3)
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
192
minilibx/man/man3/mlx_new_image.3
Executable file
192
minilibx/man/man3/mlx_new_image.3
Executable file
@@ -0,0 +1,192 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Manipulating images
|
||||||
|
.SH SYNOPSYS
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_new_image
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, int width, int height
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I char *
|
||||||
|
.fi
|
||||||
|
.B mlx_get_data_addr
|
||||||
|
(
|
||||||
|
.I void *img_ptr, int *bits_per_pixel, int *size_line, int *endian
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_put_image_to_window
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr, void *img_ptr, int x, int y
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I unsigned int
|
||||||
|
.fi
|
||||||
|
.B mlx_get_color_value
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, int color
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_xpm_to_image
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, char **xpm_data, int *width, int *height
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_xpm_file_to_image
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, char *filename, int *width, int *height
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_destroy_image
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *img_ptr
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
|
||||||
|
.B mlx_new_image
|
||||||
|
() creates a new image in memory. It returns a
|
||||||
|
.I void *
|
||||||
|
identifier needed to manipulate this image later. It only needs
|
||||||
|
the size of the image to be created, using the
|
||||||
|
.I width
|
||||||
|
and
|
||||||
|
.I height
|
||||||
|
parameters, and the
|
||||||
|
.I mlx_ptr
|
||||||
|
connection identifier (see the
|
||||||
|
.B mlx
|
||||||
|
manual).
|
||||||
|
|
||||||
|
The user can draw inside the image (see below), and
|
||||||
|
can dump the image inside a specified window at any time to
|
||||||
|
display it on the screen. This is done using
|
||||||
|
.B mlx_put_image_to_window
|
||||||
|
(). Three identifiers are needed here, for the connection to the
|
||||||
|
display, the window to use, and the image (respectively
|
||||||
|
.I mlx_ptr
|
||||||
|
,
|
||||||
|
.I win_ptr
|
||||||
|
and
|
||||||
|
.I img_ptr
|
||||||
|
). The (
|
||||||
|
.I x
|
||||||
|
,
|
||||||
|
.I y
|
||||||
|
) coordinates define where the image should be placed in the window.
|
||||||
|
|
||||||
|
.B mlx_get_data_addr
|
||||||
|
() returns information about the created image, allowing a user
|
||||||
|
to modify it later. The
|
||||||
|
.I img_ptr
|
||||||
|
parameter specifies the image to use. The three next parameters should
|
||||||
|
be the addresses of three different valid integers.
|
||||||
|
.I bits_per_pixel
|
||||||
|
will be filled with the number of bits needed to represent a pixel color
|
||||||
|
(also called the depth of the image).
|
||||||
|
.I size_line
|
||||||
|
is the number of bytes used to store one line of the image in memory.
|
||||||
|
This information is needed to move from one line to another in the image.
|
||||||
|
.I endian
|
||||||
|
tells you wether the pixel color in the image needs to be stored in
|
||||||
|
little endian (
|
||||||
|
.I endian
|
||||||
|
== 0), or big endian (
|
||||||
|
.I endian
|
||||||
|
== 1).
|
||||||
|
|
||||||
|
.B mlx_get_data_addr
|
||||||
|
returns a
|
||||||
|
.I char *
|
||||||
|
address that represents the begining of the memory area where the image
|
||||||
|
is stored. From this adress, the first
|
||||||
|
.I bits_per_pixel
|
||||||
|
bits represent the color of the first pixel in the first line of
|
||||||
|
the image. The second group of
|
||||||
|
.I bits_per_pixel
|
||||||
|
bits represent the second pixel of the first line, and so on.
|
||||||
|
Add
|
||||||
|
.I size_line
|
||||||
|
to the adress to get the begining of the second line. You can reach any
|
||||||
|
pixels of the image that way.
|
||||||
|
|
||||||
|
.B mlx_destroy_image
|
||||||
|
destroys the given image (
|
||||||
|
.I img_ptr
|
||||||
|
).
|
||||||
|
|
||||||
|
.SH STORING COLOR INSIDE IMAGES
|
||||||
|
|
||||||
|
Depending on the display, the number of bits used to store a pixel color
|
||||||
|
can change. The user usually represents a color in RGB mode, using
|
||||||
|
one byte for each component (see
|
||||||
|
.B mlx_pixel_put
|
||||||
|
manual). This must be translated to fit the
|
||||||
|
.I bits_per_pixel
|
||||||
|
requirement of the image, and make the color understandable to the X-Server.
|
||||||
|
That is the purpose of the
|
||||||
|
.B mlx_get_color_value
|
||||||
|
() function. It takes a standard RGB
|
||||||
|
.I color
|
||||||
|
parameter, and returns an
|
||||||
|
.I unsigned int
|
||||||
|
value.
|
||||||
|
The
|
||||||
|
.I bits_per_pixel
|
||||||
|
least significant bits of this value can be stored in the image.
|
||||||
|
|
||||||
|
Keep in mind that the least significant bits position depends on the local
|
||||||
|
computer's endian. If the endian of the image (in fact the endian of
|
||||||
|
the X-Server's computer) differs from the local endian, then the value should
|
||||||
|
be transformed before being used.
|
||||||
|
|
||||||
|
.SH XPM IMAGES
|
||||||
|
|
||||||
|
The
|
||||||
|
.B mlx_xpm_to_image
|
||||||
|
() and
|
||||||
|
.B mlx_xpm_file_to_image
|
||||||
|
() functions will create a new image the same way.
|
||||||
|
They will fill it using the specified
|
||||||
|
.I xpm_data
|
||||||
|
or
|
||||||
|
.I filename
|
||||||
|
, depending on which function is used.
|
||||||
|
Note that MiniLibX does not use the standard
|
||||||
|
Xpm library to deal with xpm images. You may not be able to
|
||||||
|
read all types of xpm images. It however handles transparency.
|
||||||
|
|
||||||
|
.SH RETURN VALUES
|
||||||
|
The three functions that create images,
|
||||||
|
.B mlx_new_image()
|
||||||
|
,
|
||||||
|
.B mlx_xpm_to_image()
|
||||||
|
and
|
||||||
|
.B mlx_xpm_file_to_image()
|
||||||
|
, will return NULL if an error occurs. Otherwise they return a non-null pointer
|
||||||
|
as an image identifier.
|
||||||
|
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx(3), mlx_new_window(3), mlx_pixel_put(3), mlx_loop(3)
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
79
minilibx/man/man3/mlx_new_window.3
Executable file
79
minilibx/man/man3/mlx_new_window.3
Executable file
@@ -0,0 +1,79 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Managing windows
|
||||||
|
.SH SYNOPSYS
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I void *
|
||||||
|
.fi
|
||||||
|
.B mlx_new_window
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, int size_x, int size_y, char *title
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_clear_window
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_destroy_window
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.B mlx_new_window
|
||||||
|
() function creates a new window on the screen, using the
|
||||||
|
.I size_x
|
||||||
|
and
|
||||||
|
.I size_y
|
||||||
|
parameters to determine its size, and
|
||||||
|
.I title
|
||||||
|
as the text that should be displayed in the window's title bar.
|
||||||
|
The
|
||||||
|
.I mlx_ptr
|
||||||
|
parameter is the connection identifier returned by
|
||||||
|
.B mlx_init
|
||||||
|
() (see the
|
||||||
|
.B mlx
|
||||||
|
man page).
|
||||||
|
.B mlx_new_window
|
||||||
|
() returns a
|
||||||
|
.I void *
|
||||||
|
window identifier that can be used by other MiniLibX calls.
|
||||||
|
Note that the MiniLibX
|
||||||
|
can handle an arbitrary number of separate windows.
|
||||||
|
|
||||||
|
.B mlx_clear_window
|
||||||
|
() and
|
||||||
|
.B mlx_destroy_window
|
||||||
|
() respectively clear (in black) and destroy the given window. They both have
|
||||||
|
the same parameters:
|
||||||
|
.I mlx_ptr
|
||||||
|
is the screen connection identifier, and
|
||||||
|
.I win_ptr
|
||||||
|
is a window identifier.
|
||||||
|
|
||||||
|
.SH RETURN VALUES
|
||||||
|
If
|
||||||
|
.B mlx_new_window()
|
||||||
|
fails to create a new window (for wathever reason), it will return NULL,
|
||||||
|
otherwise a non-null pointer is returned as a window identifier.
|
||||||
|
.B mlx_clear_window
|
||||||
|
and
|
||||||
|
.B mlx_destroy_window
|
||||||
|
right now return nothing.
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx(3), mlx_pixel_put(3), mlx_new_image(3), mlx_loop(3)
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
81
minilibx/man/man3/mlx_pixel_put.3
Executable file
81
minilibx/man/man3/mlx_pixel_put.3
Executable file
@@ -0,0 +1,81 @@
|
|||||||
|
.TH MiniLibX 3 "September 19, 2002"
|
||||||
|
.SH NAME
|
||||||
|
MiniLibX - Drawing inside windows
|
||||||
|
.SH SYNOPSYS
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_pixel_put
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr, int x, int y, int color
|
||||||
|
);
|
||||||
|
|
||||||
|
.nf
|
||||||
|
.I int
|
||||||
|
.fi
|
||||||
|
.B mlx_string_put
|
||||||
|
(
|
||||||
|
.I void *mlx_ptr, void *win_ptr, int x, int y, int color, char *string
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.B mlx_pixel_put
|
||||||
|
() function draws a defined pixel in the window
|
||||||
|
.I win_ptr
|
||||||
|
using the (
|
||||||
|
.I x
|
||||||
|
,
|
||||||
|
.I y
|
||||||
|
) coordinates, and the specified
|
||||||
|
.I color
|
||||||
|
\&. The origin (0,0) is the upper left corner of the window, the x and y axis
|
||||||
|
respectively pointing right and down. The connection
|
||||||
|
identifier,
|
||||||
|
.I mlx_ptr
|
||||||
|
, is needed (see the
|
||||||
|
.B mlx
|
||||||
|
man page).
|
||||||
|
|
||||||
|
Parameters for
|
||||||
|
.B mlx_string_put
|
||||||
|
() have the same meaning. Instead of a simple pixel, the specified
|
||||||
|
.I string
|
||||||
|
will be displayed at (
|
||||||
|
.I x
|
||||||
|
,
|
||||||
|
.I y
|
||||||
|
).
|
||||||
|
|
||||||
|
In both functions, it is impossible to display anything outside the
|
||||||
|
specified window, nor display in another window in front of the selected one.
|
||||||
|
|
||||||
|
.SH COLOR MANAGEMENT
|
||||||
|
The
|
||||||
|
.I color
|
||||||
|
parameter has an integer type. The displayed color needs to be encoded
|
||||||
|
in this integer, following a defined scheme. All displayable colors
|
||||||
|
can be split in 3 basic colors: red, green and blue. Three associated
|
||||||
|
values, in the 0-255 range, represent how much of each color is mixed up
|
||||||
|
to create the original color. Theses three values must be set inside the
|
||||||
|
integer to display the right color. The three least significant bytes of
|
||||||
|
this integer are filled as shown in the picture below:
|
||||||
|
|
||||||
|
.nf
|
||||||
|
| 0 | R | G | B | color integer
|
||||||
|
+---+---+---+---+
|
||||||
|
.fi
|
||||||
|
|
||||||
|
|
||||||
|
While filling the integer, make sure you avoid endian problems. Remember
|
||||||
|
that the "blue" byte should always be the least significant one.
|
||||||
|
|
||||||
|
|
||||||
|
.SH SEE ALSO
|
||||||
|
mlx(3), mlx_new_window(3), mlx_new_image(3), mlx_loop(3)
|
||||||
|
|
||||||
|
|
||||||
|
.SH AUTHOR
|
||||||
|
Copyright ol@ - 2002-2014 - Olivier Crouzet
|
||||||
139
minilibx/mlx.h
Executable file
139
minilibx/mlx.h
Executable file
@@ -0,0 +1,139 @@
|
|||||||
|
/*
|
||||||
|
** mlx.h for MinilibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Jul 31 16:37:50 2000 Charlie Root
|
||||||
|
** Last update Tue May 15 16:23:28 2007 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
** MinilibX - Please report bugs
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** FR msg - FR msg - FR msg
|
||||||
|
**
|
||||||
|
** La MinilibX utilise 2 librairies supplementaires qu'il
|
||||||
|
** est necessaire de rajouter a la compilation :
|
||||||
|
** -lmlx -lXext -lX11
|
||||||
|
**
|
||||||
|
** La MinilibX permet le chargement des images de type Xpm.
|
||||||
|
** Notez que cette implementation est incomplete.
|
||||||
|
** Merci de communiquer tout probleme de chargement d'image
|
||||||
|
** de ce type.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef MLX_H
|
||||||
|
|
||||||
|
#define MLX_H
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_init();
|
||||||
|
/*
|
||||||
|
** needed before everything else.
|
||||||
|
** return (void *)0 if failed
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Basic actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
void *mlx_new_window(void *mlx_ptr, int size_x, int size_y, char *title);
|
||||||
|
/*
|
||||||
|
** return void *0 if failed
|
||||||
|
*/
|
||||||
|
int mlx_clear_window(void *mlx_ptr, void *win_ptr);
|
||||||
|
int mlx_pixel_put(void *mlx_ptr, void *win_ptr, int x, int y, int color);
|
||||||
|
/*
|
||||||
|
** origin for x & y is top left corner of the window
|
||||||
|
** y down is positive
|
||||||
|
** color is 0x00RRGGBB
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Image stuff
|
||||||
|
*/
|
||||||
|
|
||||||
|
void *mlx_new_image(void *mlx_ptr,int width,int height);
|
||||||
|
/*
|
||||||
|
** return void *0 if failed
|
||||||
|
** obsolete : image2 data is stored using bit planes
|
||||||
|
** void *mlx_new_image2(void *mlx_ptr,int width,int height);
|
||||||
|
*/
|
||||||
|
char *mlx_get_data_addr(void *img_ptr, int *bits_per_pixel,
|
||||||
|
int *size_line, int *endian);
|
||||||
|
/*
|
||||||
|
** endian : 0 = sever X is little endian, 1 = big endian
|
||||||
|
** for mlx_new_image2, 2nd arg of mlx_get_data_addr is number_of_planes
|
||||||
|
*/
|
||||||
|
int mlx_put_image_to_window(void *mlx_ptr, void *win_ptr, void *img_ptr,
|
||||||
|
int x, int y);
|
||||||
|
int mlx_get_color_value(void *mlx_ptr, int color);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** dealing with Events
|
||||||
|
*/
|
||||||
|
|
||||||
|
int mlx_mouse_hook (void *win_ptr, int (*funct_ptr)(), void *param);
|
||||||
|
int mlx_key_hook (void *win_ptr, int (*funct_ptr)(), void *param);
|
||||||
|
int mlx_expose_hook (void *win_ptr, int (*funct_ptr)(), void *param);
|
||||||
|
|
||||||
|
int mlx_loop_hook (void *mlx_ptr, int (*funct_ptr)(), void *param);
|
||||||
|
int mlx_loop (void *mlx_ptr);
|
||||||
|
int mlx_loop_end (void *mlx_ptr);
|
||||||
|
|
||||||
|
/*
|
||||||
|
** hook funct are called as follow :
|
||||||
|
**
|
||||||
|
** expose_hook(void *param);
|
||||||
|
** key_hook(int keycode, void *param);
|
||||||
|
** mouse_hook(int button, int x,int y, void *param);
|
||||||
|
** loop_hook(void *param);
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Usually asked...
|
||||||
|
*/
|
||||||
|
|
||||||
|
int mlx_string_put(void *mlx_ptr, void *win_ptr, int x, int y, int color,
|
||||||
|
char *string);
|
||||||
|
void mlx_set_font(void *mlx_ptr, void *win_ptr, char *name);
|
||||||
|
void *mlx_xpm_to_image(void *mlx_ptr, char **xpm_data,
|
||||||
|
int *width, int *height);
|
||||||
|
void *mlx_xpm_file_to_image(void *mlx_ptr, char *filename,
|
||||||
|
int *width, int *height);
|
||||||
|
int mlx_destroy_window(void *mlx_ptr, void *win_ptr);
|
||||||
|
|
||||||
|
int mlx_destroy_image(void *mlx_ptr, void *img_ptr);
|
||||||
|
|
||||||
|
int mlx_destroy_display(void *mlx_ptr);
|
||||||
|
|
||||||
|
/*
|
||||||
|
** generic hook system for all events, and minilibX functions that
|
||||||
|
** can be hooked. Some macro and defines from X11/X.h are needed here.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int mlx_hook(void *win_ptr, int x_event, int x_mask,
|
||||||
|
int (*funct)(), void *param);
|
||||||
|
|
||||||
|
int mlx_do_key_autorepeatoff(void *mlx_ptr);
|
||||||
|
int mlx_do_key_autorepeaton(void *mlx_ptr);
|
||||||
|
int mlx_do_sync(void *mlx_ptr);
|
||||||
|
|
||||||
|
int mlx_mouse_get_pos(void *mlx_ptr, void *win_ptr, int *x, int *y);
|
||||||
|
int mlx_mouse_move(void *mlx_ptr, void *win_ptr, int x, int y);
|
||||||
|
int mlx_mouse_hide(void *mlx_ptr, void *win_ptr);
|
||||||
|
int mlx_mouse_show(void *mlx_ptr, void *win_ptr);
|
||||||
|
|
||||||
|
int mlx_get_screen_size(void *mlx_ptr, int *sizex, int *sizey);
|
||||||
|
|
||||||
|
#endif /* MLX_H */
|
||||||
21
minilibx/mlx_clear_window.c
Executable file
21
minilibx/mlx_clear_window.c
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
** mlx_clear_window.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Thu Sep 7 19:46:15 2000 Charlie Root
|
||||||
|
** Last update Tue Sep 25 17:11:19 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_clear_window(t_xvar *xvar,t_win_list *win)
|
||||||
|
{
|
||||||
|
XClearWindow(xvar->display,win->window);
|
||||||
|
if (xvar->do_flush)
|
||||||
|
XFlush(xvar->display);
|
||||||
|
}
|
||||||
18
minilibx/mlx_destroy_display.c
Executable file
18
minilibx/mlx_destroy_display.c
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* mlx_destroy_display.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: mg <mg@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2020/10/03 18:56:35 by mg #+# #+# */
|
||||||
|
/* Updated: 2020/10/04 01:55:35 by mg ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
int mlx_destroy_display(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
XCloseDisplay(xvar->display);
|
||||||
|
}
|
||||||
31
minilibx/mlx_destroy_image.c
Executable file
31
minilibx/mlx_destroy_image.c
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
** mlx_destroy_image.c for MinilibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Tue Mar 12 10:25:15 2002 Charlie Root
|
||||||
|
** Last update Tue May 15 16:45:54 2007 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_destroy_image(t_xvar *xvar, t_img *img)
|
||||||
|
{
|
||||||
|
if (img->type == MLX_TYPE_SHM_PIXMAP ||
|
||||||
|
img->type == MLX_TYPE_SHM)
|
||||||
|
{
|
||||||
|
XShmDetach(xvar->display, &(img->shm));
|
||||||
|
shmdt(img->shm.shmaddr);
|
||||||
|
/* shmctl IPC_RMID already done */
|
||||||
|
}
|
||||||
|
XDestroyImage(img->image); /* For image & shm-image. Also free img->data */
|
||||||
|
XFreePixmap(xvar->display, img->pix);
|
||||||
|
if (img->gc)
|
||||||
|
XFreeGC(xvar->display, img->gc);
|
||||||
|
free(img);
|
||||||
|
if (xvar->do_flush)
|
||||||
|
XFlush(xvar->display);
|
||||||
|
}
|
||||||
38
minilibx/mlx_destroy_window.c
Executable file
38
minilibx/mlx_destroy_window.c
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
** mlx_destroy_window.c for MinilibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Tue Mar 12 10:25:15 2002 Charlie Root
|
||||||
|
** Last update Tue May 15 16:46:08 2007 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_destroy_window(t_xvar *xvar,t_win_list *win)
|
||||||
|
{
|
||||||
|
t_win_list *w;
|
||||||
|
t_win_list *prev;
|
||||||
|
t_win_list first;
|
||||||
|
|
||||||
|
first.next = xvar->win_list;
|
||||||
|
prev = &first;
|
||||||
|
w = prev->next;
|
||||||
|
while (w)
|
||||||
|
{
|
||||||
|
if (w==win)
|
||||||
|
prev->next = w->next;
|
||||||
|
else
|
||||||
|
prev = w;
|
||||||
|
w = w->next;
|
||||||
|
}
|
||||||
|
xvar->win_list = first.next;
|
||||||
|
XDestroyWindow(xvar->display,win->window);
|
||||||
|
XFreeGC(xvar->display,win->gc);
|
||||||
|
free(win);
|
||||||
|
if (xvar->do_flush)
|
||||||
|
XFlush(xvar->display);
|
||||||
|
}
|
||||||
22
minilibx/mlx_expose_hook.c
Executable file
22
minilibx/mlx_expose_hook.c
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
** mlx_expose_hook.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Thu Aug 3 11:49:06 2000 Charlie Root
|
||||||
|
** Last update Fri Feb 23 17:07:42 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_expose_hook(t_win_list *win,int (*funct)(),void *param)
|
||||||
|
{
|
||||||
|
win->hooks[Expose].hook = funct;
|
||||||
|
win->hooks[Expose].param = param;
|
||||||
|
win->hooks[Expose].mask = ExposureMask;
|
||||||
|
}
|
||||||
104
minilibx/mlx_ext_randr.c
Executable file
104
minilibx/mlx_ext_randr.c
Executable file
@@ -0,0 +1,104 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <X11/extensions/Xrandr.h>
|
||||||
|
|
||||||
|
/* global for independant extension */
|
||||||
|
|
||||||
|
RRMode saved_mode = 0;
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_ext_fullscreen(t_xvar *xvar, t_win_list *win, int fullscreen)
|
||||||
|
{
|
||||||
|
XWindowAttributes watt;
|
||||||
|
int i;
|
||||||
|
int j;
|
||||||
|
XRRScreenResources *res;
|
||||||
|
XRROutputInfo *o_info;
|
||||||
|
XRRCrtcInfo *crtc;
|
||||||
|
RRMode mode_candidate;
|
||||||
|
int idx_output;
|
||||||
|
int idx_candidate;
|
||||||
|
|
||||||
|
if (!XGetWindowAttributes(xvar->display, win->window, &watt))
|
||||||
|
return (0);
|
||||||
|
|
||||||
|
res = XRRGetScreenResources(xvar->display, xvar->root);
|
||||||
|
o_info = NULL;
|
||||||
|
idx_output = -1;
|
||||||
|
i = res->noutput;
|
||||||
|
while (i--)
|
||||||
|
{
|
||||||
|
o_info = XRRGetOutputInfo(xvar->display, res, res->outputs[i]);
|
||||||
|
if (o_info->connection == RR_Connected)
|
||||||
|
{
|
||||||
|
idx_output = i;
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
XRRFreeOutputInfo(o_info);
|
||||||
|
}
|
||||||
|
if (!o_info)
|
||||||
|
{
|
||||||
|
XRRFreeScreenResources(res);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
idx_candidate = -1;
|
||||||
|
i = o_info->nmode;
|
||||||
|
while (i--)
|
||||||
|
{
|
||||||
|
j = res->nmode;
|
||||||
|
while (j--)
|
||||||
|
if (res->modes[j].id == o_info->modes[i])
|
||||||
|
if (res->modes[j].width >= watt.width && res->modes[j].height >= watt.height &&
|
||||||
|
(idx_candidate == -1 || res->modes[idx_candidate].width > res->modes[j].width ||
|
||||||
|
res->modes[idx_candidate].height > res->modes[j].height) )
|
||||||
|
idx_candidate = i;
|
||||||
|
}
|
||||||
|
if (idx_candidate < 0)
|
||||||
|
{
|
||||||
|
XRRFreeOutputInfo(o_info);
|
||||||
|
XRRFreeScreenResources(res);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
if (!fullscreen && saved_mode == -1)
|
||||||
|
idx_candidate = 0; /* if no clue, uses first mode, usually part of npreferred */
|
||||||
|
mode_candidate = o_info->modes[idx_candidate];
|
||||||
|
if (!fullscreen)
|
||||||
|
mode_candidate = saved_mode;
|
||||||
|
|
||||||
|
crtc = XRRGetCrtcInfo(xvar->display, res, o_info->crtc);
|
||||||
|
saved_mode = crtc->mode;
|
||||||
|
|
||||||
|
i = XRRSetCrtcConfig(xvar->display, res, o_info->crtc, CurrentTime, 0, 0, mode_candidate,
|
||||||
|
crtc->rotation, &res->outputs[idx_output], 1);
|
||||||
|
if (fullscreen)
|
||||||
|
printf("found mode : %d x %d\n Status %d\n", res->modes[idx_candidate].width, res->modes[idx_candidate].height, i);
|
||||||
|
else
|
||||||
|
printf("back previous mode\n");
|
||||||
|
|
||||||
|
XMoveWindow(xvar->display, win->window, 0, 0);
|
||||||
|
XMapRaised(xvar->display, win->window);
|
||||||
|
|
||||||
|
if (fullscreen)
|
||||||
|
{
|
||||||
|
// XGrabPointer(xvar->display, win->window, True, 0, GrabModeAsync, GrabModeAsync, win->window, 0L, CurrentTime);
|
||||||
|
XGrabKeyboard(xvar->display, win->window, False, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XUngrabPointer(xvar->display, CurrentTime);
|
||||||
|
XUngrabKeyboard(xvar->display, CurrentTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
XSync(xvar->display, False);
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
XRRFreeCrtcInfo(crtc);
|
||||||
|
XRRFreeOutputInfo(o_info);
|
||||||
|
XRRFreeScreenResources(res);
|
||||||
|
}
|
||||||
25
minilibx/mlx_flush_event.c
Executable file
25
minilibx/mlx_flush_event.c
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
** mlx_flush_event.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Wed Aug 2 18:58:11 2000 Charlie Root
|
||||||
|
** Last update Fri Feb 23 17:08:48 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_flush_event(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
while (XPending(xvar->display))
|
||||||
|
{
|
||||||
|
XNextEvent(xvar->display,&ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
33
minilibx/mlx_get_color_value.c
Executable file
33
minilibx/mlx_get_color_value.c
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
** mlx_get_color_value.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Jul 31 19:01:33 2000 Charlie Root
|
||||||
|
** Last update Thu Oct 4 15:04:13 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_get_color_value(t_xvar *xvar,int color)
|
||||||
|
{
|
||||||
|
return(mlx_int_get_good_color(xvar,color));
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_int_get_good_color(t_xvar *xvar,int color)
|
||||||
|
{
|
||||||
|
XColor xc;
|
||||||
|
|
||||||
|
if (xvar->depth>=24)
|
||||||
|
return (color);
|
||||||
|
xc.red = (color>>8)&0xFF00;
|
||||||
|
xc.green = color&0xFF00;
|
||||||
|
xc.blue = (color<<8)&0xFF00;
|
||||||
|
xc.pixel = ((xc.red>>(16-xvar->decrgb[1]))<<xvar->decrgb[0])+
|
||||||
|
((xc.green>>(16-xvar->decrgb[3]))<<xvar->decrgb[2])+
|
||||||
|
((xc.blue>>(16-xvar->decrgb[5]))<<xvar->decrgb[4]);
|
||||||
|
return (xc.pixel);
|
||||||
|
}
|
||||||
23
minilibx/mlx_get_data_addr.c
Executable file
23
minilibx/mlx_get_data_addr.c
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
** mlx_get_data_addr.c for MiniLibX in raytraceur
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Aug 14 15:45:57 2000 Charlie Root
|
||||||
|
** Last update Thu Sep 27 19:05:25 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
char *mlx_get_data_addr(t_img *img,int *bits_per_pixel,
|
||||||
|
int *size_line,int *endian)
|
||||||
|
{
|
||||||
|
*bits_per_pixel = img->bpp;
|
||||||
|
*size_line = img->size_line;
|
||||||
|
*endian = img->image->byte_order;
|
||||||
|
return (img->data);
|
||||||
|
}
|
||||||
40
minilibx/mlx_hook.c
Executable file
40
minilibx/mlx_hook.c
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
** mlx_hook.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Thu Aug 3 11:49:06 2000 Charlie Root
|
||||||
|
** Last update Fri Jan 28 17:05:28 2005 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_hook(t_win_list *win, int x_event, int x_mask,
|
||||||
|
int (*funct)(),void *param)
|
||||||
|
{
|
||||||
|
win->hooks[x_event].hook = funct;
|
||||||
|
win->hooks[x_event].param = param;
|
||||||
|
win->hooks[x_event].mask = x_mask;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_do_key_autorepeatoff(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
XAutoRepeatOff(xvar->display);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_do_key_autorepeaton(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
XAutoRepeatOn(xvar->display);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_do_sync(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
XSync(xvar->display, False);
|
||||||
|
}
|
||||||
99
minilibx/mlx_init.c
Executable file
99
minilibx/mlx_init.c
Executable file
@@ -0,0 +1,99 @@
|
|||||||
|
/*
|
||||||
|
** mlx_init.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Jul 31 16:52:42 2000 Charlie Root
|
||||||
|
** Last update Fri Jan 28 17:05:09 2005 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_init()
|
||||||
|
{
|
||||||
|
t_xvar *xvar;
|
||||||
|
|
||||||
|
if (!(xvar = malloc(sizeof(*xvar))))
|
||||||
|
return ((void*)0);
|
||||||
|
if ((xvar->display = XOpenDisplay("")) == 0)
|
||||||
|
{
|
||||||
|
free(xvar);
|
||||||
|
return ((void*)0);
|
||||||
|
}
|
||||||
|
xvar->screen = DefaultScreen(xvar->display);
|
||||||
|
xvar->root = DefaultRootWindow(xvar->display);
|
||||||
|
xvar->cmap = DefaultColormap(xvar->display,xvar->screen);
|
||||||
|
xvar->depth = DefaultDepth(xvar->display,xvar->screen);
|
||||||
|
if (mlx_int_get_visual(xvar)==-1)
|
||||||
|
{
|
||||||
|
printf(ERR_NO_TRUECOLOR);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
xvar->win_list = 0;
|
||||||
|
xvar->loop_hook = 0;
|
||||||
|
xvar->loop_param = (void *)0;
|
||||||
|
xvar->do_flush = 1;
|
||||||
|
xvar->wm_delete_window = XInternAtom (xvar->display, "WM_DELETE_WINDOW", False);
|
||||||
|
xvar->wm_protocols = XInternAtom (xvar->display, "WM_PROTOCOLS", False);
|
||||||
|
mlx_int_deal_shm(xvar);
|
||||||
|
if (xvar->private_cmap)
|
||||||
|
xvar->cmap = XCreateColormap(xvar->display,xvar->root,
|
||||||
|
xvar->visual,AllocNone);
|
||||||
|
mlx_int_rgb_conversion(xvar);
|
||||||
|
xvar->end_loop = 0;
|
||||||
|
return (xvar);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** pshm_format of -1 : Not XYBitmap|XYPixmap|ZPixmap
|
||||||
|
** alpha libX need a check of the DISPLAY env var, or shm is allowed
|
||||||
|
** in remote Xserver connections.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int mlx_int_deal_shm(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
int use_pshm;
|
||||||
|
int bidon;
|
||||||
|
char *dpy;
|
||||||
|
char buff[33];
|
||||||
|
|
||||||
|
xvar->use_xshm = XShmQueryVersion(xvar->display,&bidon,&bidon,&(use_pshm));
|
||||||
|
if (xvar->use_xshm && use_pshm)
|
||||||
|
xvar->pshm_format = XShmPixmapFormat(xvar->display);
|
||||||
|
else
|
||||||
|
xvar->pshm_format = -1;
|
||||||
|
gethostname(buff,32);
|
||||||
|
dpy = getenv(ENV_DISPLAY);
|
||||||
|
if (dpy && strlen(dpy) && *dpy!=':' && strncmp(dpy,buff,strlen(buff)) &&
|
||||||
|
strncmp(dpy,LOCALHOST,strlen(LOCALHOST)) )
|
||||||
|
{
|
||||||
|
xvar->pshm_format = -1;
|
||||||
|
xvar->use_xshm = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** TrueColor Visual is needed to have *_mask correctly set
|
||||||
|
*/
|
||||||
|
|
||||||
|
int mlx_int_rgb_conversion(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
bzero(xvar->decrgb,sizeof(int)*6);
|
||||||
|
while (!(xvar->visual->red_mask&1))
|
||||||
|
{ xvar->visual->red_mask >>= 1; xvar->decrgb[0] ++; }
|
||||||
|
while (xvar->visual->red_mask&1)
|
||||||
|
{ xvar->visual->red_mask >>= 1; xvar->decrgb[1] ++; }
|
||||||
|
while (!(xvar->visual->green_mask&1))
|
||||||
|
{ xvar->visual->green_mask >>= 1; xvar->decrgb[2] ++; }
|
||||||
|
while (xvar->visual->green_mask&1)
|
||||||
|
{ xvar->visual->green_mask >>= 1; xvar->decrgb[3] ++; }
|
||||||
|
while (!(xvar->visual->blue_mask&1))
|
||||||
|
{ xvar->visual->blue_mask >>= 1; xvar->decrgb[4] ++; }
|
||||||
|
while (xvar->visual->blue_mask&1)
|
||||||
|
{ xvar->visual->blue_mask >>= 1; xvar->decrgb[5] ++; }
|
||||||
|
}
|
||||||
140
minilibx/mlx_int.h
Executable file
140
minilibx/mlx_int.h
Executable file
@@ -0,0 +1,140 @@
|
|||||||
|
/*
|
||||||
|
** mlx_int.h for mlx in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Jul 31 16:45:48 2000 Charlie Root
|
||||||
|
** Last update Wed May 25 16:44:16 2011 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Internal settings for MiniLibX
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef MLX_INT_H
|
||||||
|
|
||||||
|
# define MLX_INT_H
|
||||||
|
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <stdio.h>
|
||||||
|
# include <string.h>
|
||||||
|
# include <unistd.h>
|
||||||
|
# include <fcntl.h>
|
||||||
|
# include <sys/mman.h>
|
||||||
|
# include <X11/Xlib.h>
|
||||||
|
# include <X11/Xutil.h>
|
||||||
|
# include <sys/ipc.h>
|
||||||
|
# include <sys/shm.h>
|
||||||
|
# include <X11/extensions/XShm.h>
|
||||||
|
# include <X11/XKBlib.h>
|
||||||
|
/* #include <X11/xpm.h> */
|
||||||
|
|
||||||
|
|
||||||
|
# define MLX_TYPE_SHM_PIXMAP 3
|
||||||
|
# define MLX_TYPE_SHM 2
|
||||||
|
# define MLX_TYPE_XIMAGE 1
|
||||||
|
|
||||||
|
# define MLX_MAX_EVENT LASTEvent
|
||||||
|
|
||||||
|
|
||||||
|
# define ENV_DISPLAY "DISPLAY"
|
||||||
|
# define LOCALHOST "localhost"
|
||||||
|
# define ERR_NO_TRUECOLOR "MinilibX Error : No TrueColor Visual available.\n"
|
||||||
|
# define WARN_SHM_ATTACH "MinilibX Warning : X server can't attach shared memory.\n"
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct s_xpm_col
|
||||||
|
{
|
||||||
|
int name;
|
||||||
|
int col;
|
||||||
|
} t_xpm_col;
|
||||||
|
|
||||||
|
|
||||||
|
struct s_col_name
|
||||||
|
{
|
||||||
|
char *name;
|
||||||
|
int color;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct s_event_list
|
||||||
|
{
|
||||||
|
int mask;
|
||||||
|
int (*hook)();
|
||||||
|
void *param;
|
||||||
|
} t_event_list;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct s_win_list
|
||||||
|
{
|
||||||
|
Window window;
|
||||||
|
GC gc;
|
||||||
|
struct s_win_list *next;
|
||||||
|
int (*mouse_hook)();
|
||||||
|
int (*key_hook)();
|
||||||
|
int (*expose_hook)();
|
||||||
|
void *mouse_param;
|
||||||
|
void *key_param;
|
||||||
|
void *expose_param;
|
||||||
|
t_event_list hooks[MLX_MAX_EVENT];
|
||||||
|
} t_win_list;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct s_img
|
||||||
|
{
|
||||||
|
XImage *image;
|
||||||
|
Pixmap pix;
|
||||||
|
GC gc;
|
||||||
|
int size_line;
|
||||||
|
int bpp;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
int type;
|
||||||
|
int format;
|
||||||
|
char *data;
|
||||||
|
XShmSegmentInfo shm;
|
||||||
|
} t_img;
|
||||||
|
|
||||||
|
typedef struct s_xvar
|
||||||
|
{
|
||||||
|
Display *display;
|
||||||
|
Window root;
|
||||||
|
int screen;
|
||||||
|
int depth;
|
||||||
|
Visual *visual;
|
||||||
|
Colormap cmap;
|
||||||
|
int private_cmap;
|
||||||
|
t_win_list *win_list;
|
||||||
|
int (*loop_hook)();
|
||||||
|
void *loop_param;
|
||||||
|
int use_xshm;
|
||||||
|
int pshm_format;
|
||||||
|
int do_flush;
|
||||||
|
int decrgb[6];
|
||||||
|
Atom wm_delete_window;
|
||||||
|
Atom wm_protocols;
|
||||||
|
int end_loop;
|
||||||
|
} t_xvar;
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_do_nothing();
|
||||||
|
int mlx_get_color_value();
|
||||||
|
int mlx_int_get_good_color();
|
||||||
|
int mlx_int_find_in_pcm();
|
||||||
|
int mlx_int_anti_resize_win();
|
||||||
|
int mlx_int_wait_first_expose();
|
||||||
|
int mlx_int_rgb_conversion();
|
||||||
|
int mlx_int_deal_shm();
|
||||||
|
void *mlx_int_new_xshm_image();
|
||||||
|
char **mlx_int_str_to_wordtab();
|
||||||
|
void *mlx_new_image();
|
||||||
|
int shm_att_pb();
|
||||||
|
int mlx_int_get_visual(t_xvar *xvar);
|
||||||
|
int mlx_int_set_win_event_mask(t_xvar *xvar);
|
||||||
|
int mlx_int_str_str_cote(char *str,char *find,int len);
|
||||||
|
int mlx_int_str_str(char *str,char *find,int len);
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
28
minilibx/mlx_int_anti_resize_win.c
Executable file
28
minilibx/mlx_int_anti_resize_win.c
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
** mlx_int_anti_resize_win.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Tue Aug 8 14:31:05 2000 Charlie Root
|
||||||
|
** Last update Tue Sep 25 15:56:58 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_anti_resize_win(t_xvar *xvar,Window win,int w,int h)
|
||||||
|
{
|
||||||
|
XSizeHints hints;
|
||||||
|
long toto;
|
||||||
|
|
||||||
|
XGetWMNormalHints(xvar->display,win,&hints,&toto);
|
||||||
|
hints.width = w;
|
||||||
|
hints.height = h;
|
||||||
|
hints.min_width = w;
|
||||||
|
hints.min_height = h;
|
||||||
|
hints.max_width = w;
|
||||||
|
hints.max_height = h;
|
||||||
|
hints.flags = PPosition | PSize | PMinSize | PMaxSize;
|
||||||
|
XSetWMNormalHints(xvar->display,win,&hints);
|
||||||
|
}
|
||||||
16
minilibx/mlx_int_do_nothing.c
Executable file
16
minilibx/mlx_int_do_nothing.c
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
** mlx_int_do_nothing.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Tue Aug 8 12:58:24 2000 Charlie Root
|
||||||
|
** Last update Tue Sep 25 15:56:22 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_do_nothing(void *param)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
39
minilibx/mlx_int_get_visual.c
Executable file
39
minilibx/mlx_int_get_visual.c
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
** mlx_int_get_visual.c for MinilibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Wed Oct 3 17:01:51 2001 Charlie Root
|
||||||
|
** Last update Thu Oct 4 15:00:45 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** We need a private colormap for non-default Visual.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_get_visual(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
XVisualInfo *vi;
|
||||||
|
XVisualInfo template;
|
||||||
|
int nb_item;
|
||||||
|
|
||||||
|
xvar->private_cmap = 0;
|
||||||
|
xvar->visual = DefaultVisual(xvar->display,xvar->screen);
|
||||||
|
if (xvar->visual->class == TrueColor)
|
||||||
|
return (0);
|
||||||
|
template.class = TrueColor;
|
||||||
|
template.depth = xvar->depth;
|
||||||
|
if (!(vi = XGetVisualInfo(xvar->display,VisualDepthMask|VisualClassMask,
|
||||||
|
&template,&nb_item)) )
|
||||||
|
return (-1);
|
||||||
|
xvar->visual = vi->visual;
|
||||||
|
xvar->private_cmap = 1;
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
100
minilibx/mlx_int_param_event.c
Executable file
100
minilibx/mlx_int_param_event.c
Executable file
@@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
** mlx_int_param_event.c for MinilibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Jul 31 16:37:50 2000 Charlie Root
|
||||||
|
** Last update Wed Oct 6 13:14:52 2004 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
int mlx_int_param_undef()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_int_param_KeyPress(t_xvar *xvar, XEvent *ev, t_win_list *win)
|
||||||
|
{
|
||||||
|
win->hooks[KeyPress].hook(XkbKeycodeToKeysym(xvar->display,
|
||||||
|
ev->xkey.keycode, 0, 0),
|
||||||
|
win->hooks[KeyPress].param);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_int_param_KeyRelease(t_xvar *xvar, XEvent *ev, t_win_list *win)
|
||||||
|
{
|
||||||
|
win->hooks[KeyRelease].hook(XkbKeycodeToKeysym(xvar->display,
|
||||||
|
ev->xkey.keycode, 0, 0),
|
||||||
|
win->hooks[KeyRelease].param);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_int_param_ButtonPress(t_xvar *xvar, XEvent *ev, t_win_list *win)
|
||||||
|
{
|
||||||
|
win->hooks[ButtonPress].hook(ev->xbutton.button,ev->xbutton.x,ev->xbutton.y,
|
||||||
|
win->hooks[ButtonPress].param);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_int_param_ButtonRelease(t_xvar *xvar, XEvent *ev, t_win_list *win)
|
||||||
|
{
|
||||||
|
win->hooks[ButtonRelease].hook(ev->xbutton.button,
|
||||||
|
ev->xbutton.x, ev->xbutton.y,
|
||||||
|
win->hooks[ButtonRelease].param);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_int_param_MotionNotify(t_xvar *xvar, XEvent *ev, t_win_list *win)
|
||||||
|
{
|
||||||
|
win->hooks[MotionNotify].hook(ev->xbutton.x,ev->xbutton.y,
|
||||||
|
win->hooks[MotionNotify].param);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_int_param_Expose(t_xvar *xvar, XEvent *ev, t_win_list *win)
|
||||||
|
{
|
||||||
|
if (!ev->xexpose.count)
|
||||||
|
win->hooks[Expose].hook(win->hooks[Expose].param);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_param_generic(t_xvar *xvar, XEvent *ev, t_win_list *win)
|
||||||
|
{
|
||||||
|
win->hooks[ev->type].hook(win->hooks[ev->type].param);
|
||||||
|
}
|
||||||
|
|
||||||
|
int (*(mlx_int_param_event[]))() =
|
||||||
|
{
|
||||||
|
mlx_int_param_undef, /* 0 */
|
||||||
|
mlx_int_param_undef,
|
||||||
|
mlx_int_param_KeyPress,
|
||||||
|
mlx_int_param_KeyRelease, /* 3 */
|
||||||
|
mlx_int_param_ButtonPress,
|
||||||
|
mlx_int_param_ButtonRelease,
|
||||||
|
mlx_int_param_MotionNotify, /* 6 */
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_Expose, /* 12 */
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic,
|
||||||
|
mlx_int_param_generic
|
||||||
|
};
|
||||||
34
minilibx/mlx_int_set_win_event_mask.c
Executable file
34
minilibx/mlx_int_set_win_event_mask.c
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
** mlx_int_set_win_event_mask.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Thu Aug 3 11:49:06 2000 Charlie Root
|
||||||
|
** Last update Fri Feb 23 17:07:42 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_set_win_event_mask(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
t_win_list *win;
|
||||||
|
int mask;
|
||||||
|
int i;
|
||||||
|
XSetWindowAttributes xwa;
|
||||||
|
|
||||||
|
win = xvar->win_list;
|
||||||
|
while (win)
|
||||||
|
{
|
||||||
|
xwa.event_mask = 0;
|
||||||
|
i = MLX_MAX_EVENT;
|
||||||
|
while (i--)
|
||||||
|
xwa.event_mask |= win->hooks[i].mask;
|
||||||
|
XChangeWindowAttributes(xvar->display, win->window, CWEventMask, &xwa);
|
||||||
|
win = win->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
113
minilibx/mlx_int_str_to_wordtab.c
Executable file
113
minilibx/mlx_int_str_to_wordtab.c
Executable file
@@ -0,0 +1,113 @@
|
|||||||
|
/*
|
||||||
|
** mlx_int_str_to_wordtab.c for MinilibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Wed Sep 13 11:36:09 2000 Charlie Root
|
||||||
|
** Last update Fri Dec 14 11:02:09 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_str_str(char *str,char *find,int len)
|
||||||
|
{
|
||||||
|
int len_f;
|
||||||
|
int pos;
|
||||||
|
char *s;
|
||||||
|
char *f;
|
||||||
|
|
||||||
|
len_f = strlen(find);
|
||||||
|
if (len_f>len)
|
||||||
|
return (-1);
|
||||||
|
pos = 0;
|
||||||
|
while (*(str+len_f-1))
|
||||||
|
{
|
||||||
|
s = str;
|
||||||
|
f = find;
|
||||||
|
while (*(f++) == *(s++))
|
||||||
|
if (!*f)
|
||||||
|
return (pos);
|
||||||
|
str ++;
|
||||||
|
pos ++;
|
||||||
|
}
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_str_str_cote(char *str,char *find,int len)
|
||||||
|
{
|
||||||
|
int len_f;
|
||||||
|
int pos;
|
||||||
|
char *s;
|
||||||
|
char *f;
|
||||||
|
int cote;
|
||||||
|
|
||||||
|
len_f = strlen(find);
|
||||||
|
if (len_f>len)
|
||||||
|
return (-1);
|
||||||
|
cote = 0;
|
||||||
|
pos = 0;
|
||||||
|
while (*(str+len_f-1))
|
||||||
|
{
|
||||||
|
if (*str=='"')
|
||||||
|
cote = 1-cote;
|
||||||
|
if (!cote)
|
||||||
|
{
|
||||||
|
s = str;
|
||||||
|
f = find;
|
||||||
|
while (*(f++) == *(s++))
|
||||||
|
if (!*f)
|
||||||
|
return (pos);
|
||||||
|
}
|
||||||
|
str ++;
|
||||||
|
pos ++;
|
||||||
|
}
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char **mlx_int_str_to_wordtab(char *str)
|
||||||
|
{
|
||||||
|
char **tab;
|
||||||
|
int pos;
|
||||||
|
int nb_word;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
len = strlen(str);
|
||||||
|
nb_word = 0;
|
||||||
|
pos = 0;
|
||||||
|
while (pos<len)
|
||||||
|
{
|
||||||
|
while (*(str+pos)==' ' || *(str+pos)=='\t')
|
||||||
|
pos ++;
|
||||||
|
if (*(str+pos))
|
||||||
|
nb_word ++;
|
||||||
|
while (*(str+pos) && *(str+pos)!=' ' && *(str+pos)!='\t')
|
||||||
|
pos ++;
|
||||||
|
}
|
||||||
|
if (!(tab = malloc((1+nb_word)*sizeof(*tab))))
|
||||||
|
return ((char **)0);
|
||||||
|
nb_word = 0;
|
||||||
|
pos = 0;
|
||||||
|
while (pos<len)
|
||||||
|
{
|
||||||
|
while (*(str+pos)==' ' || *(str+pos)=='\t')
|
||||||
|
{
|
||||||
|
*(str+pos) = 0;
|
||||||
|
pos ++;
|
||||||
|
}
|
||||||
|
if (*(str+pos))
|
||||||
|
{
|
||||||
|
tab[nb_word] = str+pos;
|
||||||
|
nb_word ++;
|
||||||
|
}
|
||||||
|
while (*(str+pos) && *(str+pos)!=' ' && *(str+pos)!='\t')
|
||||||
|
pos ++;
|
||||||
|
}
|
||||||
|
tab[nb_word] = 0;
|
||||||
|
return (tab);
|
||||||
|
}
|
||||||
23
minilibx/mlx_int_wait_first_expose.c
Executable file
23
minilibx/mlx_int_wait_first_expose.c
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
** mlx_int_wait_first_expose.c for minilibx in
|
||||||
|
**
|
||||||
|
** Made by olivier crouzet
|
||||||
|
** Login <ol@epita.fr>
|
||||||
|
**
|
||||||
|
** Started on Tue Oct 17 09:26:45 2000 olivier crouzet
|
||||||
|
** Last update Fri Feb 23 17:27:10 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_wait_first_expose(t_xvar *xvar,Window win)
|
||||||
|
{
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
XWindowEvent(xvar->display,win,ExposureMask,&ev);
|
||||||
|
XPutBackEvent(xvar->display,&ev);
|
||||||
|
}
|
||||||
22
minilibx/mlx_key_hook.c
Executable file
22
minilibx/mlx_key_hook.c
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
** mlx_key_hook.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Thu Aug 3 11:49:06 2000 Charlie Root
|
||||||
|
** Last update Fri Feb 23 17:10:09 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_key_hook(t_win_list *win,int (*funct)(),void *param)
|
||||||
|
{
|
||||||
|
win->hooks[KeyRelease].hook = funct;
|
||||||
|
win->hooks[KeyRelease].param = param;
|
||||||
|
win->hooks[KeyRelease].mask = KeyReleaseMask;
|
||||||
|
}
|
||||||
96
minilibx/mlx_lib_xpm.c
Executable file
96
minilibx/mlx_lib_xpm.c
Executable file
@@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
** mlx_xpm.c for minilibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Fri Dec 8 11:07:24 2000 Charlie Root
|
||||||
|
** Last update Thu Oct 4 16:00:22 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_int_xpm_f_image(t_xvar *xvar,int *width,int *height,
|
||||||
|
int (*xpm_func)(),void *param)
|
||||||
|
{
|
||||||
|
XImage *img1;
|
||||||
|
XImage *img2;
|
||||||
|
t_img *im2;
|
||||||
|
XpmAttributes xpm_att;
|
||||||
|
|
||||||
|
xpm_att.visual = xvar->visual;
|
||||||
|
xpm_att.colormap = xvar->cmap;
|
||||||
|
xpm_att.depth = xvar->depth;
|
||||||
|
xpm_att.bitmap_format = ZPixmap;
|
||||||
|
xpm_att.valuemask = XpmDepth|XpmBitmapFormat|XpmVisual|XpmColormap;
|
||||||
|
if (xpm_func(xvar->display,param,&img1,&img2,&xpm_att))
|
||||||
|
return ((void *)0);
|
||||||
|
if (img2)
|
||||||
|
XDestroyImage(img2);
|
||||||
|
|
||||||
|
if (!(im2 = (void *)mlx_new_image(xvar,img1->width,img1->height)))
|
||||||
|
{
|
||||||
|
XDestroyImage(img1);
|
||||||
|
return ((void *)0);
|
||||||
|
}
|
||||||
|
*width = img1->width;
|
||||||
|
*height = img1->height;
|
||||||
|
if (mlx_int_egal_img(im2->image,img1))
|
||||||
|
{
|
||||||
|
bcopy(img1->data,im2->data,img1->height*img1->bytes_per_line);
|
||||||
|
XDestroyImage(img1);
|
||||||
|
return (im2);
|
||||||
|
}
|
||||||
|
if (im2->type==MLX_TYPE_SHM_PIXMAP)
|
||||||
|
{
|
||||||
|
XFreePixmap(xvar->display,im2->pix);
|
||||||
|
im2->pix = XCreatePixmap(xvar->display,xvar->root,
|
||||||
|
*width,*height,xvar->depth);
|
||||||
|
}
|
||||||
|
if (im2->type>MLX_TYPE_XIMAGE)
|
||||||
|
{
|
||||||
|
XShmDetach(xvar->display,&(im2->shm));
|
||||||
|
shmdt(im2->data);
|
||||||
|
}
|
||||||
|
XDestroyImage(im2->image);
|
||||||
|
im2->image = img1;
|
||||||
|
im2->data = img1->data;
|
||||||
|
im2->type = MLX_TYPE_XIMAGE;
|
||||||
|
im2->size_line = img1->bytes_per_line;
|
||||||
|
im2->bpp = img1->bits_per_pixel;
|
||||||
|
return (im2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_egal_img(XImage *img1,XImage *img2)
|
||||||
|
{
|
||||||
|
if (img1->width!=img2->width || img1->height!=img2->height ||
|
||||||
|
img1->xoffset!=img2->xoffset || img1->format!=img2->format ||
|
||||||
|
img1->byte_order!=img2->byte_order ||
|
||||||
|
img1->bitmap_unit!=img2->bitmap_unit ||
|
||||||
|
img1->bitmap_bit_order!=img2->bitmap_bit_order ||
|
||||||
|
img1->bitmap_pad!=img2->bitmap_pad || img1->depth!=img2->depth ||
|
||||||
|
img1->bytes_per_line!=img2->bytes_per_line ||
|
||||||
|
img1->bits_per_pixel!=img2->bits_per_pixel ||
|
||||||
|
img1->red_mask!=img2->red_mask || img1->green_mask!=img2->green_mask ||
|
||||||
|
img1->blue_mask!=img2->blue_mask )
|
||||||
|
return (0);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_xpm_file_to_image(t_xvar *xvar,char *filename,
|
||||||
|
int *width,int *height)
|
||||||
|
{
|
||||||
|
return (mlx_int_xpm_f_image(xvar,width,height,XpmReadFileToImage,filename));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_xpm_to_image(t_xvar *xvar,char **data,int *width,int *height)
|
||||||
|
{
|
||||||
|
return (mlx_int_xpm_f_image(xvar,width,height,XpmCreateImageFromData,(void *)data));
|
||||||
|
}
|
||||||
63
minilibx/mlx_loop.c
Executable file
63
minilibx/mlx_loop.c
Executable file
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
** mlx_loop.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Wed Aug 2 18:58:11 2000 Charlie Root
|
||||||
|
** Last update Fri Sep 30 14:47:41 2005 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
extern int (*(mlx_int_param_event[]))();
|
||||||
|
|
||||||
|
static int win_count(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
t_win_list *win;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
win = xvar->win_list;
|
||||||
|
while (win)
|
||||||
|
{
|
||||||
|
win = win->next;
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
return (i);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_loop_end(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
xvar->end_loop = 1;
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_loop(t_xvar *xvar)
|
||||||
|
{
|
||||||
|
XEvent ev;
|
||||||
|
t_win_list *win;
|
||||||
|
|
||||||
|
mlx_int_set_win_event_mask(xvar);
|
||||||
|
xvar->do_flush = 0;
|
||||||
|
while (win_count(xvar) && !xvar->end_loop)
|
||||||
|
{
|
||||||
|
while (!xvar->end_loop && (!xvar->loop_hook || XPending(xvar->display)))
|
||||||
|
{
|
||||||
|
XNextEvent(xvar->display,&ev);
|
||||||
|
win = xvar->win_list;
|
||||||
|
while (win && (win->window!=ev.xany.window))
|
||||||
|
win = win->next;
|
||||||
|
|
||||||
|
if (win && ev.type == ClientMessage && ev.xclient.message_type == xvar->wm_protocols && ev.xclient.data.l[0] == xvar->wm_delete_window && win->hooks[DestroyNotify].hook)
|
||||||
|
win->hooks[DestroyNotify].hook(win->hooks[DestroyNotify].param);
|
||||||
|
if (win && ev.type < MLX_MAX_EVENT && win->hooks[ev.type].hook)
|
||||||
|
mlx_int_param_event[ev.type](xvar, &ev, win);
|
||||||
|
}
|
||||||
|
XSync(xvar->display, False);
|
||||||
|
if (xvar->loop_hook)
|
||||||
|
xvar->loop_hook(xvar->loop_param);
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
21
minilibx/mlx_loop_hook.c
Executable file
21
minilibx/mlx_loop_hook.c
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
** mlx_loop_hook.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Thu Aug 3 11:49:06 2000 Charlie Root
|
||||||
|
** Last update Fri Feb 23 17:11:39 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_loop_hook(t_xvar *xvar,int (*funct)(),void *param)
|
||||||
|
{
|
||||||
|
xvar->loop_hook = funct;
|
||||||
|
xvar->loop_param = param;
|
||||||
|
}
|
||||||
48
minilibx/mlx_mouse.c
Executable file
48
minilibx/mlx_mouse.c
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
int mlx_mouse_move(t_xvar *xvar, t_win_list *win, int x, int y)
|
||||||
|
{
|
||||||
|
XWarpPointer(xvar->display, None, win->window, 0, 0, 0, 0, x, y);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_mouse_hide(t_xvar *xvar, t_win_list *win)
|
||||||
|
{
|
||||||
|
static char data[1] = {0};
|
||||||
|
Cursor cursor;
|
||||||
|
Pixmap blank;
|
||||||
|
XColor dummy;
|
||||||
|
|
||||||
|
blank = XCreateBitmapFromData(xvar->display, win->window, data, 1, 1);
|
||||||
|
cursor = XCreatePixmapCursor(xvar->display, blank, blank, &dummy, &dummy, 0, 0);
|
||||||
|
XDefineCursor(xvar->display, win->window, cursor);
|
||||||
|
XFreePixmap(xvar->display, blank);
|
||||||
|
XFreeCursor(xvar->display, cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_mouse_show(t_xvar *xvar, t_win_list *win)
|
||||||
|
{
|
||||||
|
XUndefineCursor(xvar->display, win->window);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Queries the position of the mouse pointer relative to the origin of the
|
||||||
|
** specified window and saves it to the provided location.
|
||||||
|
**
|
||||||
|
** If the pointer is not on the same screen as the specified window, both
|
||||||
|
** win_x_return and win_y_return are set to zero and the function returns 0.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int mlx_mouse_get_pos(t_xvar *xvar, t_win_list *win, \
|
||||||
|
int *win_x_return, int *win_y_return)
|
||||||
|
{
|
||||||
|
Window root_return;
|
||||||
|
Window child_return;
|
||||||
|
int root_x_return;
|
||||||
|
int root_y_return;
|
||||||
|
unsigned mask_return;
|
||||||
|
|
||||||
|
return (XQueryPointer(xvar->display, win->window, \
|
||||||
|
&root_return, &child_return, &root_x_return, &root_y_return, \
|
||||||
|
win_x_return, win_y_return, &mask_return));
|
||||||
|
}
|
||||||
22
minilibx/mlx_mouse_hook.c
Executable file
22
minilibx/mlx_mouse_hook.c
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
** mlx_mouse_hook.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Thu Aug 3 11:49:06 2000 Charlie Root
|
||||||
|
** Last update Fri Feb 23 17:11:05 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_mouse_hook(t_win_list *win,int (*funct)(),void *param)
|
||||||
|
{
|
||||||
|
win->hooks[ButtonPress].hook = funct;
|
||||||
|
win->hooks[ButtonPress].param = param;
|
||||||
|
win->hooks[ButtonPress].mask = ButtonPressMask;
|
||||||
|
}
|
||||||
159
minilibx/mlx_new_image.c
Executable file
159
minilibx/mlx_new_image.c
Executable file
@@ -0,0 +1,159 @@
|
|||||||
|
/*
|
||||||
|
** mlx_new_image.c for MiniLibX in raytraceur
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Aug 14 15:29:14 2000 Charlie Root
|
||||||
|
** Last update Wed May 25 16:46:31 2011 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
** To handle X errors
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define X_ShmAttach 1
|
||||||
|
|
||||||
|
int mlx_X_error;
|
||||||
|
|
||||||
|
int shm_att_pb(Display *d,XErrorEvent *ev)
|
||||||
|
{
|
||||||
|
if (ev->request_code==146 && ev->minor_code==X_ShmAttach)
|
||||||
|
write(2,WARN_SHM_ATTACH,strlen(WARN_SHM_ATTACH));
|
||||||
|
mlx_X_error = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Data malloc : width+32 ( bitmap_pad=32 ), *4 = *32 / 8bit
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_int_new_xshm_image(t_xvar *xvar,int width,int height,int format)
|
||||||
|
{
|
||||||
|
t_img *img;
|
||||||
|
int (*save_handler)();
|
||||||
|
|
||||||
|
if (!(img = malloc(sizeof(*img))))
|
||||||
|
return ((void *)0);
|
||||||
|
bzero(img,sizeof(*img));
|
||||||
|
img->data = 0;
|
||||||
|
img->image = XShmCreateImage(xvar->display,xvar->visual,xvar->depth,
|
||||||
|
format,img->data,&(img->shm),width,height);
|
||||||
|
if (!img->image)
|
||||||
|
{
|
||||||
|
free(img);
|
||||||
|
return ((void *)0);
|
||||||
|
}
|
||||||
|
img->width = width;
|
||||||
|
img->height = height;
|
||||||
|
img->size_line = img->image->bytes_per_line;
|
||||||
|
img->bpp = img->image->bits_per_pixel;
|
||||||
|
img->format = format;
|
||||||
|
img->shm.shmid = shmget(IPC_PRIVATE,(width+32)*height*4,IPC_CREAT|0777);
|
||||||
|
if (img->shm.shmid==-1)
|
||||||
|
{
|
||||||
|
XDestroyImage(img->image);
|
||||||
|
free(img);
|
||||||
|
return ((void *)0);
|
||||||
|
}
|
||||||
|
img->data = img->shm.shmaddr = img->image->data = shmat(img->shm.shmid,0,0);
|
||||||
|
if (img->data==(void *)-1)
|
||||||
|
{
|
||||||
|
shmctl(img->shm.shmid,IPC_RMID,0);
|
||||||
|
XDestroyImage(img->image);
|
||||||
|
free(img);
|
||||||
|
return ((void *)0);
|
||||||
|
}
|
||||||
|
img->shm.readOnly = False;
|
||||||
|
mlx_X_error = 0;
|
||||||
|
save_handler = XSetErrorHandler(shm_att_pb);
|
||||||
|
if (!XShmAttach(xvar->display,&(img->shm)) ||
|
||||||
|
0&XSync(xvar->display,False) || mlx_X_error)
|
||||||
|
{
|
||||||
|
XSetErrorHandler(save_handler);
|
||||||
|
shmdt(img->data);
|
||||||
|
shmctl(img->shm.shmid,IPC_RMID,0);
|
||||||
|
XDestroyImage(img->image);
|
||||||
|
free(img);
|
||||||
|
return ((void *)0);
|
||||||
|
}
|
||||||
|
XSetErrorHandler(save_handler);
|
||||||
|
shmctl(img->shm.shmid,IPC_RMID,0);
|
||||||
|
if (xvar->pshm_format==format)
|
||||||
|
{
|
||||||
|
img->pix = XShmCreatePixmap(xvar->display,xvar->root,img->shm.shmaddr,
|
||||||
|
&(img->shm),width,height,xvar->depth);
|
||||||
|
img->type = MLX_TYPE_SHM_PIXMAP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
img->pix = XCreatePixmap(xvar->display,xvar->root,
|
||||||
|
width,height,xvar->depth);
|
||||||
|
img->type = MLX_TYPE_SHM;
|
||||||
|
}
|
||||||
|
if (xvar->do_flush)
|
||||||
|
XFlush(xvar->display);
|
||||||
|
return (img);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_int_new_image(t_xvar *xvar,int width, int height,int format)
|
||||||
|
{
|
||||||
|
t_img *img;
|
||||||
|
|
||||||
|
if (!(img = malloc(sizeof(*img))))
|
||||||
|
return ((void *)0);
|
||||||
|
if (!(img->data = malloc((width+32)*height*4)))
|
||||||
|
{
|
||||||
|
free(img);
|
||||||
|
return ((void *)0);
|
||||||
|
}
|
||||||
|
bzero(img->data,(width+32)*height*4);
|
||||||
|
img->image = XCreateImage(xvar->display,xvar->visual,xvar->depth,format,0,
|
||||||
|
img->data,width,height,32,0);
|
||||||
|
if (!img->image)
|
||||||
|
{
|
||||||
|
free(img->data);
|
||||||
|
free(img);
|
||||||
|
return ((void *)0);
|
||||||
|
}
|
||||||
|
img->gc = 0;
|
||||||
|
img->size_line = img->image->bytes_per_line;
|
||||||
|
img->bpp = img->image->bits_per_pixel;
|
||||||
|
img->width = width;
|
||||||
|
img->height = height;
|
||||||
|
img->pix = XCreatePixmap(xvar->display,xvar->root,width,height,xvar->depth);
|
||||||
|
img->format = format;
|
||||||
|
img->type = MLX_TYPE_XIMAGE;
|
||||||
|
if (xvar->do_flush)
|
||||||
|
XFlush(xvar->display);
|
||||||
|
return (img);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_new_image(t_xvar *xvar,int width, int height)
|
||||||
|
{
|
||||||
|
t_img *img;
|
||||||
|
|
||||||
|
if (xvar->use_xshm)
|
||||||
|
if (img = mlx_int_new_xshm_image(xvar,width,height,ZPixmap))
|
||||||
|
return (img);
|
||||||
|
return (mlx_int_new_image(xvar,width,height,ZPixmap));
|
||||||
|
}
|
||||||
|
|
||||||
|
void *mlx_new_image2(t_xvar *xvar,int width, int height)
|
||||||
|
{
|
||||||
|
t_img *img;
|
||||||
|
|
||||||
|
if (xvar->use_xshm)
|
||||||
|
if (img = mlx_int_new_xshm_image(xvar,width,height,XYPixmap))
|
||||||
|
return (img);
|
||||||
|
return (mlx_int_new_image(xvar,width,height,XYPixmap));
|
||||||
|
}
|
||||||
62
minilibx/mlx_new_window.c
Executable file
62
minilibx/mlx_new_window.c
Executable file
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
** mlx_new_window.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Jul 31 17:29:02 2000 Charlie Root
|
||||||
|
** Last update Thu Oct 4 15:44:43 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
** We do not use White/BlackPixel macro, TrueColor Visual make sure
|
||||||
|
** 0 is black & -1 is white
|
||||||
|
**
|
||||||
|
** With mlx_int_wait_first_expose, no flush is needed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_new_window(t_xvar *xvar,int size_x,int size_y,char *title)
|
||||||
|
{
|
||||||
|
t_win_list *new_win;
|
||||||
|
XSetWindowAttributes xswa;
|
||||||
|
XGCValues xgcv;
|
||||||
|
|
||||||
|
xswa.background_pixel = 0;
|
||||||
|
xswa.border_pixel = -1;
|
||||||
|
xswa.colormap = xvar->cmap;
|
||||||
|
/*
|
||||||
|
xswa.event_mask = ButtonPressMask | ButtonReleaseMask | ExposureMask |
|
||||||
|
KeyPressMask | KeyReleaseMask | StructureNotifyMask;
|
||||||
|
*/
|
||||||
|
/* xswa.event_mask = ExposureMask; */
|
||||||
|
xswa.event_mask = 0xFFFFFF; /* all events */
|
||||||
|
if (!(new_win = malloc(sizeof(*new_win))))
|
||||||
|
return ((void *)0);
|
||||||
|
new_win->window = XCreateWindow(xvar->display,xvar->root,0,0,size_x,size_y,
|
||||||
|
0,CopyFromParent,InputOutput,xvar->visual,
|
||||||
|
CWEventMask|CWBackPixel|CWBorderPixel|
|
||||||
|
CWColormap,&xswa);
|
||||||
|
mlx_int_anti_resize_win(xvar,new_win->window,size_x,size_y);
|
||||||
|
XStoreName(xvar->display,new_win->window,title);
|
||||||
|
XSetWMProtocols(xvar->display, new_win->window, &(xvar->wm_delete_window), 1);
|
||||||
|
xgcv.foreground = -1;
|
||||||
|
xgcv.function = GXcopy;
|
||||||
|
xgcv.plane_mask = AllPlanes;
|
||||||
|
new_win->gc = XCreateGC(xvar->display,new_win->window,
|
||||||
|
GCFunction|GCPlaneMask|GCForeground,&xgcv);
|
||||||
|
new_win->next = xvar->win_list;
|
||||||
|
xvar->win_list = new_win;
|
||||||
|
/*
|
||||||
|
new_win->mouse_hook = mlx_int_do_nothing;
|
||||||
|
new_win->key_hook = mlx_int_do_nothing;
|
||||||
|
new_win->expose_hook = mlx_int_do_nothing;
|
||||||
|
*/
|
||||||
|
bzero(&(new_win->hooks), sizeof(new_win->hooks));
|
||||||
|
XMapRaised(xvar->display,new_win->window);
|
||||||
|
mlx_int_wait_first_expose(xvar,new_win->window);
|
||||||
|
return (new_win);
|
||||||
|
}
|
||||||
26
minilibx/mlx_pixel_put.c
Executable file
26
minilibx/mlx_pixel_put.c
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
** mlx_pixel_put.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Jul 31 19:01:33 2000 Charlie Root
|
||||||
|
** Last update Tue Sep 25 17:09:49 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_pixel_put(t_xvar *xvar,t_win_list *win,
|
||||||
|
int x,int y,int color)
|
||||||
|
{
|
||||||
|
XGCValues xgcv;
|
||||||
|
|
||||||
|
xgcv.foreground = mlx_int_get_good_color(xvar,color);
|
||||||
|
XChangeGC(xvar->display,win->gc,GCForeground,&xgcv);
|
||||||
|
XDrawPoint(xvar->display,win->window,win->gc,x,y);
|
||||||
|
if (xvar->do_flush)
|
||||||
|
XFlush(xvar->display);
|
||||||
|
}
|
||||||
37
minilibx/mlx_put_image_to_window.c
Executable file
37
minilibx/mlx_put_image_to_window.c
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
** mlx_put_image_to_window.c for MiniLibX in raytraceur
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Aug 14 15:55:49 2000 Charlie Root
|
||||||
|
** Last update Sun Oct 2 09:53:00 2005 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_put_image_to_window(t_xvar *xvar,t_win_list *win,t_img *img,
|
||||||
|
int x,int y)
|
||||||
|
{
|
||||||
|
GC gc;
|
||||||
|
|
||||||
|
gc = win->gc;
|
||||||
|
if (img->gc)
|
||||||
|
{
|
||||||
|
gc = img->gc;
|
||||||
|
XSetClipOrigin(xvar->display, gc, x, y);
|
||||||
|
}
|
||||||
|
if (img->type==MLX_TYPE_SHM)
|
||||||
|
XShmPutImage(xvar->display,img->pix, win->gc, img->image,0,0,0,0,
|
||||||
|
img->width,img->height,False);
|
||||||
|
if (img->type==MLX_TYPE_XIMAGE)
|
||||||
|
XPutImage(xvar->display,img->pix, win->gc, img->image,0,0,0,0,
|
||||||
|
img->width,img->height);
|
||||||
|
XCopyArea(xvar->display,img->pix,win->window, gc,
|
||||||
|
0,0,img->width,img->height,x,y);
|
||||||
|
if (xvar->do_flush)
|
||||||
|
XFlush(xvar->display);
|
||||||
|
}
|
||||||
764
minilibx/mlx_rgb.c
Executable file
764
minilibx/mlx_rgb.c
Executable file
@@ -0,0 +1,764 @@
|
|||||||
|
/*
|
||||||
|
** This is a generated file with rgb2c.pl and rgb.txt from
|
||||||
|
** the XFree86 distribution.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
struct s_col_name mlx_col_name[] =
|
||||||
|
{
|
||||||
|
{ "snow" , 0xfffafa },
|
||||||
|
{ "ghost white" , 0xf8f8ff },
|
||||||
|
{ "ghostwhite" , 0xf8f8ff },
|
||||||
|
{ "white smoke" , 0xf5f5f5 },
|
||||||
|
{ "whitesmoke" , 0xf5f5f5 },
|
||||||
|
{ "gainsboro" , 0xdcdcdc },
|
||||||
|
{ "floral white" , 0xfffaf0 },
|
||||||
|
{ "floralwhite" , 0xfffaf0 },
|
||||||
|
{ "old lace" , 0xfdf5e6 },
|
||||||
|
{ "oldlace" , 0xfdf5e6 },
|
||||||
|
{ "linen" , 0xfaf0e6 },
|
||||||
|
{ "antique white" , 0xfaebd7 },
|
||||||
|
{ "antiquewhite" , 0xfaebd7 },
|
||||||
|
{ "papaya whip" , 0xffefd5 },
|
||||||
|
{ "papayawhip" , 0xffefd5 },
|
||||||
|
{ "blanched almond" , 0xffebcd },
|
||||||
|
{ "blanchedalmond" , 0xffebcd },
|
||||||
|
{ "bisque" , 0xffe4c4 },
|
||||||
|
{ "peach puff" , 0xffdab9 },
|
||||||
|
{ "peachpuff" , 0xffdab9 },
|
||||||
|
{ "navajo white" , 0xffdead },
|
||||||
|
{ "navajowhite" , 0xffdead },
|
||||||
|
{ "moccasin" , 0xffe4b5 },
|
||||||
|
{ "cornsilk" , 0xfff8dc },
|
||||||
|
{ "ivory" , 0xfffff0 },
|
||||||
|
{ "lemon chiffon" , 0xfffacd },
|
||||||
|
{ "lemonchiffon" , 0xfffacd },
|
||||||
|
{ "seashell" , 0xfff5ee },
|
||||||
|
{ "honeydew" , 0xf0fff0 },
|
||||||
|
{ "mint cream" , 0xf5fffa },
|
||||||
|
{ "mintcream" , 0xf5fffa },
|
||||||
|
{ "azure" , 0xf0ffff },
|
||||||
|
{ "alice blue" , 0xf0f8ff },
|
||||||
|
{ "aliceblue" , 0xf0f8ff },
|
||||||
|
{ "lavender" , 0xe6e6fa },
|
||||||
|
{ "lavender blush" , 0xfff0f5 },
|
||||||
|
{ "lavenderblush" , 0xfff0f5 },
|
||||||
|
{ "misty rose" , 0xffe4e1 },
|
||||||
|
{ "mistyrose" , 0xffe4e1 },
|
||||||
|
{ "white" , 0xffffff },
|
||||||
|
{ "black" , 0x0 },
|
||||||
|
{ "dark slate" , 0x2f4f4f },
|
||||||
|
{ "darkslategray" , 0x2f4f4f },
|
||||||
|
{ "dark slate" , 0x2f4f4f },
|
||||||
|
{ "darkslategrey" , 0x2f4f4f },
|
||||||
|
{ "dim gray" , 0x696969 },
|
||||||
|
{ "dimgray" , 0x696969 },
|
||||||
|
{ "dim grey" , 0x696969 },
|
||||||
|
{ "dimgrey" , 0x696969 },
|
||||||
|
{ "slate gray" , 0x708090 },
|
||||||
|
{ "slategray" , 0x708090 },
|
||||||
|
{ "slate grey" , 0x708090 },
|
||||||
|
{ "slategrey" , 0x708090 },
|
||||||
|
{ "light slate" , 0x778899 },
|
||||||
|
{ "lightslategray" , 0x778899 },
|
||||||
|
{ "light slate" , 0x778899 },
|
||||||
|
{ "lightslategrey" , 0x778899 },
|
||||||
|
{ "gray" , 0xbebebe },
|
||||||
|
{ "grey" , 0xbebebe },
|
||||||
|
{ "light grey" , 0xd3d3d3 },
|
||||||
|
{ "lightgrey" , 0xd3d3d3 },
|
||||||
|
{ "light gray" , 0xd3d3d3 },
|
||||||
|
{ "lightgray" , 0xd3d3d3 },
|
||||||
|
{ "midnight blue" , 0x191970 },
|
||||||
|
{ "midnightblue" , 0x191970 },
|
||||||
|
{ "navy" , 0x80 },
|
||||||
|
{ "navy blue" , 0x80 },
|
||||||
|
{ "navyblue" , 0x80 },
|
||||||
|
{ "cornflower blue" , 0x6495ed },
|
||||||
|
{ "cornflowerblue" , 0x6495ed },
|
||||||
|
{ "dark slate" , 0x483d8b },
|
||||||
|
{ "darkslateblue" , 0x483d8b },
|
||||||
|
{ "slate blue" , 0x6a5acd },
|
||||||
|
{ "slateblue" , 0x6a5acd },
|
||||||
|
{ "medium slate" , 0x7b68ee },
|
||||||
|
{ "mediumslateblue" , 0x7b68ee },
|
||||||
|
{ "light slate" , 0x8470ff },
|
||||||
|
{ "lightslateblue" , 0x8470ff },
|
||||||
|
{ "medium blue" , 0xcd },
|
||||||
|
{ "mediumblue" , 0xcd },
|
||||||
|
{ "royal blue" , 0x4169e1 },
|
||||||
|
{ "royalblue" , 0x4169e1 },
|
||||||
|
{ "blue" , 0xff },
|
||||||
|
{ "dodger blue" , 0x1e90ff },
|
||||||
|
{ "dodgerblue" , 0x1e90ff },
|
||||||
|
{ "deep sky" , 0xbfff },
|
||||||
|
{ "deepskyblue" , 0xbfff },
|
||||||
|
{ "sky blue" , 0x87ceeb },
|
||||||
|
{ "skyblue" , 0x87ceeb },
|
||||||
|
{ "light sky" , 0x87cefa },
|
||||||
|
{ "lightskyblue" , 0x87cefa },
|
||||||
|
{ "steel blue" , 0x4682b4 },
|
||||||
|
{ "steelblue" , 0x4682b4 },
|
||||||
|
{ "light steel" , 0xb0c4de },
|
||||||
|
{ "lightsteelblue" , 0xb0c4de },
|
||||||
|
{ "light blue" , 0xadd8e6 },
|
||||||
|
{ "lightblue" , 0xadd8e6 },
|
||||||
|
{ "powder blue" , 0xb0e0e6 },
|
||||||
|
{ "powderblue" , 0xb0e0e6 },
|
||||||
|
{ "pale turquoise" , 0xafeeee },
|
||||||
|
{ "paleturquoise" , 0xafeeee },
|
||||||
|
{ "dark turquoise" , 0xced1 },
|
||||||
|
{ "darkturquoise" , 0xced1 },
|
||||||
|
{ "medium turquoise" , 0x48d1cc },
|
||||||
|
{ "mediumturquoise" , 0x48d1cc },
|
||||||
|
{ "turquoise" , 0x40e0d0 },
|
||||||
|
{ "cyan" , 0xffff },
|
||||||
|
{ "light cyan" , 0xe0ffff },
|
||||||
|
{ "lightcyan" , 0xe0ffff },
|
||||||
|
{ "cadet blue" , 0x5f9ea0 },
|
||||||
|
{ "cadetblue" , 0x5f9ea0 },
|
||||||
|
{ "medium aquamarine" , 0x66cdaa },
|
||||||
|
{ "mediumaquamarine" , 0x66cdaa },
|
||||||
|
{ "aquamarine" , 0x7fffd4 },
|
||||||
|
{ "dark green" , 0x6400 },
|
||||||
|
{ "darkgreen" , 0x6400 },
|
||||||
|
{ "dark olive" , 0x556b2f },
|
||||||
|
{ "darkolivegreen" , 0x556b2f },
|
||||||
|
{ "dark sea" , 0x8fbc8f },
|
||||||
|
{ "darkseagreen" , 0x8fbc8f },
|
||||||
|
{ "sea green" , 0x2e8b57 },
|
||||||
|
{ "seagreen" , 0x2e8b57 },
|
||||||
|
{ "medium sea" , 0x3cb371 },
|
||||||
|
{ "mediumseagreen" , 0x3cb371 },
|
||||||
|
{ "light sea" , 0x20b2aa },
|
||||||
|
{ "lightseagreen" , 0x20b2aa },
|
||||||
|
{ "pale green" , 0x98fb98 },
|
||||||
|
{ "palegreen" , 0x98fb98 },
|
||||||
|
{ "spring green" , 0xff7f },
|
||||||
|
{ "springgreen" , 0xff7f },
|
||||||
|
{ "lawn green" , 0x7cfc00 },
|
||||||
|
{ "lawngreen" , 0x7cfc00 },
|
||||||
|
{ "green" , 0xff00 },
|
||||||
|
{ "chartreuse" , 0x7fff00 },
|
||||||
|
{ "medium spring" , 0xfa9a },
|
||||||
|
{ "mediumspringgreen" , 0xfa9a },
|
||||||
|
{ "green yellow" , 0xadff2f },
|
||||||
|
{ "greenyellow" , 0xadff2f },
|
||||||
|
{ "lime green" , 0x32cd32 },
|
||||||
|
{ "limegreen" , 0x32cd32 },
|
||||||
|
{ "yellow green" , 0x9acd32 },
|
||||||
|
{ "yellowgreen" , 0x9acd32 },
|
||||||
|
{ "forest green" , 0x228b22 },
|
||||||
|
{ "forestgreen" , 0x228b22 },
|
||||||
|
{ "olive drab" , 0x6b8e23 },
|
||||||
|
{ "olivedrab" , 0x6b8e23 },
|
||||||
|
{ "dark khaki" , 0xbdb76b },
|
||||||
|
{ "darkkhaki" , 0xbdb76b },
|
||||||
|
{ "khaki" , 0xf0e68c },
|
||||||
|
{ "pale goldenrod" , 0xeee8aa },
|
||||||
|
{ "palegoldenrod" , 0xeee8aa },
|
||||||
|
{ "light goldenrod" , 0xfafad2 },
|
||||||
|
{ "lightgoldenrodyellow" , 0xfafad2 },
|
||||||
|
{ "light yellow" , 0xffffe0 },
|
||||||
|
{ "lightyellow" , 0xffffe0 },
|
||||||
|
{ "yellow" , 0xffff00 },
|
||||||
|
{ "gold" , 0xffd700 },
|
||||||
|
{ "light goldenrod" , 0xeedd82 },
|
||||||
|
{ "lightgoldenrod" , 0xeedd82 },
|
||||||
|
{ "goldenrod" , 0xdaa520 },
|
||||||
|
{ "dark goldenrod" , 0xb8860b },
|
||||||
|
{ "darkgoldenrod" , 0xb8860b },
|
||||||
|
{ "rosy brown" , 0xbc8f8f },
|
||||||
|
{ "rosybrown" , 0xbc8f8f },
|
||||||
|
{ "indian red" , 0xcd5c5c },
|
||||||
|
{ "indianred" , 0xcd5c5c },
|
||||||
|
{ "saddle brown" , 0x8b4513 },
|
||||||
|
{ "saddlebrown" , 0x8b4513 },
|
||||||
|
{ "sienna" , 0xa0522d },
|
||||||
|
{ "peru" , 0xcd853f },
|
||||||
|
{ "burlywood" , 0xdeb887 },
|
||||||
|
{ "beige" , 0xf5f5dc },
|
||||||
|
{ "wheat" , 0xf5deb3 },
|
||||||
|
{ "sandy brown" , 0xf4a460 },
|
||||||
|
{ "sandybrown" , 0xf4a460 },
|
||||||
|
{ "tan" , 0xd2b48c },
|
||||||
|
{ "chocolate" , 0xd2691e },
|
||||||
|
{ "firebrick" , 0xb22222 },
|
||||||
|
{ "brown" , 0xa52a2a },
|
||||||
|
{ "dark salmon" , 0xe9967a },
|
||||||
|
{ "darksalmon" , 0xe9967a },
|
||||||
|
{ "salmon" , 0xfa8072 },
|
||||||
|
{ "light salmon" , 0xffa07a },
|
||||||
|
{ "lightsalmon" , 0xffa07a },
|
||||||
|
{ "orange" , 0xffa500 },
|
||||||
|
{ "dark orange" , 0xff8c00 },
|
||||||
|
{ "darkorange" , 0xff8c00 },
|
||||||
|
{ "coral" , 0xff7f50 },
|
||||||
|
{ "light coral" , 0xf08080 },
|
||||||
|
{ "lightcoral" , 0xf08080 },
|
||||||
|
{ "tomato" , 0xff6347 },
|
||||||
|
{ "orange red" , 0xff4500 },
|
||||||
|
{ "orangered" , 0xff4500 },
|
||||||
|
{ "red" , 0xff0000 },
|
||||||
|
{ "hot pink" , 0xff69b4 },
|
||||||
|
{ "hotpink" , 0xff69b4 },
|
||||||
|
{ "deep pink" , 0xff1493 },
|
||||||
|
{ "deeppink" , 0xff1493 },
|
||||||
|
{ "pink" , 0xffc0cb },
|
||||||
|
{ "light pink" , 0xffb6c1 },
|
||||||
|
{ "lightpink" , 0xffb6c1 },
|
||||||
|
{ "pale violet" , 0xdb7093 },
|
||||||
|
{ "palevioletred" , 0xdb7093 },
|
||||||
|
{ "maroon" , 0xb03060 },
|
||||||
|
{ "medium violet" , 0xc71585 },
|
||||||
|
{ "mediumvioletred" , 0xc71585 },
|
||||||
|
{ "violet red" , 0xd02090 },
|
||||||
|
{ "violetred" , 0xd02090 },
|
||||||
|
{ "magenta" , 0xff00ff },
|
||||||
|
{ "violet" , 0xee82ee },
|
||||||
|
{ "plum" , 0xdda0dd },
|
||||||
|
{ "orchid" , 0xda70d6 },
|
||||||
|
{ "medium orchid" , 0xba55d3 },
|
||||||
|
{ "mediumorchid" , 0xba55d3 },
|
||||||
|
{ "dark orchid" , 0x9932cc },
|
||||||
|
{ "darkorchid" , 0x9932cc },
|
||||||
|
{ "dark violet" , 0x9400d3 },
|
||||||
|
{ "darkviolet" , 0x9400d3 },
|
||||||
|
{ "blue violet" , 0x8a2be2 },
|
||||||
|
{ "blueviolet" , 0x8a2be2 },
|
||||||
|
{ "purple" , 0xa020f0 },
|
||||||
|
{ "medium purple" , 0x9370db },
|
||||||
|
{ "mediumpurple" , 0x9370db },
|
||||||
|
{ "thistle" , 0xd8bfd8 },
|
||||||
|
{ "snow1" , 0xfffafa },
|
||||||
|
{ "snow2" , 0xeee9e9 },
|
||||||
|
{ "snow3" , 0xcdc9c9 },
|
||||||
|
{ "snow4" , 0x8b8989 },
|
||||||
|
{ "seashell1" , 0xfff5ee },
|
||||||
|
{ "seashell2" , 0xeee5de },
|
||||||
|
{ "seashell3" , 0xcdc5bf },
|
||||||
|
{ "seashell4" , 0x8b8682 },
|
||||||
|
{ "antiquewhite1" , 0xffefdb },
|
||||||
|
{ "antiquewhite2" , 0xeedfcc },
|
||||||
|
{ "antiquewhite3" , 0xcdc0b0 },
|
||||||
|
{ "antiquewhite4" , 0x8b8378 },
|
||||||
|
{ "bisque1" , 0xffe4c4 },
|
||||||
|
{ "bisque2" , 0xeed5b7 },
|
||||||
|
{ "bisque3" , 0xcdb79e },
|
||||||
|
{ "bisque4" , 0x8b7d6b },
|
||||||
|
{ "peachpuff1" , 0xffdab9 },
|
||||||
|
{ "peachpuff2" , 0xeecbad },
|
||||||
|
{ "peachpuff3" , 0xcdaf95 },
|
||||||
|
{ "peachpuff4" , 0x8b7765 },
|
||||||
|
{ "navajowhite1" , 0xffdead },
|
||||||
|
{ "navajowhite2" , 0xeecfa1 },
|
||||||
|
{ "navajowhite3" , 0xcdb38b },
|
||||||
|
{ "navajowhite4" , 0x8b795e },
|
||||||
|
{ "lemonchiffon1" , 0xfffacd },
|
||||||
|
{ "lemonchiffon2" , 0xeee9bf },
|
||||||
|
{ "lemonchiffon3" , 0xcdc9a5 },
|
||||||
|
{ "lemonchiffon4" , 0x8b8970 },
|
||||||
|
{ "cornsilk1" , 0xfff8dc },
|
||||||
|
{ "cornsilk2" , 0xeee8cd },
|
||||||
|
{ "cornsilk3" , 0xcdc8b1 },
|
||||||
|
{ "cornsilk4" , 0x8b8878 },
|
||||||
|
{ "ivory1" , 0xfffff0 },
|
||||||
|
{ "ivory2" , 0xeeeee0 },
|
||||||
|
{ "ivory3" , 0xcdcdc1 },
|
||||||
|
{ "ivory4" , 0x8b8b83 },
|
||||||
|
{ "honeydew1" , 0xf0fff0 },
|
||||||
|
{ "honeydew2" , 0xe0eee0 },
|
||||||
|
{ "honeydew3" , 0xc1cdc1 },
|
||||||
|
{ "honeydew4" , 0x838b83 },
|
||||||
|
{ "lavenderblush1" , 0xfff0f5 },
|
||||||
|
{ "lavenderblush2" , 0xeee0e5 },
|
||||||
|
{ "lavenderblush3" , 0xcdc1c5 },
|
||||||
|
{ "lavenderblush4" , 0x8b8386 },
|
||||||
|
{ "mistyrose1" , 0xffe4e1 },
|
||||||
|
{ "mistyrose2" , 0xeed5d2 },
|
||||||
|
{ "mistyrose3" , 0xcdb7b5 },
|
||||||
|
{ "mistyrose4" , 0x8b7d7b },
|
||||||
|
{ "azure1" , 0xf0ffff },
|
||||||
|
{ "azure2" , 0xe0eeee },
|
||||||
|
{ "azure3" , 0xc1cdcd },
|
||||||
|
{ "azure4" , 0x838b8b },
|
||||||
|
{ "slateblue1" , 0x836fff },
|
||||||
|
{ "slateblue2" , 0x7a67ee },
|
||||||
|
{ "slateblue3" , 0x6959cd },
|
||||||
|
{ "slateblue4" , 0x473c8b },
|
||||||
|
{ "royalblue1" , 0x4876ff },
|
||||||
|
{ "royalblue2" , 0x436eee },
|
||||||
|
{ "royalblue3" , 0x3a5fcd },
|
||||||
|
{ "royalblue4" , 0x27408b },
|
||||||
|
{ "blue1" , 0xff },
|
||||||
|
{ "blue2" , 0xee },
|
||||||
|
{ "blue3" , 0xcd },
|
||||||
|
{ "blue4" , 0x8b },
|
||||||
|
{ "dodgerblue1" , 0x1e90ff },
|
||||||
|
{ "dodgerblue2" , 0x1c86ee },
|
||||||
|
{ "dodgerblue3" , 0x1874cd },
|
||||||
|
{ "dodgerblue4" , 0x104e8b },
|
||||||
|
{ "steelblue1" , 0x63b8ff },
|
||||||
|
{ "steelblue2" , 0x5cacee },
|
||||||
|
{ "steelblue3" , 0x4f94cd },
|
||||||
|
{ "steelblue4" , 0x36648b },
|
||||||
|
{ "deepskyblue1" , 0xbfff },
|
||||||
|
{ "deepskyblue2" , 0xb2ee },
|
||||||
|
{ "deepskyblue3" , 0x9acd },
|
||||||
|
{ "deepskyblue4" , 0x688b },
|
||||||
|
{ "skyblue1" , 0x87ceff },
|
||||||
|
{ "skyblue2" , 0x7ec0ee },
|
||||||
|
{ "skyblue3" , 0x6ca6cd },
|
||||||
|
{ "skyblue4" , 0x4a708b },
|
||||||
|
{ "lightskyblue1" , 0xb0e2ff },
|
||||||
|
{ "lightskyblue2" , 0xa4d3ee },
|
||||||
|
{ "lightskyblue3" , 0x8db6cd },
|
||||||
|
{ "lightskyblue4" , 0x607b8b },
|
||||||
|
{ "slategray1" , 0xc6e2ff },
|
||||||
|
{ "slategray2" , 0xb9d3ee },
|
||||||
|
{ "slategray3" , 0x9fb6cd },
|
||||||
|
{ "slategray4" , 0x6c7b8b },
|
||||||
|
{ "lightsteelblue1" , 0xcae1ff },
|
||||||
|
{ "lightsteelblue2" , 0xbcd2ee },
|
||||||
|
{ "lightsteelblue3" , 0xa2b5cd },
|
||||||
|
{ "lightsteelblue4" , 0x6e7b8b },
|
||||||
|
{ "lightblue1" , 0xbfefff },
|
||||||
|
{ "lightblue2" , 0xb2dfee },
|
||||||
|
{ "lightblue3" , 0x9ac0cd },
|
||||||
|
{ "lightblue4" , 0x68838b },
|
||||||
|
{ "lightcyan1" , 0xe0ffff },
|
||||||
|
{ "lightcyan2" , 0xd1eeee },
|
||||||
|
{ "lightcyan3" , 0xb4cdcd },
|
||||||
|
{ "lightcyan4" , 0x7a8b8b },
|
||||||
|
{ "paleturquoise1" , 0xbbffff },
|
||||||
|
{ "paleturquoise2" , 0xaeeeee },
|
||||||
|
{ "paleturquoise3" , 0x96cdcd },
|
||||||
|
{ "paleturquoise4" , 0x668b8b },
|
||||||
|
{ "cadetblue1" , 0x98f5ff },
|
||||||
|
{ "cadetblue2" , 0x8ee5ee },
|
||||||
|
{ "cadetblue3" , 0x7ac5cd },
|
||||||
|
{ "cadetblue4" , 0x53868b },
|
||||||
|
{ "turquoise1" , 0xf5ff },
|
||||||
|
{ "turquoise2" , 0xe5ee },
|
||||||
|
{ "turquoise3" , 0xc5cd },
|
||||||
|
{ "turquoise4" , 0x868b },
|
||||||
|
{ "cyan1" , 0xffff },
|
||||||
|
{ "cyan2" , 0xeeee },
|
||||||
|
{ "cyan3" , 0xcdcd },
|
||||||
|
{ "cyan4" , 0x8b8b },
|
||||||
|
{ "darkslategray1" , 0x97ffff },
|
||||||
|
{ "darkslategray2" , 0x8deeee },
|
||||||
|
{ "darkslategray3" , 0x79cdcd },
|
||||||
|
{ "darkslategray4" , 0x528b8b },
|
||||||
|
{ "aquamarine1" , 0x7fffd4 },
|
||||||
|
{ "aquamarine2" , 0x76eec6 },
|
||||||
|
{ "aquamarine3" , 0x66cdaa },
|
||||||
|
{ "aquamarine4" , 0x458b74 },
|
||||||
|
{ "darkseagreen1" , 0xc1ffc1 },
|
||||||
|
{ "darkseagreen2" , 0xb4eeb4 },
|
||||||
|
{ "darkseagreen3" , 0x9bcd9b },
|
||||||
|
{ "darkseagreen4" , 0x698b69 },
|
||||||
|
{ "seagreen1" , 0x54ff9f },
|
||||||
|
{ "seagreen2" , 0x4eee94 },
|
||||||
|
{ "seagreen3" , 0x43cd80 },
|
||||||
|
{ "seagreen4" , 0x2e8b57 },
|
||||||
|
{ "palegreen1" , 0x9aff9a },
|
||||||
|
{ "palegreen2" , 0x90ee90 },
|
||||||
|
{ "palegreen3" , 0x7ccd7c },
|
||||||
|
{ "palegreen4" , 0x548b54 },
|
||||||
|
{ "springgreen1" , 0xff7f },
|
||||||
|
{ "springgreen2" , 0xee76 },
|
||||||
|
{ "springgreen3" , 0xcd66 },
|
||||||
|
{ "springgreen4" , 0x8b45 },
|
||||||
|
{ "green1" , 0xff00 },
|
||||||
|
{ "green2" , 0xee00 },
|
||||||
|
{ "green3" , 0xcd00 },
|
||||||
|
{ "green4" , 0x8b00 },
|
||||||
|
{ "chartreuse1" , 0x7fff00 },
|
||||||
|
{ "chartreuse2" , 0x76ee00 },
|
||||||
|
{ "chartreuse3" , 0x66cd00 },
|
||||||
|
{ "chartreuse4" , 0x458b00 },
|
||||||
|
{ "olivedrab1" , 0xc0ff3e },
|
||||||
|
{ "olivedrab2" , 0xb3ee3a },
|
||||||
|
{ "olivedrab3" , 0x9acd32 },
|
||||||
|
{ "olivedrab4" , 0x698b22 },
|
||||||
|
{ "darkolivegreen1" , 0xcaff70 },
|
||||||
|
{ "darkolivegreen2" , 0xbcee68 },
|
||||||
|
{ "darkolivegreen3" , 0xa2cd5a },
|
||||||
|
{ "darkolivegreen4" , 0x6e8b3d },
|
||||||
|
{ "khaki1" , 0xfff68f },
|
||||||
|
{ "khaki2" , 0xeee685 },
|
||||||
|
{ "khaki3" , 0xcdc673 },
|
||||||
|
{ "khaki4" , 0x8b864e },
|
||||||
|
{ "lightgoldenrod1" , 0xffec8b },
|
||||||
|
{ "lightgoldenrod2" , 0xeedc82 },
|
||||||
|
{ "lightgoldenrod3" , 0xcdbe70 },
|
||||||
|
{ "lightgoldenrod4" , 0x8b814c },
|
||||||
|
{ "lightyellow1" , 0xffffe0 },
|
||||||
|
{ "lightyellow2" , 0xeeeed1 },
|
||||||
|
{ "lightyellow3" , 0xcdcdb4 },
|
||||||
|
{ "lightyellow4" , 0x8b8b7a },
|
||||||
|
{ "yellow1" , 0xffff00 },
|
||||||
|
{ "yellow2" , 0xeeee00 },
|
||||||
|
{ "yellow3" , 0xcdcd00 },
|
||||||
|
{ "yellow4" , 0x8b8b00 },
|
||||||
|
{ "gold1" , 0xffd700 },
|
||||||
|
{ "gold2" , 0xeec900 },
|
||||||
|
{ "gold3" , 0xcdad00 },
|
||||||
|
{ "gold4" , 0x8b7500 },
|
||||||
|
{ "goldenrod1" , 0xffc125 },
|
||||||
|
{ "goldenrod2" , 0xeeb422 },
|
||||||
|
{ "goldenrod3" , 0xcd9b1d },
|
||||||
|
{ "goldenrod4" , 0x8b6914 },
|
||||||
|
{ "darkgoldenrod1" , 0xffb90f },
|
||||||
|
{ "darkgoldenrod2" , 0xeead0e },
|
||||||
|
{ "darkgoldenrod3" , 0xcd950c },
|
||||||
|
{ "darkgoldenrod4" , 0x8b6508 },
|
||||||
|
{ "rosybrown1" , 0xffc1c1 },
|
||||||
|
{ "rosybrown2" , 0xeeb4b4 },
|
||||||
|
{ "rosybrown3" , 0xcd9b9b },
|
||||||
|
{ "rosybrown4" , 0x8b6969 },
|
||||||
|
{ "indianred1" , 0xff6a6a },
|
||||||
|
{ "indianred2" , 0xee6363 },
|
||||||
|
{ "indianred3" , 0xcd5555 },
|
||||||
|
{ "indianred4" , 0x8b3a3a },
|
||||||
|
{ "sienna1" , 0xff8247 },
|
||||||
|
{ "sienna2" , 0xee7942 },
|
||||||
|
{ "sienna3" , 0xcd6839 },
|
||||||
|
{ "sienna4" , 0x8b4726 },
|
||||||
|
{ "burlywood1" , 0xffd39b },
|
||||||
|
{ "burlywood2" , 0xeec591 },
|
||||||
|
{ "burlywood3" , 0xcdaa7d },
|
||||||
|
{ "burlywood4" , 0x8b7355 },
|
||||||
|
{ "wheat1" , 0xffe7ba },
|
||||||
|
{ "wheat2" , 0xeed8ae },
|
||||||
|
{ "wheat3" , 0xcdba96 },
|
||||||
|
{ "wheat4" , 0x8b7e66 },
|
||||||
|
{ "tan1" , 0xffa54f },
|
||||||
|
{ "tan2" , 0xee9a49 },
|
||||||
|
{ "tan3" , 0xcd853f },
|
||||||
|
{ "tan4" , 0x8b5a2b },
|
||||||
|
{ "chocolate1" , 0xff7f24 },
|
||||||
|
{ "chocolate2" , 0xee7621 },
|
||||||
|
{ "chocolate3" , 0xcd661d },
|
||||||
|
{ "chocolate4" , 0x8b4513 },
|
||||||
|
{ "firebrick1" , 0xff3030 },
|
||||||
|
{ "firebrick2" , 0xee2c2c },
|
||||||
|
{ "firebrick3" , 0xcd2626 },
|
||||||
|
{ "firebrick4" , 0x8b1a1a },
|
||||||
|
{ "brown1" , 0xff4040 },
|
||||||
|
{ "brown2" , 0xee3b3b },
|
||||||
|
{ "brown3" , 0xcd3333 },
|
||||||
|
{ "brown4" , 0x8b2323 },
|
||||||
|
{ "salmon1" , 0xff8c69 },
|
||||||
|
{ "salmon2" , 0xee8262 },
|
||||||
|
{ "salmon3" , 0xcd7054 },
|
||||||
|
{ "salmon4" , 0x8b4c39 },
|
||||||
|
{ "lightsalmon1" , 0xffa07a },
|
||||||
|
{ "lightsalmon2" , 0xee9572 },
|
||||||
|
{ "lightsalmon3" , 0xcd8162 },
|
||||||
|
{ "lightsalmon4" , 0x8b5742 },
|
||||||
|
{ "orange1" , 0xffa500 },
|
||||||
|
{ "orange2" , 0xee9a00 },
|
||||||
|
{ "orange3" , 0xcd8500 },
|
||||||
|
{ "orange4" , 0x8b5a00 },
|
||||||
|
{ "darkorange1" , 0xff7f00 },
|
||||||
|
{ "darkorange2" , 0xee7600 },
|
||||||
|
{ "darkorange3" , 0xcd6600 },
|
||||||
|
{ "darkorange4" , 0x8b4500 },
|
||||||
|
{ "coral1" , 0xff7256 },
|
||||||
|
{ "coral2" , 0xee6a50 },
|
||||||
|
{ "coral3" , 0xcd5b45 },
|
||||||
|
{ "coral4" , 0x8b3e2f },
|
||||||
|
{ "tomato1" , 0xff6347 },
|
||||||
|
{ "tomato2" , 0xee5c42 },
|
||||||
|
{ "tomato3" , 0xcd4f39 },
|
||||||
|
{ "tomato4" , 0x8b3626 },
|
||||||
|
{ "orangered1" , 0xff4500 },
|
||||||
|
{ "orangered2" , 0xee4000 },
|
||||||
|
{ "orangered3" , 0xcd3700 },
|
||||||
|
{ "orangered4" , 0x8b2500 },
|
||||||
|
{ "red1" , 0xff0000 },
|
||||||
|
{ "red2" , 0xee0000 },
|
||||||
|
{ "red3" , 0xcd0000 },
|
||||||
|
{ "red4" , 0x8b0000 },
|
||||||
|
{ "deeppink1" , 0xff1493 },
|
||||||
|
{ "deeppink2" , 0xee1289 },
|
||||||
|
{ "deeppink3" , 0xcd1076 },
|
||||||
|
{ "deeppink4" , 0x8b0a50 },
|
||||||
|
{ "hotpink1" , 0xff6eb4 },
|
||||||
|
{ "hotpink2" , 0xee6aa7 },
|
||||||
|
{ "hotpink3" , 0xcd6090 },
|
||||||
|
{ "hotpink4" , 0x8b3a62 },
|
||||||
|
{ "pink1" , 0xffb5c5 },
|
||||||
|
{ "pink2" , 0xeea9b8 },
|
||||||
|
{ "pink3" , 0xcd919e },
|
||||||
|
{ "pink4" , 0x8b636c },
|
||||||
|
{ "lightpink1" , 0xffaeb9 },
|
||||||
|
{ "lightpink2" , 0xeea2ad },
|
||||||
|
{ "lightpink3" , 0xcd8c95 },
|
||||||
|
{ "lightpink4" , 0x8b5f65 },
|
||||||
|
{ "palevioletred1" , 0xff82ab },
|
||||||
|
{ "palevioletred2" , 0xee799f },
|
||||||
|
{ "palevioletred3" , 0xcd6889 },
|
||||||
|
{ "palevioletred4" , 0x8b475d },
|
||||||
|
{ "maroon1" , 0xff34b3 },
|
||||||
|
{ "maroon2" , 0xee30a7 },
|
||||||
|
{ "maroon3" , 0xcd2990 },
|
||||||
|
{ "maroon4" , 0x8b1c62 },
|
||||||
|
{ "violetred1" , 0xff3e96 },
|
||||||
|
{ "violetred2" , 0xee3a8c },
|
||||||
|
{ "violetred3" , 0xcd3278 },
|
||||||
|
{ "violetred4" , 0x8b2252 },
|
||||||
|
{ "magenta1" , 0xff00ff },
|
||||||
|
{ "magenta2" , 0xee00ee },
|
||||||
|
{ "magenta3" , 0xcd00cd },
|
||||||
|
{ "magenta4" , 0x8b008b },
|
||||||
|
{ "orchid1" , 0xff83fa },
|
||||||
|
{ "orchid2" , 0xee7ae9 },
|
||||||
|
{ "orchid3" , 0xcd69c9 },
|
||||||
|
{ "orchid4" , 0x8b4789 },
|
||||||
|
{ "plum1" , 0xffbbff },
|
||||||
|
{ "plum2" , 0xeeaeee },
|
||||||
|
{ "plum3" , 0xcd96cd },
|
||||||
|
{ "plum4" , 0x8b668b },
|
||||||
|
{ "mediumorchid1" , 0xe066ff },
|
||||||
|
{ "mediumorchid2" , 0xd15fee },
|
||||||
|
{ "mediumorchid3" , 0xb452cd },
|
||||||
|
{ "mediumorchid4" , 0x7a378b },
|
||||||
|
{ "darkorchid1" , 0xbf3eff },
|
||||||
|
{ "darkorchid2" , 0xb23aee },
|
||||||
|
{ "darkorchid3" , 0x9a32cd },
|
||||||
|
{ "darkorchid4" , 0x68228b },
|
||||||
|
{ "purple1" , 0x9b30ff },
|
||||||
|
{ "purple2" , 0x912cee },
|
||||||
|
{ "purple3" , 0x7d26cd },
|
||||||
|
{ "purple4" , 0x551a8b },
|
||||||
|
{ "mediumpurple1" , 0xab82ff },
|
||||||
|
{ "mediumpurple2" , 0x9f79ee },
|
||||||
|
{ "mediumpurple3" , 0x8968cd },
|
||||||
|
{ "mediumpurple4" , 0x5d478b },
|
||||||
|
{ "thistle1" , 0xffe1ff },
|
||||||
|
{ "thistle2" , 0xeed2ee },
|
||||||
|
{ "thistle3" , 0xcdb5cd },
|
||||||
|
{ "thistle4" , 0x8b7b8b },
|
||||||
|
{ "gray0" , 0x0 },
|
||||||
|
{ "grey0" , 0x0 },
|
||||||
|
{ "gray1" , 0x30303 },
|
||||||
|
{ "grey1" , 0x30303 },
|
||||||
|
{ "gray2" , 0x50505 },
|
||||||
|
{ "grey2" , 0x50505 },
|
||||||
|
{ "gray3" , 0x80808 },
|
||||||
|
{ "grey3" , 0x80808 },
|
||||||
|
{ "gray4" , 0xa0a0a },
|
||||||
|
{ "grey4" , 0xa0a0a },
|
||||||
|
{ "gray5" , 0xd0d0d },
|
||||||
|
{ "grey5" , 0xd0d0d },
|
||||||
|
{ "gray6" , 0xf0f0f },
|
||||||
|
{ "grey6" , 0xf0f0f },
|
||||||
|
{ "gray7" , 0x121212 },
|
||||||
|
{ "grey7" , 0x121212 },
|
||||||
|
{ "gray8" , 0x141414 },
|
||||||
|
{ "grey8" , 0x141414 },
|
||||||
|
{ "gray9" , 0x171717 },
|
||||||
|
{ "grey9" , 0x171717 },
|
||||||
|
{ "gray10" , 0x1a1a1a },
|
||||||
|
{ "grey10" , 0x1a1a1a },
|
||||||
|
{ "gray11" , 0x1c1c1c },
|
||||||
|
{ "grey11" , 0x1c1c1c },
|
||||||
|
{ "gray12" , 0x1f1f1f },
|
||||||
|
{ "grey12" , 0x1f1f1f },
|
||||||
|
{ "gray13" , 0x212121 },
|
||||||
|
{ "grey13" , 0x212121 },
|
||||||
|
{ "gray14" , 0x242424 },
|
||||||
|
{ "grey14" , 0x242424 },
|
||||||
|
{ "gray15" , 0x262626 },
|
||||||
|
{ "grey15" , 0x262626 },
|
||||||
|
{ "gray16" , 0x292929 },
|
||||||
|
{ "grey16" , 0x292929 },
|
||||||
|
{ "gray17" , 0x2b2b2b },
|
||||||
|
{ "grey17" , 0x2b2b2b },
|
||||||
|
{ "gray18" , 0x2e2e2e },
|
||||||
|
{ "grey18" , 0x2e2e2e },
|
||||||
|
{ "gray19" , 0x303030 },
|
||||||
|
{ "grey19" , 0x303030 },
|
||||||
|
{ "gray20" , 0x333333 },
|
||||||
|
{ "grey20" , 0x333333 },
|
||||||
|
{ "gray21" , 0x363636 },
|
||||||
|
{ "grey21" , 0x363636 },
|
||||||
|
{ "gray22" , 0x383838 },
|
||||||
|
{ "grey22" , 0x383838 },
|
||||||
|
{ "gray23" , 0x3b3b3b },
|
||||||
|
{ "grey23" , 0x3b3b3b },
|
||||||
|
{ "gray24" , 0x3d3d3d },
|
||||||
|
{ "grey24" , 0x3d3d3d },
|
||||||
|
{ "gray25" , 0x404040 },
|
||||||
|
{ "grey25" , 0x404040 },
|
||||||
|
{ "gray26" , 0x424242 },
|
||||||
|
{ "grey26" , 0x424242 },
|
||||||
|
{ "gray27" , 0x454545 },
|
||||||
|
{ "grey27" , 0x454545 },
|
||||||
|
{ "gray28" , 0x474747 },
|
||||||
|
{ "grey28" , 0x474747 },
|
||||||
|
{ "gray29" , 0x4a4a4a },
|
||||||
|
{ "grey29" , 0x4a4a4a },
|
||||||
|
{ "gray30" , 0x4d4d4d },
|
||||||
|
{ "grey30" , 0x4d4d4d },
|
||||||
|
{ "gray31" , 0x4f4f4f },
|
||||||
|
{ "grey31" , 0x4f4f4f },
|
||||||
|
{ "gray32" , 0x525252 },
|
||||||
|
{ "grey32" , 0x525252 },
|
||||||
|
{ "gray33" , 0x545454 },
|
||||||
|
{ "grey33" , 0x545454 },
|
||||||
|
{ "gray34" , 0x575757 },
|
||||||
|
{ "grey34" , 0x575757 },
|
||||||
|
{ "gray35" , 0x595959 },
|
||||||
|
{ "grey35" , 0x595959 },
|
||||||
|
{ "gray36" , 0x5c5c5c },
|
||||||
|
{ "grey36" , 0x5c5c5c },
|
||||||
|
{ "gray37" , 0x5e5e5e },
|
||||||
|
{ "grey37" , 0x5e5e5e },
|
||||||
|
{ "gray38" , 0x616161 },
|
||||||
|
{ "grey38" , 0x616161 },
|
||||||
|
{ "gray39" , 0x636363 },
|
||||||
|
{ "grey39" , 0x636363 },
|
||||||
|
{ "gray40" , 0x666666 },
|
||||||
|
{ "grey40" , 0x666666 },
|
||||||
|
{ "gray41" , 0x696969 },
|
||||||
|
{ "grey41" , 0x696969 },
|
||||||
|
{ "gray42" , 0x6b6b6b },
|
||||||
|
{ "grey42" , 0x6b6b6b },
|
||||||
|
{ "gray43" , 0x6e6e6e },
|
||||||
|
{ "grey43" , 0x6e6e6e },
|
||||||
|
{ "gray44" , 0x707070 },
|
||||||
|
{ "grey44" , 0x707070 },
|
||||||
|
{ "gray45" , 0x737373 },
|
||||||
|
{ "grey45" , 0x737373 },
|
||||||
|
{ "gray46" , 0x757575 },
|
||||||
|
{ "grey46" , 0x757575 },
|
||||||
|
{ "gray47" , 0x787878 },
|
||||||
|
{ "grey47" , 0x787878 },
|
||||||
|
{ "gray48" , 0x7a7a7a },
|
||||||
|
{ "grey48" , 0x7a7a7a },
|
||||||
|
{ "gray49" , 0x7d7d7d },
|
||||||
|
{ "grey49" , 0x7d7d7d },
|
||||||
|
{ "gray50" , 0x7f7f7f },
|
||||||
|
{ "grey50" , 0x7f7f7f },
|
||||||
|
{ "gray51" , 0x828282 },
|
||||||
|
{ "grey51" , 0x828282 },
|
||||||
|
{ "gray52" , 0x858585 },
|
||||||
|
{ "grey52" , 0x858585 },
|
||||||
|
{ "gray53" , 0x878787 },
|
||||||
|
{ "grey53" , 0x878787 },
|
||||||
|
{ "gray54" , 0x8a8a8a },
|
||||||
|
{ "grey54" , 0x8a8a8a },
|
||||||
|
{ "gray55" , 0x8c8c8c },
|
||||||
|
{ "grey55" , 0x8c8c8c },
|
||||||
|
{ "gray56" , 0x8f8f8f },
|
||||||
|
{ "grey56" , 0x8f8f8f },
|
||||||
|
{ "gray57" , 0x919191 },
|
||||||
|
{ "grey57" , 0x919191 },
|
||||||
|
{ "gray58" , 0x949494 },
|
||||||
|
{ "grey58" , 0x949494 },
|
||||||
|
{ "gray59" , 0x969696 },
|
||||||
|
{ "grey59" , 0x969696 },
|
||||||
|
{ "gray60" , 0x999999 },
|
||||||
|
{ "grey60" , 0x999999 },
|
||||||
|
{ "gray61" , 0x9c9c9c },
|
||||||
|
{ "grey61" , 0x9c9c9c },
|
||||||
|
{ "gray62" , 0x9e9e9e },
|
||||||
|
{ "grey62" , 0x9e9e9e },
|
||||||
|
{ "gray63" , 0xa1a1a1 },
|
||||||
|
{ "grey63" , 0xa1a1a1 },
|
||||||
|
{ "gray64" , 0xa3a3a3 },
|
||||||
|
{ "grey64" , 0xa3a3a3 },
|
||||||
|
{ "gray65" , 0xa6a6a6 },
|
||||||
|
{ "grey65" , 0xa6a6a6 },
|
||||||
|
{ "gray66" , 0xa8a8a8 },
|
||||||
|
{ "grey66" , 0xa8a8a8 },
|
||||||
|
{ "gray67" , 0xababab },
|
||||||
|
{ "grey67" , 0xababab },
|
||||||
|
{ "gray68" , 0xadadad },
|
||||||
|
{ "grey68" , 0xadadad },
|
||||||
|
{ "gray69" , 0xb0b0b0 },
|
||||||
|
{ "grey69" , 0xb0b0b0 },
|
||||||
|
{ "gray70" , 0xb3b3b3 },
|
||||||
|
{ "grey70" , 0xb3b3b3 },
|
||||||
|
{ "gray71" , 0xb5b5b5 },
|
||||||
|
{ "grey71" , 0xb5b5b5 },
|
||||||
|
{ "gray72" , 0xb8b8b8 },
|
||||||
|
{ "grey72" , 0xb8b8b8 },
|
||||||
|
{ "gray73" , 0xbababa },
|
||||||
|
{ "grey73" , 0xbababa },
|
||||||
|
{ "gray74" , 0xbdbdbd },
|
||||||
|
{ "grey74" , 0xbdbdbd },
|
||||||
|
{ "gray75" , 0xbfbfbf },
|
||||||
|
{ "grey75" , 0xbfbfbf },
|
||||||
|
{ "gray76" , 0xc2c2c2 },
|
||||||
|
{ "grey76" , 0xc2c2c2 },
|
||||||
|
{ "gray77" , 0xc4c4c4 },
|
||||||
|
{ "grey77" , 0xc4c4c4 },
|
||||||
|
{ "gray78" , 0xc7c7c7 },
|
||||||
|
{ "grey78" , 0xc7c7c7 },
|
||||||
|
{ "gray79" , 0xc9c9c9 },
|
||||||
|
{ "grey79" , 0xc9c9c9 },
|
||||||
|
{ "gray80" , 0xcccccc },
|
||||||
|
{ "grey80" , 0xcccccc },
|
||||||
|
{ "gray81" , 0xcfcfcf },
|
||||||
|
{ "grey81" , 0xcfcfcf },
|
||||||
|
{ "gray82" , 0xd1d1d1 },
|
||||||
|
{ "grey82" , 0xd1d1d1 },
|
||||||
|
{ "gray83" , 0xd4d4d4 },
|
||||||
|
{ "grey83" , 0xd4d4d4 },
|
||||||
|
{ "gray84" , 0xd6d6d6 },
|
||||||
|
{ "grey84" , 0xd6d6d6 },
|
||||||
|
{ "gray85" , 0xd9d9d9 },
|
||||||
|
{ "grey85" , 0xd9d9d9 },
|
||||||
|
{ "gray86" , 0xdbdbdb },
|
||||||
|
{ "grey86" , 0xdbdbdb },
|
||||||
|
{ "gray87" , 0xdedede },
|
||||||
|
{ "grey87" , 0xdedede },
|
||||||
|
{ "gray88" , 0xe0e0e0 },
|
||||||
|
{ "grey88" , 0xe0e0e0 },
|
||||||
|
{ "gray89" , 0xe3e3e3 },
|
||||||
|
{ "grey89" , 0xe3e3e3 },
|
||||||
|
{ "gray90" , 0xe5e5e5 },
|
||||||
|
{ "grey90" , 0xe5e5e5 },
|
||||||
|
{ "gray91" , 0xe8e8e8 },
|
||||||
|
{ "grey91" , 0xe8e8e8 },
|
||||||
|
{ "gray92" , 0xebebeb },
|
||||||
|
{ "grey92" , 0xebebeb },
|
||||||
|
{ "gray93" , 0xededed },
|
||||||
|
{ "grey93" , 0xededed },
|
||||||
|
{ "gray94" , 0xf0f0f0 },
|
||||||
|
{ "grey94" , 0xf0f0f0 },
|
||||||
|
{ "gray95" , 0xf2f2f2 },
|
||||||
|
{ "grey95" , 0xf2f2f2 },
|
||||||
|
{ "gray96" , 0xf5f5f5 },
|
||||||
|
{ "grey96" , 0xf5f5f5 },
|
||||||
|
{ "gray97" , 0xf7f7f7 },
|
||||||
|
{ "grey97" , 0xf7f7f7 },
|
||||||
|
{ "gray98" , 0xfafafa },
|
||||||
|
{ "grey98" , 0xfafafa },
|
||||||
|
{ "gray99" , 0xfcfcfc },
|
||||||
|
{ "grey99" , 0xfcfcfc },
|
||||||
|
{ "gray100" , 0xffffff },
|
||||||
|
{ "grey100" , 0xffffff },
|
||||||
|
{ "dark grey" , 0xa9a9a9 },
|
||||||
|
{ "darkgrey" , 0xa9a9a9 },
|
||||||
|
{ "dark gray" , 0xa9a9a9 },
|
||||||
|
{ "darkgray" , 0xa9a9a9 },
|
||||||
|
{ "dark blue" , 0x8b },
|
||||||
|
{ "darkblue" , 0x8b },
|
||||||
|
{ "dark cyan" , 0x8b8b },
|
||||||
|
{ "darkcyan" , 0x8b8b },
|
||||||
|
{ "dark magenta" , 0x8b008b },
|
||||||
|
{ "darkmagenta" , 0x8b008b },
|
||||||
|
{ "dark red" , 0x8b0000 },
|
||||||
|
{ "darkred" , 0x8b0000 },
|
||||||
|
{ "light green" , 0x90ee90 },
|
||||||
|
{ "lightgreen" , 0x90ee90 },
|
||||||
|
{ "none", -1 },
|
||||||
|
{ 0, 0 }
|
||||||
|
};
|
||||||
13
minilibx/mlx_screen_size.c
Executable file
13
minilibx/mlx_screen_size.c
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
int mlx_get_screen_size(void *mlx_ptr, int *sizex, int *sizey)
|
||||||
|
{
|
||||||
|
XWindowAttributes xwAttr;
|
||||||
|
Status ret;
|
||||||
|
t_xvar *xvar;
|
||||||
|
|
||||||
|
xvar = mlx_ptr;
|
||||||
|
ret = XGetWindowAttributes(xvar->display, xvar->root, &xwAttr);
|
||||||
|
(*sizex) = xwAttr.width;
|
||||||
|
(*sizey) = xwAttr.height;
|
||||||
|
}
|
||||||
30
minilibx/mlx_set_font.c
Executable file
30
minilibx/mlx_set_font.c
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* mlx_set_font.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: amalliar <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2020/09/30 13:30:47 by amalliar #+# #+# */
|
||||||
|
/* Updated: 2020/09/30 17:08:36 by amalliar ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Allows to specify the font that will be used by mlx_string_put.
|
||||||
|
**
|
||||||
|
** Note: only fixed-width bitmap fonts are supported by Xlib, refer to xfontsel
|
||||||
|
** utility to get valid font names for this function.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void mlx_set_font(t_xvar *xvar, t_win_list *win, char *name)
|
||||||
|
{
|
||||||
|
static Font font = 0;
|
||||||
|
|
||||||
|
if (font)
|
||||||
|
XUnloadFont(xvar->display, font);
|
||||||
|
font = XLoadFont(xvar->display, name);
|
||||||
|
XSetFont(xvar->display, win->gc, font);
|
||||||
|
}
|
||||||
26
minilibx/mlx_string_put.c
Executable file
26
minilibx/mlx_string_put.c
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
** mlx_string_put.c for MiniLibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Mon Jul 31 19:01:33 2000 Charlie Root
|
||||||
|
** Last update Tue Sep 25 17:11:47 2001 Charlie Root
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_string_put(t_xvar *xvar,t_win_list *win,
|
||||||
|
int x,int y,int color,char *string)
|
||||||
|
{
|
||||||
|
XGCValues xgcv;
|
||||||
|
|
||||||
|
xgcv.foreground = mlx_int_get_good_color(xvar,color);
|
||||||
|
XChangeGC(xvar->display,win->gc,GCForeground,&xgcv);
|
||||||
|
XDrawString(xvar->display,win->window,win->gc,x,y,string,strlen(string));
|
||||||
|
if (xvar->do_flush)
|
||||||
|
XFlush(xvar->display);
|
||||||
|
}
|
||||||
345
minilibx/mlx_xpm.c
Executable file
345
minilibx/mlx_xpm.c
Executable file
@@ -0,0 +1,345 @@
|
|||||||
|
/*
|
||||||
|
** xpm-read.c for MinilibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Tue Dec 11 15:25:27 2001 olivier crouzet
|
||||||
|
** Last update Sat Oct 1 14:56:13 2005 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
extern struct s_col_name mlx_col_name[];
|
||||||
|
|
||||||
|
|
||||||
|
#define RETURN { if (colors) free(colors); if (tab) free(tab); \
|
||||||
|
tab = (void *)0; if (colors_direct) free(colors_direct); \
|
||||||
|
if (img) {XDestroyImage(img->image); \
|
||||||
|
XFreePixmap(xvar->display,img->pix);free(img);} \
|
||||||
|
return ((void *)0);}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char *mlx_int_get_line(char *ptr,int *pos,int size)
|
||||||
|
{
|
||||||
|
int pos2;
|
||||||
|
int pos3;
|
||||||
|
int pos4;
|
||||||
|
|
||||||
|
if ((pos2 = mlx_int_str_str(ptr+*pos,"\"",size-*pos))==-1)
|
||||||
|
return ((char *)0);
|
||||||
|
if ((pos3 = mlx_int_str_str(ptr+*pos+pos2+1,"\"",size-*pos-pos2-1))==-1)
|
||||||
|
return ((char *)0);
|
||||||
|
*(ptr+*pos+pos2) = 0;
|
||||||
|
*(ptr+*pos+pos2+1+pos3) = 0;
|
||||||
|
pos4 = *pos+pos2+1;
|
||||||
|
*pos += pos2+pos3+2;
|
||||||
|
return (ptr+pos4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int strlcpy_is_not_posix(char *dest, char *src, unsigned int size)
|
||||||
|
{
|
||||||
|
unsigned count;
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
count = 0;
|
||||||
|
while (src[count] != '\0')
|
||||||
|
++count;
|
||||||
|
i = 0;
|
||||||
|
while (src[i] != '\0' && i < (size - 1))
|
||||||
|
{
|
||||||
|
dest[i] = src[i];
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
dest[i] = '\0';
|
||||||
|
return (count);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *mlx_int_static_line(char **xpm_data,int *pos,int size)
|
||||||
|
{
|
||||||
|
static char *copy = 0;
|
||||||
|
static int len = 0;
|
||||||
|
int len2;
|
||||||
|
char *str;
|
||||||
|
|
||||||
|
str = xpm_data[(*pos)++];
|
||||||
|
if ((len2 = strlen(str))>len)
|
||||||
|
{
|
||||||
|
if (copy)
|
||||||
|
free(copy);
|
||||||
|
if (!(copy = malloc(len2+1)))
|
||||||
|
return ((char *)0);
|
||||||
|
len = len2;
|
||||||
|
}
|
||||||
|
strlcpy_is_not_posix(copy, str, len2);
|
||||||
|
|
||||||
|
return (copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_get_col_name(char *str,int size)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
|
||||||
|
result = 0;
|
||||||
|
while (size--)
|
||||||
|
result = (result<<8)+*(str++);
|
||||||
|
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_int_get_text_rgb(char *name, char *end)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
char buff[64];
|
||||||
|
|
||||||
|
if (*name == '#')
|
||||||
|
return (strtol(name+1,0,16));
|
||||||
|
if (end)
|
||||||
|
{
|
||||||
|
snprintf(buff, 64, "%s %s", name, end);
|
||||||
|
name = buff;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while (mlx_col_name[i].name)
|
||||||
|
{
|
||||||
|
if (!strcasecmp(mlx_col_name[i].name, name))
|
||||||
|
return (mlx_col_name[i].color);
|
||||||
|
i ++;
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_xpm_set_pixel(t_img *img, char *data, int opp, int col, int x)
|
||||||
|
{
|
||||||
|
int dec;
|
||||||
|
|
||||||
|
dec = opp;
|
||||||
|
while (dec--)
|
||||||
|
{
|
||||||
|
if (img->image->byte_order)
|
||||||
|
*(data+x*opp+dec) = col&0xFF;
|
||||||
|
else
|
||||||
|
*(data+x*opp+opp-dec-1) = col&0xFF;
|
||||||
|
col >>= 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_int_parse_xpm(t_xvar *xvar,void *info,int info_size,char *(*f)())
|
||||||
|
{
|
||||||
|
int pos;
|
||||||
|
char *line;
|
||||||
|
char **tab;
|
||||||
|
char *data;
|
||||||
|
char *clip_data;
|
||||||
|
int nc;
|
||||||
|
int opp;
|
||||||
|
int cpp;
|
||||||
|
int col;
|
||||||
|
int rgb_col;
|
||||||
|
int col_name;
|
||||||
|
int method;
|
||||||
|
int x;
|
||||||
|
int i;
|
||||||
|
int j;
|
||||||
|
t_img *img;
|
||||||
|
t_xpm_col *colors;
|
||||||
|
int *colors_direct;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
XImage *clip_img;
|
||||||
|
XGCValues xgcv;
|
||||||
|
Pixmap clip_pix;
|
||||||
|
|
||||||
|
colors = 0;
|
||||||
|
colors_direct = 0;
|
||||||
|
img = 0;
|
||||||
|
tab = 0;
|
||||||
|
pos = 0;
|
||||||
|
if (!(line = f(info,&pos,info_size)) ||
|
||||||
|
!(tab = mlx_int_str_to_wordtab(line)) || !(width = atoi(tab[0])) ||
|
||||||
|
!(height = atoi(tab[1])) || !(nc = atoi(tab[2])) ||
|
||||||
|
!(cpp = atoi(tab[3])) )
|
||||||
|
RETURN;
|
||||||
|
free(tab);
|
||||||
|
tab = 0;
|
||||||
|
|
||||||
|
method = 0;
|
||||||
|
if (cpp<=2)
|
||||||
|
{
|
||||||
|
method = 1;
|
||||||
|
if (!(colors_direct = malloc((cpp==2?65536:256)*sizeof(int))))
|
||||||
|
RETURN;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (!(colors = malloc(nc*sizeof(*colors))))
|
||||||
|
RETURN;
|
||||||
|
|
||||||
|
clip_data = 0;
|
||||||
|
|
||||||
|
i = nc;
|
||||||
|
while (i--)
|
||||||
|
{
|
||||||
|
if (!(line = f(info,&pos,info_size)) ||
|
||||||
|
!(tab = mlx_int_str_to_wordtab(line+cpp)) )
|
||||||
|
RETURN;
|
||||||
|
j = 0;
|
||||||
|
while (tab[j] && strcmp(tab[j++],"c"));
|
||||||
|
|
||||||
|
if (!tab[j])
|
||||||
|
RETURN;
|
||||||
|
rgb_col = mlx_int_get_text_rgb(tab[j], tab[j+1]);
|
||||||
|
/*
|
||||||
|
if ((rgb_col = mlx_int_get_text_rgb(tab[j], tab[j+1]))==-1)
|
||||||
|
{
|
||||||
|
if (!(clip_data = malloc(4*width*height)) || ok, nice size ..
|
||||||
|
!(clip_img = XCreateImage(xvar->display, xvar->visual,
|
||||||
|
1, XYPixmap, 0, clip_data,
|
||||||
|
width, height, 8, (width+7)/8)) )
|
||||||
|
RETURN;
|
||||||
|
memset(clip_data, 0xFF, 4*width*height);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
if (method)
|
||||||
|
colors_direct[mlx_int_get_col_name(line,cpp)] = rgb_col;
|
||||||
|
// rgb_col>=0?mlx_get_color_value(xvar, rgb_col):rgb_col;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colors[i].name = mlx_int_get_col_name(line,cpp);
|
||||||
|
colors[i].col = rgb_col; //rgb_col>=0?mlx_get_color_value(xvar,rgb_col):rgb_col;
|
||||||
|
}
|
||||||
|
free(tab);
|
||||||
|
tab = (void *)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(img = mlx_new_image(xvar,width,height)))
|
||||||
|
RETURN;
|
||||||
|
opp = img->bpp/8;
|
||||||
|
|
||||||
|
|
||||||
|
i = height;
|
||||||
|
data = img->data;
|
||||||
|
while (i--)
|
||||||
|
{
|
||||||
|
if (!(line = f(info,&pos,info_size)))
|
||||||
|
RETURN;
|
||||||
|
x = 0;
|
||||||
|
while (x<width)
|
||||||
|
{
|
||||||
|
col = 0;
|
||||||
|
col_name = mlx_int_get_col_name(line+cpp*x,cpp);
|
||||||
|
if (method)
|
||||||
|
col = colors_direct[col_name];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
j = nc;
|
||||||
|
while (j--)
|
||||||
|
if (colors[j].name==col_name)
|
||||||
|
{
|
||||||
|
col = colors[j].col;
|
||||||
|
j = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (col==-1)
|
||||||
|
XPutPixel(clip_img, x, height-1-i, 0);
|
||||||
|
else
|
||||||
|
mlx_int_xpm_set_pixel(img, data, opp, col, x);
|
||||||
|
x ++;
|
||||||
|
*/
|
||||||
|
if (col==-1)
|
||||||
|
col = 0xFF000000;
|
||||||
|
mlx_int_xpm_set_pixel(img, data, opp, col, x);
|
||||||
|
++x;
|
||||||
|
}
|
||||||
|
data += img->size_line;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (clip_data)
|
||||||
|
{
|
||||||
|
if (!(clip_pix = XCreatePixmap(xvar->display, xvar->root,
|
||||||
|
width, height, 1)) )
|
||||||
|
RETURN;
|
||||||
|
img->gc = XCreateGC(xvar->display, clip_pix, 0, &xgcv);
|
||||||
|
XPutImage(xvar->display, clip_pix, img->gc, clip_img,
|
||||||
|
0, 0, 0, 0, width, height);
|
||||||
|
XFreeGC(xvar->display, img->gc);
|
||||||
|
xgcv.clip_mask = clip_pix;
|
||||||
|
xgcv.function = GXcopy;
|
||||||
|
xgcv.plane_mask = AllPlanes;
|
||||||
|
img->gc = XCreateGC(xvar->display, xvar->root, GCClipMask|GCFunction|
|
||||||
|
GCPlaneMask, &xgcv);
|
||||||
|
XSync(xvar->display, False);
|
||||||
|
XDestroyImage(clip_img);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
if (colors)
|
||||||
|
free(colors);
|
||||||
|
if (colors_direct)
|
||||||
|
free(colors_direct);
|
||||||
|
return (img);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_file_get_rid_comment(char *ptr, int size)
|
||||||
|
{
|
||||||
|
int com_begin;
|
||||||
|
int com_end;
|
||||||
|
|
||||||
|
while ((com_begin = mlx_int_str_str_cote(ptr,"/*",size))!=-1)
|
||||||
|
{
|
||||||
|
com_end = mlx_int_str_str(ptr+com_begin+2,"*/",size-com_begin-2);
|
||||||
|
memset(ptr+com_begin,' ',com_end+4);
|
||||||
|
}
|
||||||
|
while ((com_begin = mlx_int_str_str_cote(ptr,"//",size))!=-1)
|
||||||
|
{
|
||||||
|
com_end = mlx_int_str_str(ptr+com_begin+2,"\n",size-com_begin-2);
|
||||||
|
memset(ptr+com_begin,' ',com_end+3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_xpm_file_to_image(t_xvar *xvar,char *file,int *width,int *height)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
int size;
|
||||||
|
char *ptr;
|
||||||
|
t_img *img;
|
||||||
|
|
||||||
|
fd = -1;
|
||||||
|
if ((fd = open(file,O_RDONLY))==-1 || (size = lseek(fd,0,SEEK_END))==-1 ||
|
||||||
|
(ptr = mmap(0,size,PROT_WRITE|PROT_READ,MAP_PRIVATE,fd,0))==
|
||||||
|
(void *)MAP_FAILED)
|
||||||
|
{
|
||||||
|
if (fd>=0)
|
||||||
|
close(fd);
|
||||||
|
return ((void *)0);
|
||||||
|
}
|
||||||
|
mlx_int_file_get_rid_comment(ptr, size);
|
||||||
|
if (img = mlx_int_parse_xpm(xvar,ptr,size,mlx_int_get_line))
|
||||||
|
{
|
||||||
|
*width = img->width;
|
||||||
|
*height = img->height;
|
||||||
|
}
|
||||||
|
munmap(ptr,size);
|
||||||
|
close(fd);
|
||||||
|
return (img);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *mlx_xpm_to_image(t_xvar *xvar,char **xpm_data,int *width,int *height)
|
||||||
|
{
|
||||||
|
t_img *img;
|
||||||
|
|
||||||
|
if (img = mlx_int_parse_xpm(xvar,xpm_data,0,mlx_int_static_line))
|
||||||
|
{
|
||||||
|
*width = img->width;
|
||||||
|
*height = img->height;
|
||||||
|
}
|
||||||
|
return (img);
|
||||||
|
}
|
||||||
310
minilibx/mlx_xpm.c.ok
Executable file
310
minilibx/mlx_xpm.c.ok
Executable file
@@ -0,0 +1,310 @@
|
|||||||
|
/*
|
||||||
|
** xpm-read.c for MinilibX in
|
||||||
|
**
|
||||||
|
** Made by Charlie Root
|
||||||
|
** Login <ol@epitech.net>
|
||||||
|
**
|
||||||
|
** Started on Tue Dec 11 15:25:27 2001 olivier crouzet
|
||||||
|
** Last update Sat Oct 1 14:40:55 2005 Olivier Crouzet
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
extern struct s_col_name mlx_col_name[];
|
||||||
|
|
||||||
|
|
||||||
|
#define RETURN { if (colors) free(colors); if (tab) free(tab); \
|
||||||
|
if (colors_direct) free(colors_direct); \
|
||||||
|
if (img) {XDestroyImage(img->image); \
|
||||||
|
XFreePixmap(xvar->display,img->pix);free(img);} \
|
||||||
|
return ((void *)0);}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char *mlx_int_get_line(char *ptr,int *pos,int size)
|
||||||
|
{
|
||||||
|
int pos2;
|
||||||
|
int pos3;
|
||||||
|
int pos4;
|
||||||
|
|
||||||
|
if ((pos2 = mlx_int_str_str(ptr+*pos,"\"",size-*pos))==-1)
|
||||||
|
return ((char *)0);
|
||||||
|
if ((pos3 = mlx_int_str_str(ptr+*pos+pos2+1,"\"",size-*pos-pos2-1))==-1)
|
||||||
|
return ((char *)0);
|
||||||
|
*(ptr+*pos+pos2) = 0;
|
||||||
|
*(ptr+*pos+pos2+1+pos3) = 0;
|
||||||
|
pos4 = *pos+pos2+1;
|
||||||
|
*pos += pos2+pos3+2;
|
||||||
|
return (ptr+pos4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char *mlx_int_static_line(char **xpm_data,int *pos,int size)
|
||||||
|
{
|
||||||
|
static char *copy = 0;
|
||||||
|
static int len = 0;
|
||||||
|
int len2;
|
||||||
|
char *str;
|
||||||
|
|
||||||
|
str = xpm_data[(*pos)++];
|
||||||
|
if ((len2 = strlen(str))>len)
|
||||||
|
{
|
||||||
|
if (copy)
|
||||||
|
free(copy);
|
||||||
|
if (!(copy = malloc(len2+1)))
|
||||||
|
return ((char *)0);
|
||||||
|
len = len2;
|
||||||
|
}
|
||||||
|
/* strcpy(copy,str); */
|
||||||
|
strlcpy(copy, str, len2+1);
|
||||||
|
return (copy);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_get_col_name(char *str,int size)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
|
||||||
|
result = 0;
|
||||||
|
while (size--)
|
||||||
|
result = (result<<8)+*(str++);
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mlx_int_get_text_rgb(char *name)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (*name == '#')
|
||||||
|
return (strtol(name+1,0,16));
|
||||||
|
i = 0;
|
||||||
|
while (mlx_col_name[i].name)
|
||||||
|
{
|
||||||
|
if (!strcasecmp(mlx_col_name[i].name, name))
|
||||||
|
return (mlx_col_name[i].color);
|
||||||
|
i ++;
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_xpm_set_pixel(t_img *img, char *data, int opp, int col, int x)
|
||||||
|
{
|
||||||
|
int dec;
|
||||||
|
|
||||||
|
dec = opp;
|
||||||
|
while (dec--)
|
||||||
|
{
|
||||||
|
if (img->image->byte_order)
|
||||||
|
*(data+x*opp+dec) = col&0xFF;
|
||||||
|
else
|
||||||
|
*(data+x*opp+opp-dec-1) = col&0xFF;
|
||||||
|
col >>= 8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_int_parse_xpm(t_xvar *xvar,void *info,int info_size,char *(*f)())
|
||||||
|
{
|
||||||
|
int pos;
|
||||||
|
char *line;
|
||||||
|
char **tab;
|
||||||
|
char *data;
|
||||||
|
char *clip_data;
|
||||||
|
int nc;
|
||||||
|
int opp;
|
||||||
|
int cpp;
|
||||||
|
int col;
|
||||||
|
int rgb_col;
|
||||||
|
int col_name;
|
||||||
|
int method;
|
||||||
|
int x;
|
||||||
|
int i;
|
||||||
|
int j;
|
||||||
|
t_img *img;
|
||||||
|
t_xpm_col *colors;
|
||||||
|
int *colors_direct;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
XImage *clip_img;
|
||||||
|
XGCValues xgcv;
|
||||||
|
Pixmap clip_pix;
|
||||||
|
|
||||||
|
colors = 0;
|
||||||
|
colors_direct = 0;
|
||||||
|
img = 0;
|
||||||
|
tab = 0;
|
||||||
|
pos = 0;
|
||||||
|
if (!(line = f(info,&pos,info_size)) ||
|
||||||
|
!(tab = mlx_int_str_to_wordtab(line)) || !(width = atoi(tab[0])) ||
|
||||||
|
!(height = atoi(tab[1])) || !(nc = atoi(tab[2])) ||
|
||||||
|
!(cpp = atoi(tab[3])) )
|
||||||
|
RETURN;
|
||||||
|
free(tab);
|
||||||
|
tab = 0;
|
||||||
|
|
||||||
|
method = 0;
|
||||||
|
if (cpp<=2)
|
||||||
|
{
|
||||||
|
method = 1;
|
||||||
|
if (!(colors_direct = malloc((cpp==2?65536:256)*sizeof(int))))
|
||||||
|
RETURN;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (!(colors = malloc(nc*sizeof(*colors))))
|
||||||
|
RETURN;
|
||||||
|
|
||||||
|
clip_data = 0;
|
||||||
|
|
||||||
|
i = nc;
|
||||||
|
while (i--)
|
||||||
|
{
|
||||||
|
if (!(line = f(info,&pos,info_size)) ||
|
||||||
|
!(tab = mlx_int_str_to_wordtab(line+cpp)) )
|
||||||
|
RETURN;
|
||||||
|
j = 0;
|
||||||
|
while (tab[j] && strcmp(tab[j++],"c"));
|
||||||
|
if (!tab[j])
|
||||||
|
RETURN;
|
||||||
|
|
||||||
|
if ((rgb_col = mlx_int_get_text_rgb(tab[j]))==-1)
|
||||||
|
{
|
||||||
|
if (!(clip_data = malloc(4*width*height)) || /* ok, nice size .. */
|
||||||
|
!(clip_img = XCreateImage(xvar->display, xvar->visual,
|
||||||
|
1, XYPixmap, 0, clip_data,
|
||||||
|
width, height, 8, (width+7)/8)) )
|
||||||
|
RETURN;
|
||||||
|
memset(clip_data, 0xFF, 4*width*height);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (method)
|
||||||
|
colors_direct[mlx_int_get_col_name(line,cpp)] =
|
||||||
|
rgb_col>=0?mlx_get_color_value(xvar, rgb_col):rgb_col;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colors[i].name = mlx_int_get_col_name(line,cpp);
|
||||||
|
colors[i].col = rgb_col>=0?mlx_get_color_value(xvar,rgb_col):rgb_col;
|
||||||
|
}
|
||||||
|
free(tab);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(img = mlx_new_image(xvar,width,height)))
|
||||||
|
RETURN;
|
||||||
|
opp = img->bpp/8;
|
||||||
|
|
||||||
|
|
||||||
|
i = height;
|
||||||
|
data = img->data;
|
||||||
|
while (i--)
|
||||||
|
{
|
||||||
|
if (!(line = f(info,&pos,info_size)))
|
||||||
|
RETURN;
|
||||||
|
x = 0;
|
||||||
|
while (x<width)
|
||||||
|
{
|
||||||
|
col = 0;
|
||||||
|
col_name = mlx_int_get_col_name(line+cpp*x,cpp);
|
||||||
|
if (method)
|
||||||
|
col = colors_direct[col_name];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
j = nc;
|
||||||
|
while (j--)
|
||||||
|
if (colors[j].name==col_name)
|
||||||
|
{
|
||||||
|
col = colors[j].col;
|
||||||
|
j = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (col==-1)
|
||||||
|
XPutPixel(clip_img, x, height-1-i, 0);
|
||||||
|
else
|
||||||
|
mlx_int_xpm_set_pixel(img, data, opp, col, x);
|
||||||
|
x ++;
|
||||||
|
}
|
||||||
|
data += img->size_line;
|
||||||
|
}
|
||||||
|
if (clip_data)
|
||||||
|
{
|
||||||
|
if (!(clip_pix = XCreatePixmap(xvar->display, xvar->root,
|
||||||
|
width, height, 1)) )
|
||||||
|
RETURN;
|
||||||
|
img->gc = XCreateGC(xvar->display, clip_pix, 0, &xgcv);
|
||||||
|
XPutImage(xvar->display, clip_pix, img->gc, clip_img,
|
||||||
|
0, 0, 0, 0, width, height);
|
||||||
|
XFreeGC(xvar->display, img->gc);
|
||||||
|
xgcv.clip_mask = clip_pix;
|
||||||
|
xgcv.function = GXcopy;
|
||||||
|
xgcv.plane_mask = AllPlanes;
|
||||||
|
img->gc = XCreateGC(xvar->display, xvar->root, GCClipMask|GCFunction|
|
||||||
|
GCPlaneMask, &xgcv);
|
||||||
|
XSync(xvar->display, False);
|
||||||
|
XDestroyImage(clip_img);
|
||||||
|
}
|
||||||
|
if (colors)
|
||||||
|
free(colors);
|
||||||
|
if (colors_direct)
|
||||||
|
free(colors_direct);
|
||||||
|
return (img);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int mlx_int_file_get_rid_comment(char *ptr, int size)
|
||||||
|
{
|
||||||
|
int com_begin;
|
||||||
|
int com_end;
|
||||||
|
|
||||||
|
while ((com_begin = mlx_int_str_str_cote(ptr,"/*",size))!=-1)
|
||||||
|
{
|
||||||
|
com_end = mlx_int_str_str(ptr+com_begin+2,"*/",size-com_begin-2);
|
||||||
|
memset(ptr+com_begin,' ',com_end+4);
|
||||||
|
}
|
||||||
|
while ((com_begin = mlx_int_str_str_cote(ptr,"//",size))!=-1)
|
||||||
|
{
|
||||||
|
com_end = mlx_int_str_str(ptr+com_begin+2,"\n",size-com_begin-2);
|
||||||
|
memset(ptr+com_begin,' ',com_end+3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx_xpm_file_to_image(t_xvar *xvar,char *file,int *width,int *height)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
int size;
|
||||||
|
char *ptr;
|
||||||
|
t_img *img;
|
||||||
|
|
||||||
|
fd = -1;
|
||||||
|
if ((fd = open(file,O_RDONLY))==-1 || (size = lseek(fd,0,SEEK_END))==-1 ||
|
||||||
|
(ptr = mmap(0,size,PROT_WRITE|PROT_READ,MAP_PRIVATE,fd,0))==
|
||||||
|
(void *)MAP_FAILED)
|
||||||
|
{
|
||||||
|
if (fd>=0)
|
||||||
|
close(fd);
|
||||||
|
return ((void *)0);
|
||||||
|
}
|
||||||
|
mlx_int_file_get_rid_comment(ptr, size);
|
||||||
|
if (img = mlx_int_parse_xpm(xvar,ptr,size,mlx_int_get_line))
|
||||||
|
{
|
||||||
|
*width = img->width;
|
||||||
|
*height = img->height;
|
||||||
|
}
|
||||||
|
munmap(ptr,size);
|
||||||
|
close(fd);
|
||||||
|
return (img);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *mlx_xpm_to_image(t_xvar *xvar,char **xpm_data,int *width,int *height)
|
||||||
|
{
|
||||||
|
t_img *img;
|
||||||
|
|
||||||
|
if (img = mlx_int_parse_xpm(xvar,xpm_data,0,mlx_int_static_line))
|
||||||
|
{
|
||||||
|
*width = img->width;
|
||||||
|
*height = img->height;
|
||||||
|
}
|
||||||
|
return (img);
|
||||||
|
}
|
||||||
38
minilibx/rgb2c.pl
Executable file
38
minilibx/rgb2c.pl
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
## rgb2c.pl for MiniLibX in /home/boulon/work/c/raytraceur/minilibx
|
||||||
|
##
|
||||||
|
## Made by Olivier Crouzet
|
||||||
|
## Login <ol@epitech.net>
|
||||||
|
##
|
||||||
|
## Started on Tue Oct 5 16:33:46 2004 Olivier Crouzet
|
||||||
|
## Last update Tue Oct 5 16:36:11 2004 Olivier Crouzet
|
||||||
|
##
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generate a .c file with encoded colors, from the XFree86 rgb.txt file.
|
||||||
|
#
|
||||||
|
|
||||||
|
open(RGB, "/usr/X11/lib/X11/rgb.txt");
|
||||||
|
|
||||||
|
|
||||||
|
printf("/*\n** This is a generated file with rgb2c.pl and rgb.txt from\n");
|
||||||
|
printf("** the XFree86 distribution.\n*/\n\n");
|
||||||
|
printf("struct s_col_name mlx_col_name[] =\n{\n");
|
||||||
|
|
||||||
|
while (<RGB>)
|
||||||
|
{
|
||||||
|
@tab = split;
|
||||||
|
if ($tab[0] ne "!")
|
||||||
|
{
|
||||||
|
$color = $tab[3];
|
||||||
|
if ("$tab[4]" ne "")
|
||||||
|
{
|
||||||
|
$color = "$tab[3] $tab[4]";
|
||||||
|
}
|
||||||
|
printf(" { \"%s\" , 0x%x },\n", $color, $tab[0]*65536+$tab[1]*256+$tab[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(" { 0, 0 }\n};\n");
|
||||||
45
minilibx/test/Makefile.gen
Executable file
45
minilibx/test/Makefile.gen
Executable file
@@ -0,0 +1,45 @@
|
|||||||
|
INC=/usr/include
|
||||||
|
|
||||||
|
|
||||||
|
INCLIB=$(INC)/../lib
|
||||||
|
|
||||||
|
UNAME := $(shell uname)
|
||||||
|
|
||||||
|
CFLAGS= -I$(INC) -O3 -I.. -g
|
||||||
|
|
||||||
|
NAME= mlx-test
|
||||||
|
SRC = main.c
|
||||||
|
OBJ = $(SRC:%.c=%.o)
|
||||||
|
|
||||||
|
LFLAGS = -L.. -lmlx -L$(INCLIB) -lXext -lX11 -lm
|
||||||
|
|
||||||
|
ifeq ($(UNAME), Darwin)
|
||||||
|
# mac
|
||||||
|
CC = clang
|
||||||
|
else ifeq ($(UNAME), FreeBSD)
|
||||||
|
# FreeBSD
|
||||||
|
CC = clang
|
||||||
|
else
|
||||||
|
#Linux and others...
|
||||||
|
CC = gcc
|
||||||
|
LFLAGS += -lbsd
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: $(NAME)
|
||||||
|
|
||||||
|
$(NAME): $(OBJ)
|
||||||
|
$(CC) -o $(NAME) $(OBJ) $(LFLAGS)
|
||||||
|
|
||||||
|
show:
|
||||||
|
@printf "UNAME : $(UNAME)\n"
|
||||||
|
@printf "NAME : $(NAME)\n"
|
||||||
|
@printf "CC : $(CC)\n"
|
||||||
|
@printf "CFLAGS : $(CFLAGS)\n"
|
||||||
|
@printf "LFLAGS : $(LFLAGS)\n"
|
||||||
|
@printf "SRC :\n $(SRC)\n"
|
||||||
|
@printf "OBJ :\n $(OBJ)\n"
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(NAME) $(OBJ) *~ core *.core
|
||||||
|
|
||||||
|
re: clean all
|
||||||
45
minilibx/test/Makefile.mk
Executable file
45
minilibx/test/Makefile.mk
Executable file
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
INC=%%%%
|
||||||
|
|
||||||
|
INCLIB=$(INC)/../lib
|
||||||
|
|
||||||
|
UNAME := $(shell uname)
|
||||||
|
|
||||||
|
CFLAGS= -I$(INC) -O3 -I.. -g
|
||||||
|
|
||||||
|
NAME= mlx-test
|
||||||
|
SRC = main.c
|
||||||
|
OBJ = $(SRC:%.c=%.o)
|
||||||
|
|
||||||
|
LFLAGS = -L.. -lmlx -L$(INCLIB) -lXext -lX11 -lm
|
||||||
|
|
||||||
|
ifeq ($(UNAME), Darwin)
|
||||||
|
# mac
|
||||||
|
CC = clang
|
||||||
|
else ifeq ($(UNAME), FreeBSD)
|
||||||
|
# FreeBSD
|
||||||
|
CC = clang
|
||||||
|
else
|
||||||
|
#Linux and others...
|
||||||
|
CC = gcc
|
||||||
|
LFLAGS += -lbsd
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: $(NAME)
|
||||||
|
|
||||||
|
$(NAME): $(OBJ)
|
||||||
|
$(CC) -o $(NAME) $(OBJ) $(LFLAGS)
|
||||||
|
|
||||||
|
show:
|
||||||
|
@printf "UNAME : $(UNAME)\n"
|
||||||
|
@printf "NAME : $(NAME)\n"
|
||||||
|
@printf "CC : $(CC)\n"
|
||||||
|
@printf "CFLAGS : $(CFLAGS)\n"
|
||||||
|
@printf "LFLAGS : $(LFLAGS)\n"
|
||||||
|
@printf "SRC :\n $(SRC)\n"
|
||||||
|
@printf "OBJ :\n $(OBJ)\n"
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(NAME) $(OBJ) *~ core *.core
|
||||||
|
|
||||||
|
re: clean all
|
||||||
287
minilibx/test/main.c
Executable file
287
minilibx/test/main.c
Executable file
@@ -0,0 +1,287 @@
|
|||||||
|
|
||||||
|
#include "mlx.h"
|
||||||
|
#include "mlx_int.h"
|
||||||
|
|
||||||
|
#define WIN1_SX 242
|
||||||
|
#define WIN1_SY 242
|
||||||
|
#define IM1_SX 42
|
||||||
|
#define IM1_SY 42
|
||||||
|
#define IM3_SX 242
|
||||||
|
#define IM3_SY 242
|
||||||
|
|
||||||
|
void *mlx;
|
||||||
|
void *win1;
|
||||||
|
void *win2;
|
||||||
|
void *win3;
|
||||||
|
void *im1;
|
||||||
|
void *im2;
|
||||||
|
void *im3;
|
||||||
|
void *im4;
|
||||||
|
int bpp1;
|
||||||
|
int bpp2;
|
||||||
|
int bpp3;
|
||||||
|
int bpp4;
|
||||||
|
int sl1;
|
||||||
|
int sl2;
|
||||||
|
int sl3;
|
||||||
|
int sl4;
|
||||||
|
int endian1;
|
||||||
|
int endian2;
|
||||||
|
int endian3;
|
||||||
|
int endian4;
|
||||||
|
char *data1;
|
||||||
|
char *data2;
|
||||||
|
char *data3;
|
||||||
|
char *data4;
|
||||||
|
int xpm1_x;
|
||||||
|
int xpm1_y;
|
||||||
|
|
||||||
|
int local_endian;
|
||||||
|
|
||||||
|
int color_map_1(void *win,int w,int h);
|
||||||
|
int color_map_2(unsigned char *data,int bpp,int sl,int w,int h,int endian, int type);
|
||||||
|
|
||||||
|
int expose_win1(void *p)
|
||||||
|
{
|
||||||
|
mlx_put_image_to_window(mlx,win1,im3,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int expose_win2(void *p)
|
||||||
|
{
|
||||||
|
mlx_put_image_to_window(mlx,win2,im4,0,0);
|
||||||
|
mlx_put_image_to_window(mlx,win2,im2,0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int key_win1(int key,void *p)
|
||||||
|
{
|
||||||
|
printf("Key in Win1 : %d\n",key);
|
||||||
|
if (key==0xFF1B)
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int key_win2(int key,void *p)
|
||||||
|
{
|
||||||
|
printf("Key in Win2 : %d\n",key);
|
||||||
|
if (key==0xFF1B)
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int key_win3(int key,void *p)
|
||||||
|
{
|
||||||
|
printf("Key in Win3 : %d\n",key);
|
||||||
|
if (key==0xFF1B)
|
||||||
|
mlx_destroy_window(mlx,win3);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mouse_win1(int button,int x,int y, void *p)
|
||||||
|
{
|
||||||
|
printf("Mouse in Win1, button %d at %dx%d.\n",button,x,y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mouse_win2(int button,int x,int y, void *p)
|
||||||
|
{
|
||||||
|
printf("Mouse in Win2, button %d at %dx%d.\n",button,x,y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mouse_win3(int x,int y, void *p)
|
||||||
|
{
|
||||||
|
printf("Mouse moving in Win3, at %dx%d.\n",x,y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int a;
|
||||||
|
|
||||||
|
printf("MinilibX Test Program\n");
|
||||||
|
a = 0x11223344;
|
||||||
|
if (((unsigned char *)&a)[0] == 0x11)
|
||||||
|
local_endian = 1;
|
||||||
|
else
|
||||||
|
local_endian = 0;
|
||||||
|
printf(" => Local Endian : %d\n",local_endian);
|
||||||
|
|
||||||
|
printf(" => Connection ...");
|
||||||
|
if (!(mlx = mlx_init()))
|
||||||
|
{
|
||||||
|
printf(" !! KO !!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
printf("OK (use_xshm %d pshm_format %d)\n",((t_xvar *)mlx)->use_xshm,((t_xvar *)mlx)->pshm_format);
|
||||||
|
|
||||||
|
printf(" => Window1 %dx%d \"Title 1\" ...",WIN1_SX,WIN1_SY);
|
||||||
|
if (!(win1 = mlx_new_window(mlx,WIN1_SX,WIN1_SY,"Title1")))
|
||||||
|
{
|
||||||
|
printf(" !! KO !!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
printf("OK\n");
|
||||||
|
|
||||||
|
printf(" => Colormap sans event ...");
|
||||||
|
color_map_1(win1,WIN1_SX,WIN1_SY);
|
||||||
|
printf("OK\n");
|
||||||
|
sleep(2);
|
||||||
|
|
||||||
|
printf(" => Clear Window ...");
|
||||||
|
mlx_clear_window(mlx,win1);
|
||||||
|
printf("OK\n");
|
||||||
|
sleep(2);
|
||||||
|
|
||||||
|
printf(" => Image1 ZPixmap %dx%d ...",IM1_SX,IM1_SY);
|
||||||
|
if (!(im1 = mlx_new_image(mlx,IM1_SX,IM1_SY)))
|
||||||
|
{
|
||||||
|
printf(" !! KO !!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
data1 = mlx_get_data_addr(im1,&bpp1,&sl1,&endian1);
|
||||||
|
printf("OK (bpp1: %d, sizeline1: %d endian: %d type: %d)\n",bpp1,sl1,endian1,
|
||||||
|
((t_img *)im1)->type);
|
||||||
|
|
||||||
|
printf(" => Fill Image1 ...");
|
||||||
|
color_map_2(data1,bpp1,sl1,IM1_SX,IM1_SY,endian1, 1);
|
||||||
|
printf("OK (pixmap : %d)\n",(int)((t_img *)im1)->pix);
|
||||||
|
|
||||||
|
printf(" => Put Image1 ...");
|
||||||
|
mlx_put_image_to_window(mlx,win1,im1,20,20);
|
||||||
|
printf("OK\n");
|
||||||
|
sleep(2);
|
||||||
|
|
||||||
|
printf(" => Destroy Image1 ... ");
|
||||||
|
mlx_destroy_image(mlx, im1);
|
||||||
|
printf("OK\n");
|
||||||
|
sleep(2);
|
||||||
|
|
||||||
|
printf(" => Image3 ZPixmap %dx%d ...",IM3_SX,IM3_SY);
|
||||||
|
if (!(im3 = mlx_new_image(mlx,IM3_SX,IM3_SY)))
|
||||||
|
{
|
||||||
|
printf(" !! KO !!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
data3 = mlx_get_data_addr(im3,&bpp3,&sl3,&endian3);
|
||||||
|
printf("OK (bpp3 %d, sizeline3 %d endian3 %d type %d)\n",bpp3,sl3,endian3,
|
||||||
|
((t_img *)im3)->type);
|
||||||
|
|
||||||
|
printf(" => Fill Image3 ...");
|
||||||
|
color_map_2(data3,bpp3,sl3,IM3_SX,IM3_SY,endian3, 1);
|
||||||
|
printf("OK (pixmap : %d)\n",(int)((t_img *)im3)->pix);
|
||||||
|
|
||||||
|
printf(" => Put Image3 ...");
|
||||||
|
mlx_put_image_to_window(mlx,win1,im3,20,20);
|
||||||
|
printf("OK\n");
|
||||||
|
sleep(2);
|
||||||
|
|
||||||
|
printf(" => String ...");
|
||||||
|
mlx_string_put(mlx,win1,5,WIN1_SY/2,0xFF99FF,"String output");
|
||||||
|
mlx_string_put(mlx,win1,15,WIN1_SY/2+20,0x00FFFF,"MinilibX test");
|
||||||
|
printf("OK\n");
|
||||||
|
sleep(2);
|
||||||
|
|
||||||
|
printf(" => Xpm from file ...");
|
||||||
|
if (!(im2 = mlx_xpm_file_to_image(mlx,"open.xpm",&xpm1_x,&xpm1_y)))
|
||||||
|
{
|
||||||
|
printf(" !! KO !!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
data2 = mlx_get_data_addr(im2,&bpp2,&sl2,&endian2);
|
||||||
|
printf("OK (xpm %dx%d)(img bpp2: %d, sizeline2: %d endian: %d type: %d)\n",
|
||||||
|
xpm1_x,xpm1_y,bpp2,sl2,endian2,((t_img *)im2)->type);
|
||||||
|
sleep(2);
|
||||||
|
|
||||||
|
printf(" => Put xpm ...");
|
||||||
|
mlx_put_image_to_window(mlx,win1,im2,0,0);
|
||||||
|
mlx_put_image_to_window(mlx,win1,im2,100,100);
|
||||||
|
printf("OK\n");
|
||||||
|
sleep(2);
|
||||||
|
|
||||||
|
printf(" => 2nd window,");
|
||||||
|
win2 = mlx_new_window(mlx,WIN1_SX,WIN1_SY,"Title2");
|
||||||
|
if (!(im4 = mlx_new_image(mlx,IM3_SX, IM3_SY)))
|
||||||
|
{
|
||||||
|
printf(" !! KO !!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
data4 = mlx_get_data_addr(im4,&bpp4,&sl4,&endian4);
|
||||||
|
color_map_2(data4,bpp4,sl4,IM3_SX,IM3_SY,endian4, 2);
|
||||||
|
|
||||||
|
printf(" 3rd window, Installing hooks ...");
|
||||||
|
win3 = mlx_new_window(mlx,WIN1_SX,WIN1_SY,"Title3");
|
||||||
|
mlx_expose_hook(win1,expose_win1,0);
|
||||||
|
mlx_mouse_hook(win1,mouse_win1,0);
|
||||||
|
mlx_key_hook(win1,key_win1,0);
|
||||||
|
mlx_expose_hook(win2,expose_win2,0);
|
||||||
|
mlx_mouse_hook(win2,mouse_win2,0);
|
||||||
|
mlx_key_hook(win2,key_win2,0);
|
||||||
|
mlx_key_hook(win3,key_win3,0);
|
||||||
|
|
||||||
|
mlx_hook(win3, MotionNotify, PointerMotionMask, mouse_win3, 0);
|
||||||
|
|
||||||
|
printf("OK\nNow in Loop. Just play. Esc in 3 to destroy, 1&2 to quit.\n");
|
||||||
|
|
||||||
|
mlx_loop(mlx);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int color_map_1(void *win,int w,int h)
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int color;
|
||||||
|
|
||||||
|
x = w;
|
||||||
|
while (x--)
|
||||||
|
{
|
||||||
|
y = h;
|
||||||
|
while (y--)
|
||||||
|
{
|
||||||
|
color = (x*255)/w+((((w-x)*255)/w)<<16)+(((y*255)/h)<<8);
|
||||||
|
mlx_pixel_put(mlx,win,x,y,color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int color_map_2(unsigned char *data,int bpp,int sl,int w,int h,int endian, int type)
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int opp;
|
||||||
|
int dec;
|
||||||
|
int color;
|
||||||
|
int color2;
|
||||||
|
unsigned char *ptr;
|
||||||
|
|
||||||
|
opp = bpp/8;
|
||||||
|
printf("(opp : %d) ",opp);
|
||||||
|
y = h;
|
||||||
|
while (y--)
|
||||||
|
{
|
||||||
|
ptr = data+y*sl;
|
||||||
|
x = w;
|
||||||
|
while (x--)
|
||||||
|
{
|
||||||
|
if (type==2)
|
||||||
|
color = (y*255)/w+((((w-x)*255)/w)<<16)
|
||||||
|
+(((y*255)/h)<<8);
|
||||||
|
else
|
||||||
|
color = (x*255)/w+((((w-x)*255)/w)<<16)+(((y*255)/h)<<8);
|
||||||
|
color2 = mlx_get_color_value(mlx,color);
|
||||||
|
dec = opp;
|
||||||
|
while (dec--)
|
||||||
|
if (endian==local_endian)
|
||||||
|
{
|
||||||
|
if (endian)
|
||||||
|
*(ptr+x*opp+dec) = ((unsigned char *)(&color2))[4-opp+dec];
|
||||||
|
else
|
||||||
|
*(ptr+x*opp+dec) = ((unsigned char *)(&color2))[dec];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (endian)
|
||||||
|
*(ptr+x*opp+dec) = ((unsigned char *)(&color2))[opp-1-dec];
|
||||||
|
else
|
||||||
|
*(ptr+x*opp+dec) = ((unsigned char *)(&color2))[3-dec];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
31
minilibx/test/new_win.c
Executable file
31
minilibx/test/new_win.c
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include "mlx.h"
|
||||||
|
|
||||||
|
|
||||||
|
void *mlx;
|
||||||
|
void *win1;
|
||||||
|
void *win2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int gere_mouse(int x,int y,int button,void*toto)
|
||||||
|
{
|
||||||
|
printf("Mouse event - new win\n");
|
||||||
|
mlx_destroy_window(mlx,win1);
|
||||||
|
win1 = mlx_new_window(mlx,random()%500,random()%500,"new win");
|
||||||
|
mlx_mouse_hook(win1,gere_mouse,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
srandom(time(0));
|
||||||
|
mlx = mlx_init();
|
||||||
|
win1 = mlx_new_window(mlx,300,300,"win1");
|
||||||
|
win2 = mlx_new_window(mlx,600,600,"win2");
|
||||||
|
mlx_mouse_hook(win1,gere_mouse,0);
|
||||||
|
mlx_mouse_hook(win2,gere_mouse,0);
|
||||||
|
mlx_loop(mlx);
|
||||||
|
}
|
||||||
1439
minilibx/test/open.xpm
Executable file
1439
minilibx/test/open.xpm
Executable file
File diff suppressed because it is too large
Load Diff
230
minilibx/test/open24.xpm
Executable file
230
minilibx/test/open24.xpm
Executable file
@@ -0,0 +1,230 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char *open[] = {
|
||||||
|
/* width height num_colors chars_per_pixel */
|
||||||
|
" 45 55 168 2",
|
||||||
|
/* colors */
|
||||||
|
".. s None c None",
|
||||||
|
".# c #450304",
|
||||||
|
".a c #ce7e7c",
|
||||||
|
".b c #b94344",
|
||||||
|
".c c #b65254",
|
||||||
|
".d c #780204",
|
||||||
|
".e c #b04c4c",
|
||||||
|
".f c #b00204",
|
||||||
|
".g c #8a8a64",
|
||||||
|
".h c #969a24",
|
||||||
|
".i c #b6b60c",
|
||||||
|
".j c #cac614",
|
||||||
|
".k c #cece34",
|
||||||
|
".l c #cace54",
|
||||||
|
".m c #caca94",
|
||||||
|
".n c #c24e4c",
|
||||||
|
".o c #aa0204",
|
||||||
|
".p c #9e4244",
|
||||||
|
".q c #bc0204",
|
||||||
|
".r c #a40204",
|
||||||
|
".s c #9e262c",
|
||||||
|
".t c #8c3a3c",
|
||||||
|
".u c #5c1414",
|
||||||
|
".v c #5b0204",
|
||||||
|
".w c #700204",
|
||||||
|
".x c #722214",
|
||||||
|
".y c #b52624",
|
||||||
|
".z c #8e3234",
|
||||||
|
".A c #b60204",
|
||||||
|
".B c #c20204",
|
||||||
|
".C c #860204",
|
||||||
|
".D c #560304",
|
||||||
|
".E c #800204",
|
||||||
|
".F c #9e0204",
|
||||||
|
".G c #920204",
|
||||||
|
".H c #620204",
|
||||||
|
".I c #a41314",
|
||||||
|
".J c #996a6c",
|
||||||
|
".K c #920d09",
|
||||||
|
".L c #c80204",
|
||||||
|
".M c #690204",
|
||||||
|
".N c #980204",
|
||||||
|
".O c #984c4c",
|
||||||
|
".P c #e2dedc",
|
||||||
|
".Q c #ae5e5c",
|
||||||
|
".R c #bc6a6c",
|
||||||
|
".S c #a21a1c",
|
||||||
|
".T c #8a0a04",
|
||||||
|
".U c #671e1c",
|
||||||
|
".V c #941b1c",
|
||||||
|
".W c #b8b4b4",
|
||||||
|
".X c #e8e6e4",
|
||||||
|
".Y c #ccb4b4",
|
||||||
|
".Z c #c07c7c",
|
||||||
|
".0 c #f3f2eb",
|
||||||
|
".1 c #b49696",
|
||||||
|
".2 c #521614",
|
||||||
|
".3 c #9e5a5c",
|
||||||
|
".4 c #d4d4d4",
|
||||||
|
".5 c #a7a5a1",
|
||||||
|
".6 c #dec4c4",
|
||||||
|
".7 c #e4d6d4",
|
||||||
|
".8 c #f4f2f4",
|
||||||
|
".9 c #cccac4",
|
||||||
|
"#. c #9a161c",
|
||||||
|
"## c #8c0204",
|
||||||
|
"#a c #862c2c",
|
||||||
|
"#b c #7e5e5c",
|
||||||
|
"#c c #a39694",
|
||||||
|
"#d c #6b6667",
|
||||||
|
"#e c #322624",
|
||||||
|
"#f c #b09e9c",
|
||||||
|
"#g c #b23234",
|
||||||
|
"#h c #500304",
|
||||||
|
"#i c #222224",
|
||||||
|
"#j c #2e322c",
|
||||||
|
"#k c #925c5c",
|
||||||
|
"#l c #721a1c",
|
||||||
|
"#m c #6e6e6c",
|
||||||
|
"#n c #0a0a0c",
|
||||||
|
"#o c #b2b2b4",
|
||||||
|
"#p c #8e6264",
|
||||||
|
"#q c #884444",
|
||||||
|
"#r c #8c5c5c",
|
||||||
|
"#s c #121214",
|
||||||
|
"#t c #b2aeac",
|
||||||
|
"#u c #c21e1c",
|
||||||
|
"#v c #6e0e0c",
|
||||||
|
"#w c #623e3c",
|
||||||
|
"#x c #b64e4c",
|
||||||
|
"#y c #bc3634",
|
||||||
|
"#z c #624e1c",
|
||||||
|
"#A c #6e727c",
|
||||||
|
"#B c #824e4c",
|
||||||
|
"#C c #8b8d87",
|
||||||
|
"#D c #a09674",
|
||||||
|
"#E c #766844",
|
||||||
|
"#F c #7a663c",
|
||||||
|
"#G c #828c90",
|
||||||
|
"#H c #beb6a4",
|
||||||
|
"#I c #3a0204",
|
||||||
|
"#J c #8e9298",
|
||||||
|
"#K c #562529",
|
||||||
|
"#L c #7c3838",
|
||||||
|
"#M c #bab294",
|
||||||
|
"#N c #7e4644",
|
||||||
|
"#O c #929a9c",
|
||||||
|
"#P c #762a2c",
|
||||||
|
"#Q c #a60e0c",
|
||||||
|
"#R c #ae1e1c",
|
||||||
|
"#S c #460a0c",
|
||||||
|
"#T c #a6aaa4",
|
||||||
|
"#U c #6a4a4c",
|
||||||
|
"#V c #784c50",
|
||||||
|
"#W c #761214",
|
||||||
|
"#X c #9e1e1c",
|
||||||
|
"#Y c #988c90",
|
||||||
|
"#Z c #821e1c",
|
||||||
|
"#0 c #7a1618",
|
||||||
|
"#1 c #7a6e74",
|
||||||
|
"#2 c #7e7a77",
|
||||||
|
"#3 c #808688",
|
||||||
|
"#4 c #828284",
|
||||||
|
"#5 c #828279",
|
||||||
|
"#6 c #827a64",
|
||||||
|
"#7 c #7e765c",
|
||||||
|
"#8 c #864a34",
|
||||||
|
"#9 c #825a44",
|
||||||
|
"a. c #766e54",
|
||||||
|
"a# c #7e7e74",
|
||||||
|
"aa c #806464",
|
||||||
|
"ab c #7e724c",
|
||||||
|
"ac c #766634",
|
||||||
|
"ad c #765a2c",
|
||||||
|
"ae c #8e7e54",
|
||||||
|
"af c #a69e8c",
|
||||||
|
"ag c #c7c2ac",
|
||||||
|
"ah c #9a2a1c",
|
||||||
|
"ai c #aa3a3c",
|
||||||
|
"aj c #979894",
|
||||||
|
"ak c #70684c",
|
||||||
|
"al c #62522c",
|
||||||
|
"am c #6e5e3c",
|
||||||
|
"an c #92866c",
|
||||||
|
"ao c #968e6c",
|
||||||
|
"ap c #826e54",
|
||||||
|
"aq c #84765c",
|
||||||
|
"ar c #86522c",
|
||||||
|
"as c #7e4624",
|
||||||
|
"at c #7e3614",
|
||||||
|
"au c #6e5254",
|
||||||
|
"av c #712e2c",
|
||||||
|
"aw c #7a5654",
|
||||||
|
"ax c #82727c",
|
||||||
|
"ay c #a63634",
|
||||||
|
"az c #8a6a6c",
|
||||||
|
"aA c #863534",
|
||||||
|
"aB c #5c1a18",
|
||||||
|
"aC c #6a2c2c",
|
||||||
|
"aD c #5e0e14",
|
||||||
|
"aE c #868684",
|
||||||
|
"aF c #922624",
|
||||||
|
"aG c #901614",
|
||||||
|
"aH c #c21614",
|
||||||
|
"aI c #520e0c",
|
||||||
|
"aJ c #805654",
|
||||||
|
"aK c #b00c0c",
|
||||||
|
"aL c #c2221c",
|
||||||
|
/* pixels */
|
||||||
|
"..........................................................................................",
|
||||||
|
"..........................................................................................",
|
||||||
|
".....................................#.a.#................................................",
|
||||||
|
"...................................#.b.c.#.#.#.#...........#.d............................",
|
||||||
|
".................................#.e.f.f.#.g.h.i.j.k.l.m...f.n............................",
|
||||||
|
".................................d.f.o.f.#.#.#.d.d.#.#.#...f.f.d..........................",
|
||||||
|
".................................p.q.q.r.s.t.u.v.w.x.d.d.#.d.r.y.d........................",
|
||||||
|
".................................z.A.B.q.C.D.E.F.G.E.H.E.I.F.q.A.d........................",
|
||||||
|
".................................J.G.f.G.w.K.f.L.B.B.r.M.f.B.L.A.d........................",
|
||||||
|
".................................d.w.N.M.O.P.Q.B.B.o.R.S.E.q.q.T.d........................",
|
||||||
|
".................................d.U.M.V.W.X.Y.q.B.Z.0.1.E.r.N.d..........................",
|
||||||
|
".................................d.2.r.3.4.5.6.A.f.7.8.9#.###a.#..........................",
|
||||||
|
"................................#b.d.L#c#d#e#f.N.V.5#d.4#g.E.d............................",
|
||||||
|
"...............................d#h.r.L#f#i#j#k.M#l#m#n#o.b.r.d............................",
|
||||||
|
"...............................d#h##.q#g#p#q##.q.N#r#s#t#u.q#v.#..........................",
|
||||||
|
"..............#j................#w.w.C.r.q##.r.B.f.T#x#y.L.r.M.d..........................",
|
||||||
|
"............#j#z#j#A#A#j.........d.D.r.M.C.f.r.r.r.q.B.C.N.E#B............................",
|
||||||
|
"..........#j#C#D#E#z#F#G#j.......d.d.#.G##.w.M.M.C.C.d.G.r.u.d............................",
|
||||||
|
"....................#E#H#C#j.........d#I.w.F.f.o.o.o.N.M.#.d..............................",
|
||||||
|
"......................#E#j#J#j......#K.M.#.#.v.w.M.v.##h.H#L.d............................",
|
||||||
|
"..........................#M#j.......v.F.q.r.d.w.w.C.E.M.v.M#N.d..........................",
|
||||||
|
"..........................#E#O#j#j#K##.f.L.L.L.B.q.f##.M.v.w.w#P.d.#...d.d................",
|
||||||
|
"............................#C#E.#.v.o.B.L.L.q.q.q.q.N.M.D#h.M.N.r#Q#R#S.H.J.#............",
|
||||||
|
"............................#j#T#U.C.q.q.o.G.F.f.q.A.N.d.v.v##.o.q.L.r.C.A###k............",
|
||||||
|
"..............................#C#V.N.A.N.f.q.F.C.E.f.F.E.H#n#W.K.I#X#a.z.V.q.d#p.d........",
|
||||||
|
"................................#Y.r.K#Z.K.q.A.G.w#0#b#1#2#3#4#5#5#6#6#7#8.q.G#9..........",
|
||||||
|
"..................#j#oa..5#j..#J#Ja##4#4aa.o.A##.E.xabacadae#Daf#M#Magah.r.qai.#..........",
|
||||||
|
"................aja#akalamanaoapaqaaarasat.r.o.E.w.T.T.E.H.#...........#.d.d.#............",
|
||||||
|
"...........E....#j#j#C#M#j#n#naa#V.O.f.N.F.q.G.d.w.r.C.d.H.#...............#..............",
|
||||||
|
"...........#.F.F.J#n#n#n#n#n#nauav#p.q.N.d.d.w.M.F.F.E.d.U................................",
|
||||||
|
".........E.F.E.E.d.z#n.d#n#n#naw.Uax.r##.d.w.D.M.r.N.E.w.d................................",
|
||||||
|
".........E.F.......d.Fay.E.F#naz.2#A.D#h.r.f.w##.r##.d.H.M................................",
|
||||||
|
".........F.#...........E.E.F.baAaB#A.#.E.f.r.w.N.N.E.waC.#................................",
|
||||||
|
".........F.#...............d.F.E#K#d.H.G.F.G.w.N##.d.D.#..................................",
|
||||||
|
".........F.#....................#Aau.v.E##.w.E.E.w.H.d.......d..av.d......................",
|
||||||
|
".........E.#..................#j#GaC.M.H.M.d.d.w.H.#.d.d.#aC.w.C##.E.d....................",
|
||||||
|
"...........F.................5#O...#aD.w.d.w.H.D.M######.G.F.o.f.o.N.3....................",
|
||||||
|
"...........F.E...........5aEakak.....#.##h#h.v.N.o.f.q.L.L.L.L.L.q.faF....................",
|
||||||
|
"...........E.E......#E#C.5aq#j.....#.v.N.F.d.N.r.F.r.F#Q.I.o.q.L.L.L.y....................",
|
||||||
|
".............E.....................#.E.B.qaG.d.d.d.....#.#.....d#x.b......................",
|
||||||
|
".............E.F...................E.w.L.LaG.#............................................",
|
||||||
|
"...............E.E.................EaA.q.qaG.#............................................",
|
||||||
|
"...............E.F.E.................E.r.r#Z.#............................................",
|
||||||
|
".................E.F.E...............E.G.NaA..............................................",
|
||||||
|
".................E#uaH.................w.dav..............................................",
|
||||||
|
"...................E.E.............EaI.M.w.v.#............................................",
|
||||||
|
"...................................E.D.d.E.waJ............................................",
|
||||||
|
".....................................C.N.N##.M............................................",
|
||||||
|
"..................................#W.f.q.A.f.G#q..........................................",
|
||||||
|
".....................................q.L.L.L.q.V.#........................................",
|
||||||
|
"...................................#.daK.q.qaL.d..........................................",
|
||||||
|
".......................................#.#.#..............................................",
|
||||||
|
"..........................................................................................",
|
||||||
|
"..........................................................................................",
|
||||||
|
".........................................................................................."
|
||||||
|
};
|
||||||
1439
minilibx/test/open30.xpm
Executable file
1439
minilibx/test/open30.xpm
Executable file
File diff suppressed because it is too large
Load Diff
94
minilibx/test/run_tests.sh
Executable file
94
minilibx/test/run_tests.sh
Executable file
@@ -0,0 +1,94 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# This very basic script simulate user inputs for the CI
|
||||||
|
# Feel free to update, improve or remove it if proper
|
||||||
|
# intergration tests and/or unit tests are added.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
BOLD="\033[1m"
|
||||||
|
RESET="\033[0m"
|
||||||
|
LIGHT_RED="\033[91m"
|
||||||
|
LIGHT_GREEN="\033[92m"
|
||||||
|
LIGHT_CYAN="\033[96m"
|
||||||
|
|
||||||
|
logging(){
|
||||||
|
local type=$1; shift
|
||||||
|
printf "${LIGHT_CYAN}${BOLD}run_tests${RESET} [%b] : %b\n" "$type" "$*"
|
||||||
|
}
|
||||||
|
log_info(){
|
||||||
|
logging "${LIGHT_GREEN}info${RESET}" "$@"
|
||||||
|
}
|
||||||
|
log_error(){
|
||||||
|
logging "${LIGHT_RED}error${RESET}" "$@" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PID=""
|
||||||
|
|
||||||
|
# to properly kill child process executed in background on exit
|
||||||
|
at_exit() {
|
||||||
|
status=$?
|
||||||
|
[ $status -eq 0 ] && log_info "Seem all went well" && exit 0
|
||||||
|
# Code for non-zero exit:
|
||||||
|
if ! kill -s TERM "$PID" 2>/dev/null || ! wait "$PID" ; then
|
||||||
|
log_error "Pid [$PID] died with status $status "
|
||||||
|
fi
|
||||||
|
log_error "Something went wrong. Pid [$PID] has been killed. Status code $status"
|
||||||
|
}
|
||||||
|
# to properly quit from ctrl+c (SIGINT Signal)
|
||||||
|
sigint_handler(){
|
||||||
|
kill -s TERM "$PID"
|
||||||
|
wait
|
||||||
|
log_info "Tests abort"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# look at test/main.c and run ./mlx-test to understand what this function does
|
||||||
|
test_default_main(){
|
||||||
|
${MAKE} -f Makefile.gen all
|
||||||
|
./mlx-test &
|
||||||
|
PID="$!"
|
||||||
|
log_info "./mlx-test running in background, pid:" $PID
|
||||||
|
|
||||||
|
i=25 # waiting 25s mlx-test to be ready for inputs.
|
||||||
|
while [ $i -gt 0 ]; do
|
||||||
|
if ! ps -p $PID > /dev/null ; then
|
||||||
|
wait $PID
|
||||||
|
fi
|
||||||
|
log_info "countdown" $i
|
||||||
|
sleep 1
|
||||||
|
i=$((i - 1))
|
||||||
|
done
|
||||||
|
log_info "Ready to \"just play\" using xdotool"
|
||||||
|
wid1=$(xdotool search --name Title1)
|
||||||
|
wid2=$(xdotool search --name Title2)
|
||||||
|
wid3=$(xdotool search --name Title3)
|
||||||
|
|
||||||
|
xdotool windowfocus $wid3
|
||||||
|
log_info "Focus Win3: Testing move mouse 100 100"
|
||||||
|
xdotool mousemove 100 100
|
||||||
|
log_info "Focus Win3: Testing move mouse 200 200"
|
||||||
|
xdotool mousemove 200 200
|
||||||
|
log_info "Focus Win3: Pressing escape to destroy window \"Win3\""
|
||||||
|
xdotool key Escape
|
||||||
|
|
||||||
|
log_info "Focus Win2: Pressing escape to stop program"
|
||||||
|
xdotool windowfocus $wid2
|
||||||
|
xdotool key Escape
|
||||||
|
}
|
||||||
|
|
||||||
|
main(){
|
||||||
|
case $(uname) in
|
||||||
|
FreeBSD) MAKE=gmake ;;
|
||||||
|
*) MAKE=make ;;
|
||||||
|
esac
|
||||||
|
cd $(dirname $0)
|
||||||
|
trap at_exit EXIT
|
||||||
|
trap sigint_handler INT
|
||||||
|
|
||||||
|
test_default_main
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
99
so_long.h
Executable file
99
so_long.h
Executable file
@@ -0,0 +1,99 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* so_long.h :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/14 15:25:35 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/02/15 09:54:46 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#ifndef SO_LONG_H
|
||||||
|
# define SO_LONG_H
|
||||||
|
|
||||||
|
# define WIDTH 32
|
||||||
|
# define HEIGHT 32
|
||||||
|
# define RIGHT 0
|
||||||
|
# define LEFT 1
|
||||||
|
# define UP 2
|
||||||
|
# define DOWN 3
|
||||||
|
|
||||||
|
# include "./minilibx/mlx.h"
|
||||||
|
# include "get_next_line/get_next_line.h"
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <fcntl.h>
|
||||||
|
# include <unistd.h>
|
||||||
|
# include <stdint.h>
|
||||||
|
|
||||||
|
typedef struct s_player
|
||||||
|
{
|
||||||
|
void *link_right;
|
||||||
|
void *link_left;
|
||||||
|
void *link_up;
|
||||||
|
void *link_down;
|
||||||
|
} t_player;
|
||||||
|
|
||||||
|
typedef struct s_textures
|
||||||
|
{
|
||||||
|
void *ground;
|
||||||
|
void *coin;
|
||||||
|
void *door;
|
||||||
|
void *wall;
|
||||||
|
} t_textures;
|
||||||
|
|
||||||
|
typedef struct s_game
|
||||||
|
{
|
||||||
|
void *mlx;
|
||||||
|
void *window;
|
||||||
|
int score;
|
||||||
|
int coins;
|
||||||
|
int moves;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int map_rows;
|
||||||
|
int map_cols;
|
||||||
|
int exit_row;
|
||||||
|
int exit_col;
|
||||||
|
int flood_fill_coins;
|
||||||
|
int current_frame;
|
||||||
|
int player_position;
|
||||||
|
char **map;
|
||||||
|
t_textures textures;
|
||||||
|
t_player player;
|
||||||
|
} t_game;
|
||||||
|
|
||||||
|
char *ft_itoa(int n);
|
||||||
|
int on_destroy(t_game *game);
|
||||||
|
|
||||||
|
int save_map(char *map, t_game *game);
|
||||||
|
void open_images(t_game *game);
|
||||||
|
void add_graphics(t_game *game);
|
||||||
|
void put_player(t_game *game, int width, int height);
|
||||||
|
void open_score(t_game *game);
|
||||||
|
void door_locked_up_down(t_game *game, int door_row, int door_col);
|
||||||
|
|
||||||
|
void move_top(t_game *game, int i, int j);
|
||||||
|
void move_down(t_game *game, int i, int j);
|
||||||
|
void move_right(t_game *game, int i, int j);
|
||||||
|
void move_left(t_game *game, int i, int j);
|
||||||
|
|
||||||
|
|
||||||
|
void free_map(t_game *game);
|
||||||
|
void free_player(t_game *game);
|
||||||
|
void free_textures(t_game *game);
|
||||||
|
void free_visited(int **visited, t_game *game);
|
||||||
|
|
||||||
|
|
||||||
|
int check_playable(t_game *game);
|
||||||
|
int check_filename(char *file);
|
||||||
|
int check_map(char *map, t_game *game);
|
||||||
|
int valid_path(t_game *game);
|
||||||
|
int check_char(t_game *game, int *p, int *e, int i);
|
||||||
|
int check_last_row_rectan(t_game *game);
|
||||||
|
void check_playable_row(t_game *game, int *c, int *p, int *e);
|
||||||
|
|
||||||
|
#endif
|
||||||
125
src/check_map.c
Executable file
125
src/check_map.c
Executable file
@@ -0,0 +1,125 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* check_map.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/15 23:09:29 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/02/15 09:57:16 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
static int check_last_row(char *line)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (line[i])
|
||||||
|
{
|
||||||
|
if (line[i] != '1')
|
||||||
|
{
|
||||||
|
write(1, "Error\nLast row has to contain only wall", 40);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int check_rows(t_game *game, int linecount)
|
||||||
|
{
|
||||||
|
int row_len;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
row_len = 0;
|
||||||
|
while (game->map[0][row_len +1])
|
||||||
|
{
|
||||||
|
if (game->map[0][row_len] != '1')
|
||||||
|
return (1);
|
||||||
|
row_len++;
|
||||||
|
}
|
||||||
|
if (row_len < 3)
|
||||||
|
return (1);
|
||||||
|
i = 0;
|
||||||
|
while (game->map[i + 1])
|
||||||
|
{
|
||||||
|
if ((int)ft_strlen(game->map[i]) < game->map_cols
|
||||||
|
|| (game->map[i][row_len] && i + 1 == linecount))
|
||||||
|
return (1);
|
||||||
|
if (game->map[i][row_len + 1] || !(game->map[i][row_len - 1]))
|
||||||
|
return (1);
|
||||||
|
if (game->map[i][0] != '1' || game->map[i][row_len - 1] != '1')
|
||||||
|
return (1);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int check_elements(t_game *game)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int p;
|
||||||
|
int e;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
p = 0;
|
||||||
|
e = 0;
|
||||||
|
while (game->map[i])
|
||||||
|
{
|
||||||
|
if (check_char(game, &p, &e, i) == 1)
|
||||||
|
return (1);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int advanced_checks(t_game *game, int linecount, char *map)
|
||||||
|
{
|
||||||
|
if (check_filename(map) == 1)
|
||||||
|
return (1);
|
||||||
|
if (check_last_row(game->map[linecount - 1]) == 1)
|
||||||
|
return (1);
|
||||||
|
if (check_rows(game, linecount) == 1)
|
||||||
|
{
|
||||||
|
write(1, "Error\nThe map must be surrounded \
|
||||||
|
by walls/rectangular\n", 55);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
if (check_elements(game) == 1)
|
||||||
|
{
|
||||||
|
write(1, "Error\nThe map does not have all components\n", 44);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
if (check_playable(game) == 1)
|
||||||
|
{
|
||||||
|
write(1, "Error\nThe map is not playable\n", 30);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
if (check_last_row_rectan(game) == 1)
|
||||||
|
return (1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int check_map(char *map, t_game *game)
|
||||||
|
{
|
||||||
|
int linecount;
|
||||||
|
int colcount;
|
||||||
|
|
||||||
|
linecount = 0;
|
||||||
|
while (game->map[linecount])
|
||||||
|
linecount++;
|
||||||
|
colcount = 0;
|
||||||
|
while (game->map[0][colcount])
|
||||||
|
colcount++;
|
||||||
|
game->map_cols = colcount;
|
||||||
|
game->map_rows = linecount - 1;
|
||||||
|
if (advanced_checks(game, linecount, map) == 1)
|
||||||
|
{
|
||||||
|
free_map(game);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
122
src/controllers.c
Executable file
122
src/controllers.c
Executable file
@@ -0,0 +1,122 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* controllers.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/16 09:25:06 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/02/15 09:55:44 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
void door_locked_right_left(t_game *game, int door_row, int door_col)
|
||||||
|
{
|
||||||
|
if (game->player_position == RIGHT)
|
||||||
|
{
|
||||||
|
if (game->map[door_row][door_col + 1] == '1')
|
||||||
|
return ;
|
||||||
|
if (game->map[door_row][door_col + 1] == 'C')
|
||||||
|
game->score += 1;
|
||||||
|
game->map[door_row][door_col - 1] = '0';
|
||||||
|
game->map[door_row][door_col + 1] = 'P';
|
||||||
|
put_player(game, door_col + 1, door_row);
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.ground, (door_col - 1) * 32, door_row * 32);
|
||||||
|
}
|
||||||
|
else if (game->player_position == LEFT)
|
||||||
|
{
|
||||||
|
if (game->map[door_row][door_col - 1] == '1')
|
||||||
|
return ;
|
||||||
|
if (game->map[door_row][door_col - 1] == 'C')
|
||||||
|
game->score += 1;
|
||||||
|
game->map[door_row][door_col + 1] = '0';
|
||||||
|
game->map[door_row][door_col - 1] = 'P';
|
||||||
|
put_player(game, door_col - 1, door_row);
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.ground, (door_col + 1) * 32, door_row * 32);
|
||||||
|
}
|
||||||
|
game->moves += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void move_top(t_game *game, int i, int j)
|
||||||
|
{
|
||||||
|
game->player_position = UP;
|
||||||
|
if (game->map[j + 1][i] == 'C')
|
||||||
|
game->score += 1;
|
||||||
|
else if (game->map[j + 1][i] == 'E' && game->coins == game->score)
|
||||||
|
on_destroy(game);
|
||||||
|
else if (game->map[j + 1][i] == 'E')
|
||||||
|
{
|
||||||
|
door_locked_up_down(game, j + 1, i);
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
game->moves += 1;
|
||||||
|
game->map[j][i] = '0';
|
||||||
|
game->map[j + 1][i] = 'P';
|
||||||
|
put_player(game, i, j + 1);
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.ground, i * 32, (j * 32));
|
||||||
|
}
|
||||||
|
|
||||||
|
void move_down(t_game *game, int i, int j)
|
||||||
|
{
|
||||||
|
game->player_position = DOWN;
|
||||||
|
if (game->map[j - 1][i] == 'C')
|
||||||
|
game->score += 1;
|
||||||
|
else if (game->map[j - 1][i] == 'E' && game->coins == game->score)
|
||||||
|
on_destroy(game);
|
||||||
|
else if (game->map[j - 1][i] == 'E')
|
||||||
|
{
|
||||||
|
door_locked_up_down(game, j - 1, i);
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
game->moves += 1;
|
||||||
|
game->map[j][i] = '0';
|
||||||
|
game->map[j - 1][i] = 'P';
|
||||||
|
put_player(game, i, j - 1);
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.ground, i * 32, (j * 32));
|
||||||
|
}
|
||||||
|
|
||||||
|
void move_left(t_game *game, int i, int j)
|
||||||
|
{
|
||||||
|
game->player_position = LEFT;
|
||||||
|
if (game->map[j][i - 1] == 'C')
|
||||||
|
game->score += 1;
|
||||||
|
else if (game->map[j][i - 1] == 'E' && game->coins == game->score)
|
||||||
|
on_destroy(game);
|
||||||
|
else if (game->map[j][i - 1] == 'E')
|
||||||
|
{
|
||||||
|
door_locked_right_left(game, j, i - 1);
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
game->moves += 1;
|
||||||
|
game->map[j][i] = '0';
|
||||||
|
game->map[j][i - 1] = 'P';
|
||||||
|
put_player(game, i - 1, j);
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.ground, i * 32, (j * 32));
|
||||||
|
}
|
||||||
|
|
||||||
|
void move_right(t_game *game, int i, int j)
|
||||||
|
{
|
||||||
|
game->player_position = RIGHT;
|
||||||
|
if (game->map[j][i + 1] == 'C')
|
||||||
|
game->score += 1;
|
||||||
|
else if (game->map[j][i + 1] == 'E' && game->coins == game->score)
|
||||||
|
on_destroy(game);
|
||||||
|
else if (game->map[j][i + 1] == 'E')
|
||||||
|
{
|
||||||
|
door_locked_right_left(game, j, i + 1);
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
game->moves += 1;
|
||||||
|
game->map[j][i] = '0';
|
||||||
|
game->map[j][i + 1] = 'P';
|
||||||
|
put_player(game, i + 1, j);
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.ground, i * 32, (j * 32));
|
||||||
|
}
|
||||||
116
src/extra.c
Executable file
116
src/extra.c
Executable file
@@ -0,0 +1,116 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* extra.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/16 09:25:50 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/02/15 09:55:41 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
int check_last_row_rectan(t_game *game)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (game->map[game->map_rows][i])
|
||||||
|
i++;
|
||||||
|
if (i != game->map_cols - 1)
|
||||||
|
{
|
||||||
|
write(1, "Error\nLast row is incorrect\n", 28);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int check_playable(t_game *game)
|
||||||
|
{
|
||||||
|
int p;
|
||||||
|
int e;
|
||||||
|
int c;
|
||||||
|
|
||||||
|
e = 0;
|
||||||
|
p = 0;
|
||||||
|
c = 0;
|
||||||
|
check_playable_row(game, &c, &p, &e);
|
||||||
|
if (c == 0 || p == 0 || e == 0)
|
||||||
|
return (1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int check_filename(char *file)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (file[i])
|
||||||
|
{
|
||||||
|
if (file[i] == '.')
|
||||||
|
{
|
||||||
|
if (!(file[i + 1] == 'b' && file[i + 2] == 'e' \
|
||||||
|
&& file[i + 3] == 'r' && !(file[i + 4])))
|
||||||
|
{
|
||||||
|
write(1, "Error\nProgramm accepts only .ber files\n", 39);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int check_char(t_game *game, int *p, int *e, int i)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
|
||||||
|
j = 0;
|
||||||
|
while (game->map[i][j + 1])
|
||||||
|
{
|
||||||
|
if ((game->map[i][j] != 'P' && game->map[i][j] != 'E'\
|
||||||
|
&& game->map[i][j] != '1' && game->map[i][j] != '0'\
|
||||||
|
&& game->map[i][j] != 'C') \
|
||||||
|
|| *p > 1 || *e > 1)
|
||||||
|
return (1);
|
||||||
|
if (game->map[i][j] == 'P')
|
||||||
|
*p += 1;
|
||||||
|
if (game->map[i][j] == 'E')
|
||||||
|
*e += 1;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void door_locked_up_down(t_game *game, int door_row, int door_col)
|
||||||
|
{
|
||||||
|
if (game->player_position == UP)
|
||||||
|
{
|
||||||
|
if (game->map[door_row + 1][door_col] == '1')
|
||||||
|
return ;
|
||||||
|
if (game->map[door_row + 1][door_col] == 'C')
|
||||||
|
game->score += 1;
|
||||||
|
game->map[door_row - 1][door_col] = '0';
|
||||||
|
game->map[door_row + 1][door_col] = 'P';
|
||||||
|
put_player(game, door_col, door_row + 1);
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.ground, door_col * 32, (door_row - 1) * 32);
|
||||||
|
}
|
||||||
|
else if (game->player_position == DOWN)
|
||||||
|
{
|
||||||
|
if (game->map[door_row - 1][door_col] == '1')
|
||||||
|
return ;
|
||||||
|
if (game->map[door_row - 1][door_col] == 'C')
|
||||||
|
game->score += 1;
|
||||||
|
game->map[door_row + 1][door_col] = '0';
|
||||||
|
game->map[door_row - 1][door_col] = 'P';
|
||||||
|
put_player(game, door_col, door_row - 1);
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.ground, door_col * 32, (door_row + 1) * 32);
|
||||||
|
}
|
||||||
|
game->moves += 1;
|
||||||
|
}
|
||||||
103
src/flood_fill.c
Executable file
103
src/flood_fill.c
Executable file
@@ -0,0 +1,103 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* flood_fill.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/16 09:26:11 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/01/15 17:46:10 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
int validmove(t_game *game, int **visited, int row, int col)
|
||||||
|
{
|
||||||
|
return (game->map[row][col] != '1' && !visited[row][col]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void floodfill(t_game *game, int row, int col, int **visited)
|
||||||
|
{
|
||||||
|
if (!validmove(game, visited, row, col) || visited[row][col])
|
||||||
|
return ;
|
||||||
|
if (game->map[row][col] == 'C')
|
||||||
|
game->flood_fill_coins += 1;
|
||||||
|
visited[row][col] = 1;
|
||||||
|
floodfill(game, row - 1, col, visited);
|
||||||
|
floodfill(game, row + 1, col, visited);
|
||||||
|
floodfill(game, row, col - 1, visited);
|
||||||
|
floodfill(game, row, col + 1, visited);
|
||||||
|
}
|
||||||
|
|
||||||
|
void player_position(t_game *game, int i, int *player_col, int *player_row)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
|
||||||
|
j = 0;
|
||||||
|
game->flood_fill_coins = 0;
|
||||||
|
game->coins = 0;
|
||||||
|
while (game->map[i][j])
|
||||||
|
{
|
||||||
|
if (game->map[i][j] == 'P')
|
||||||
|
{
|
||||||
|
*player_row = i;
|
||||||
|
*player_col = j;
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void exit_position(t_game *game)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (game->map[i])
|
||||||
|
{
|
||||||
|
j = 0;
|
||||||
|
while (game->map[i][j])
|
||||||
|
{
|
||||||
|
if (game->map[i][j] == 'E')
|
||||||
|
{
|
||||||
|
game->exit_row = i;
|
||||||
|
game->exit_col = j;
|
||||||
|
}
|
||||||
|
if (game->map[i][j] == 'C')
|
||||||
|
game->coins += 1;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int valid_path(t_game *game)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int p_row;
|
||||||
|
int p_col;
|
||||||
|
int **visited;
|
||||||
|
|
||||||
|
visited = ft_calloc(game->map_rows, sizeof(int *));
|
||||||
|
i = 0;
|
||||||
|
while (i < game->map_rows)
|
||||||
|
{
|
||||||
|
visited[i] = ft_calloc(game->map_cols, sizeof(int *));
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while (game->map[i])
|
||||||
|
{
|
||||||
|
player_position(game, i, &p_col, &p_row);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
exit_position(game);
|
||||||
|
floodfill(game, p_row, p_col, visited);
|
||||||
|
i = visited[p_row][p_col] && visited[game->exit_row][game->exit_col];
|
||||||
|
free_visited(visited, game);
|
||||||
|
if (game->flood_fill_coins != game->coins || !i)
|
||||||
|
return (1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
55
src/free_game.c
Executable file
55
src/free_game.c
Executable file
@@ -0,0 +1,55 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* free_game.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/16 09:26:41 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/01/15 17:46:14 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
void free_visited(int **visited, t_game *game)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (i < game->map_rows)
|
||||||
|
{
|
||||||
|
free(visited[i]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
free(visited);
|
||||||
|
}
|
||||||
|
|
||||||
|
void free_map(t_game *game)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (game->map[i] != NULL)
|
||||||
|
{
|
||||||
|
free (game->map[i]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
free(game->map);
|
||||||
|
}
|
||||||
|
|
||||||
|
void free_player(t_game *game)
|
||||||
|
{
|
||||||
|
mlx_destroy_image(game->mlx, game->player.link_up);
|
||||||
|
mlx_destroy_image(game->mlx, game->player.link_down);
|
||||||
|
mlx_destroy_image(game->mlx, game->player.link_left);
|
||||||
|
mlx_destroy_image(game->mlx, game->player.link_right);
|
||||||
|
}
|
||||||
|
|
||||||
|
void free_textures(t_game *game)
|
||||||
|
{
|
||||||
|
mlx_destroy_image(game->mlx, game->textures.coin);
|
||||||
|
mlx_destroy_image(game->mlx, game->textures.door);
|
||||||
|
mlx_destroy_image(game->mlx, game->textures.ground);
|
||||||
|
mlx_destroy_image(game->mlx, game->textures.wall);
|
||||||
|
}
|
||||||
67
src/ft_itoa.c
Executable file
67
src/ft_itoa.c
Executable file
@@ -0,0 +1,67 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_itoa.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/16 09:27:02 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/01/15 17:46:16 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
static int ft_get_size(int n)
|
||||||
|
{
|
||||||
|
int size;
|
||||||
|
|
||||||
|
size = 0;
|
||||||
|
if (n <= 0)
|
||||||
|
size++;
|
||||||
|
while (n != 0)
|
||||||
|
{
|
||||||
|
n = n / 10;
|
||||||
|
size++;
|
||||||
|
}
|
||||||
|
return (size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ft_fill_new(int size, int off, int n, char *new)
|
||||||
|
{
|
||||||
|
while (size > off)
|
||||||
|
{
|
||||||
|
new[size - 1] = n % 10 + '0';
|
||||||
|
n = n / 10;
|
||||||
|
size--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char *ft_itoa(int n)
|
||||||
|
{
|
||||||
|
int off;
|
||||||
|
int size;
|
||||||
|
char *new;
|
||||||
|
|
||||||
|
off = 0;
|
||||||
|
size = ft_get_size(n);
|
||||||
|
new = (char *)malloc(sizeof(char) * (size + 1));
|
||||||
|
if (new == NULL)
|
||||||
|
return (NULL);
|
||||||
|
if (n == -2147483648)
|
||||||
|
{
|
||||||
|
new[0] = '-';
|
||||||
|
new[1] = '2';
|
||||||
|
n = 147483648;
|
||||||
|
off = 2;
|
||||||
|
}
|
||||||
|
if (n < 0)
|
||||||
|
{
|
||||||
|
new[0] = '-';
|
||||||
|
off = 1;
|
||||||
|
n = -n;
|
||||||
|
}
|
||||||
|
ft_fill_new(size, off, n, new);
|
||||||
|
new[size] = '\0';
|
||||||
|
return (new);
|
||||||
|
}
|
||||||
106
src/map.c
Executable file
106
src/map.c
Executable file
@@ -0,0 +1,106 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* map.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/16 09:27:36 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/01/15 17:46:18 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
void print_map(char *line, t_game *game, int index)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (line[i])
|
||||||
|
{
|
||||||
|
if (line[i] == '1')
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.wall, i * 32, (index * 32));
|
||||||
|
else if (line[i] == '0')
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.ground, i * 32, (index * 32));
|
||||||
|
else if (line[i] == 'C')
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.coin, i * 32, (index * 32));
|
||||||
|
else if (line[i] == 'E')
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->textures.door, i * 32, (index * 32));
|
||||||
|
else if (line[i] == 'P')
|
||||||
|
put_player(game, i, index);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void add_graphics(t_game *game)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
game->score = 0;
|
||||||
|
while (game->map[i] != NULL)
|
||||||
|
{
|
||||||
|
print_map(game->map[i], game, i);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void fill_map(t_game *game, int lines, char *map)
|
||||||
|
{
|
||||||
|
int file;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
file = open(map, O_RDWR);
|
||||||
|
game->moves = 0;
|
||||||
|
game->player_position = 0;
|
||||||
|
game->map = malloc(sizeof(char *) * (lines + 1));
|
||||||
|
game->map[0] = get_next_line(file);
|
||||||
|
while (i < lines)
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
game->map[i] = get_next_line(file);
|
||||||
|
}
|
||||||
|
if (check_map(map, game) == 1)
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
if (valid_path(game) == 1)
|
||||||
|
{
|
||||||
|
free_map(game);
|
||||||
|
write(1, "Error\nNo valid path\n", 20);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
close(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
int save_map(char *map, t_game *game)
|
||||||
|
{
|
||||||
|
int file;
|
||||||
|
int linecount;
|
||||||
|
char *line;
|
||||||
|
|
||||||
|
linecount = 0;
|
||||||
|
file = open(map, O_RDWR);
|
||||||
|
if (file == -1)
|
||||||
|
{
|
||||||
|
write(1, "Error\nMap does not exist\n", 25);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
line = get_next_line(file);
|
||||||
|
if (line == NULL)
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
while (line)
|
||||||
|
{
|
||||||
|
free(line);
|
||||||
|
line = get_next_line(file);
|
||||||
|
linecount++;
|
||||||
|
}
|
||||||
|
close(file);
|
||||||
|
fill_map(game, linecount, map);
|
||||||
|
free(line);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
51
src/open_images.c
Executable file
51
src/open_images.c
Executable file
@@ -0,0 +1,51 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* open_images.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/16 09:28:10 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/01/15 17:46:20 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
static int open_ground_coins_door(t_game *game)
|
||||||
|
{
|
||||||
|
game->textures.ground = mlx_xpm_file_to_image(game->mlx,
|
||||||
|
"assets/dirt.xpm", &game->width, &game->height);
|
||||||
|
if (game->textures.ground == NULL)
|
||||||
|
return (1);
|
||||||
|
game->textures.coin = mlx_xpm_file_to_image(game->mlx,
|
||||||
|
"assets/coin.xpm", &game->width, &game->height);
|
||||||
|
if (game->textures.coin == NULL)
|
||||||
|
return (1);
|
||||||
|
game->textures.door = mlx_xpm_file_to_image(game->mlx,
|
||||||
|
"assets/door.xpm", &game->width, &game->height);
|
||||||
|
if (game->textures.door == NULL)
|
||||||
|
return (1);
|
||||||
|
game->textures.wall = mlx_xpm_file_to_image(game->mlx,
|
||||||
|
"assets/wall.xpm", &game->width, &game->height);
|
||||||
|
if (game->textures.wall == NULL)
|
||||||
|
return (1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void open_images(t_game *game)
|
||||||
|
{
|
||||||
|
game->height = HEIGHT;
|
||||||
|
game->width = WIDTH;
|
||||||
|
game->current_frame = 0;
|
||||||
|
game->player.link_right = mlx_xpm_file_to_image(game->mlx,
|
||||||
|
"assets/link-right.xpm", &game->width, &game->height);
|
||||||
|
game->player.link_left = mlx_xpm_file_to_image(game->mlx,
|
||||||
|
"assets/link-left.xpm", &game->width, &game->height);
|
||||||
|
game->player.link_up = mlx_xpm_file_to_image(game->mlx,
|
||||||
|
"assets/link-up.xpm", &game->width, &game->height);
|
||||||
|
game->player.link_down = mlx_xpm_file_to_image(game->mlx,
|
||||||
|
"assets/link-down.xpm", &game->width, &game->height);
|
||||||
|
if (open_ground_coins_door(game) == 1)
|
||||||
|
write(1, "Failed to open the image\n", 25);
|
||||||
|
}
|
||||||
54
src/put_player.c
Executable file
54
src/put_player.c
Executable file
@@ -0,0 +1,54 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* put_player.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/16 09:35:54 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/01/15 17:46:22 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
void put_player(t_game *game, int w, int h)
|
||||||
|
{
|
||||||
|
if (game->player_position == RIGHT)
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->player.link_right, w * 32, h * 32);
|
||||||
|
else if (game->player_position == LEFT)
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->player.link_left, w * 32, h * 32);
|
||||||
|
else if (game->player_position == UP)
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->player.link_down, w * 32, h * 32);
|
||||||
|
else if (game->player_position == DOWN)
|
||||||
|
mlx_put_image_to_window(game->mlx, game->window, \
|
||||||
|
game->player.link_up, w * 32, h * 32);
|
||||||
|
game->x = w;
|
||||||
|
game->y = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
void check_playable_row(t_game *game, int *c, int *p, int *e)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (game->map[i + 1])
|
||||||
|
{
|
||||||
|
j = 0;
|
||||||
|
while (game->map[i][j + 1])
|
||||||
|
{
|
||||||
|
if (game->map[i][j] == 'C')
|
||||||
|
*c = 1;
|
||||||
|
if (game->map[i][j] == 'P')
|
||||||
|
*p = 1;
|
||||||
|
if (game->map[i][j] == 'E')
|
||||||
|
*e = 1;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
95
src/so_long.c
Executable file
95
src/so_long.c
Executable file
@@ -0,0 +1,95 @@
|
|||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* so_long.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: aortigos <aortigos@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/12/15 21:30:42 by aortigos #+# #+# */
|
||||||
|
/* Updated: 2025/02/15 09:54:17 by aortigos ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include "../so_long.h"
|
||||||
|
|
||||||
|
int on_destroy(t_game *game)
|
||||||
|
{
|
||||||
|
free_map(game);
|
||||||
|
free_player(game);
|
||||||
|
free_textures(game);
|
||||||
|
mlx_destroy_window(game->mlx, game->window);
|
||||||
|
mlx_destroy_display(game->mlx);
|
||||||
|
free(game->mlx);
|
||||||
|
exit(0);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_moves(t_game *game)
|
||||||
|
{
|
||||||
|
char *moves;
|
||||||
|
|
||||||
|
moves = ft_itoa(game->moves);
|
||||||
|
write(1, moves, ft_strlen(moves));
|
||||||
|
free(moves);
|
||||||
|
write(1, "\n", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void update_player_position(t_game *game, int key)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
i = game->x;
|
||||||
|
j = game->y;
|
||||||
|
if (key == 115 && game->map[j + 1][i] != '1')
|
||||||
|
{
|
||||||
|
move_top(game, i, j);
|
||||||
|
print_moves(game);
|
||||||
|
}
|
||||||
|
else if (key == 119 && game->map[j - 1][i] != '1')
|
||||||
|
{
|
||||||
|
move_down(game, i, j);
|
||||||
|
print_moves(game);
|
||||||
|
}
|
||||||
|
else if (key == 97 && game->map[j][i - 1] != '1')
|
||||||
|
{
|
||||||
|
move_left(game, i, j);
|
||||||
|
print_moves(game);
|
||||||
|
}
|
||||||
|
else if (key == 100 && game->map[j][i + 1] != '1')
|
||||||
|
{
|
||||||
|
move_right(game, i, j);
|
||||||
|
print_moves(game);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int key_hook(int keycode, t_game *game)
|
||||||
|
{
|
||||||
|
if (keycode == 119 || keycode == 115 || keycode == 100 || keycode == 97)
|
||||||
|
update_player_position(game, keycode);
|
||||||
|
else if (keycode == 65307)
|
||||||
|
on_destroy(game);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
t_game game;
|
||||||
|
|
||||||
|
if (argc == 2)
|
||||||
|
{
|
||||||
|
if (save_map(argv[1], &game) == 1)
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
game.mlx = mlx_init();
|
||||||
|
game.window = mlx_new_window(game.mlx, (game.map_cols -1) * 32,
|
||||||
|
(game.map_rows + 1) * 32, "so_long");
|
||||||
|
open_images(&game);
|
||||||
|
add_graphics(&game);
|
||||||
|
mlx_key_hook(game.window, key_hook, &game);
|
||||||
|
mlx_hook(game.window, 17, 0, on_destroy, &game);
|
||||||
|
mlx_loop(game.mlx);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
write(1, "You can only give 1 argument\n", 29);
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user