author | peter_k
<peter_k> 2006-02-13 13:19:31 UTC |
committer | peter_k
<peter_k> 2006-02-13 13:19:31 UTC |
parent | e2e0038fa81fe5c09d180d081fffc96dedb569b0 |
poprecog/imfromim/Makefile.win | +33 | -0 |
poprecog/imfromim/imfromim.cpp | +57 | -0 |
diff --git a/poprecog/imfromim/Makefile.win b/poprecog/imfromim/Makefile.win new file mode 100644 index 0000000..344d4eb --- /dev/null +++ b/poprecog/imfromim/Makefile.win @@ -0,0 +1,33 @@ +# Project: imfromim +# Makefile created by Dev-C++ 4.9.9.2 + +CPP = g++.exe +CC = gcc.exe +WINDRES = windres.exe +RES = imfromim_private.res +OBJ = imfromim.o $(RES) +LINKOBJ = imfromim.o $(RES) +LIBS = -L"d:/devcpp/lib" -lalleg_s -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldinput -lddraw -ldxguid -lwinmm -ldsound +INCS = -I"d:/devcpp/include" +CXXINCS = -I"d:/devcpp/lib/gcc/mingw32/3.4.2/include" -I"d:/devcpp/include/c++/3.4.2/backward" -I"d:/devcpp/include/c++/3.4.2/mingw32" -I"d:/devcpp/include/c++/3.4.2" -I"d:/devcpp/include" +BIN = imfromim.exe +CXXFLAGS = $(CXXINCS) -DALLEGRO_STATICLINK +CFLAGS = $(INCS) -DALLEGRO_STATICLINK +RM = rm -f + +.PHONY: all all-before all-after clean clean-custom + +all: all-before imfromim.exe all-after + + +clean: clean-custom + ${RM} $(OBJ) $(BIN) + +$(BIN): $(OBJ) + $(CPP) $(LINKOBJ) -o "imfromim.exe" $(LIBS) + +imfromim.o: imfromim.cpp + $(CPP) -c imfromim.cpp -o imfromim.o $(CXXFLAGS) + +imfromim_private.res: imfromim_private.rc + $(WINDRES) -i imfromim_private.rc --input-format=rc -o imfromim_private.res -O coff diff --git a/poprecog/imfromim/imfromim.cpp b/poprecog/imfromim/imfromim.cpp new file mode 100644 index 0000000..5b78f4e --- /dev/null +++ b/poprecog/imfromim/imfromim.cpp @@ -0,0 +1,57 @@ +#include<allegro.h> +#include<stdio.h> +#include<vector.h> + +#define IMFROMIM_VISUAL_MODE + +int match(char *pat, char *str) + + +class imFromIm { +public: + int setImageSize(int newWidth, int newHeight); + + void loadDir(char dirName[500], int openSubDirs); + int width; + int height; + vector<BITMAP*> images; +}; + +int imFromIm::setImageSize(int newWidth, int newHeight) { + if ((newWidth>0)&&(newHeight>0)) { + width = newWidth; + height = newHeight; + return 1; + } else + return 0; +} + +void imFromIm::loadDir(char dirName[500], int openSubDirs); + +int main() { + imFromIm imFromIm; + + #ifdef IMFROMIM_VISUAL_MODE + allegro_init(); + set_color_depth(desktop_color_depth()?desktop_color_depth():32); + if (set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 1280, 800, 0, 0)) { + allegro_message(allegro_error); + exit(-1); + } + install_timer(); + install_keyboard(); + install_mouse(); + #endif + +// printf("%d\n", imFromIm.images.size()); +// system("pause"); + + #ifdef IMFROMIM_VISUAL_MODE + textprintf_ex(screen, font, 0, 0, makecol(255,0,0), makecol(0,0,0), "1/5 Loading bitmaps... %5d now...", 123); + while (!key[KEY_ESC]); + clear_keybuf(); + #endif + + return 0; +} +END_OF_MAIN()