# Edgar Reynaldo

Members

22

111 Neutral

• Rank
Member
1. ## Programming and depression research

I appreciate all your criticisms, that will help me in my evaluation of the testing methods validity! :D   As to concerns I am only applying the test to programmers thats not true, at least not in intent, I did ask these questions on DeviantArt too, but only got one response, and she was a programmer!   So yeah, I know there are problems, this is my first psych experiment ever, so a little slack might be nice.
2. ## Programming and depression research

@ranakor - scores on individual questions are not necessary to report, but thank you for helping my researc   The idea is to gather as much data from programmers and non-programmers as possible, and then to see if there are any correlations that would warrant further research. This is not the only forum I am seeking data from. Very good point though.   @aurioch - thanks!   @phantom - I understand the test may not be perfect, but hopefully it does serve as some indicator of depression. Many of the questions relate directly to symptoms of depression.

4. ## Collision Response

To determine which side a collision occurred on, you need to calculate intercept times. Find the relative velocity of the 'leader' to the 'collider' and then determine when the leading edge of the leader overlaps with the front edge of the collider. If at that time, they overlap in the other dimension, then you have a collsion time. Repeat for the other dimension. Find the earliest collision - that will tell you which side they collided on. I only know how to do this for Axis Aligned Bounding Boxes though - wouldn't know how to do this pixel perfectly. The only way you can know which side collided first is if one relative velocity component is zero, or if you calculate intercept times. Simply finding overlap of a future position will never tell you which side collided first, only that they overlap.
5. ## Collision hiccups

If your pixel perfect collision library is working as it should be, then it is a problem with the way you 'undo' the collisions. Check the future positions of your objects, not your current position after you move them but before you detect a collision. Ie.. Check for a collision at the end of the update before you move your object. 'Fix' the collision by reducing the velocity of the object until there would be no collision, and continue to check that object with its now reduced velocity against the rest of your objects.
6. ## SantaHack 2011

Sorry for the double post, but there are only 7 hours and 10 minutes remaining to register for SantaHack if you want to make and receive a game for Christmas. Like I said before, the use of Allegro is NOT required, only a free account at allegro.cc. Wishlist voting begins in 7 hours! Sign up now!

8. ## C++ friend

[code] class Cat { friend void PrintAge(Cat& cat) {cout << cat.age << endl;} private: int age; }; [/code] Someone correct me if I'm wrong, but friend seems redundant and useless for a member function. Also, the method is not static because it has not been declared as such. You still need a Cat object to call it from, even though it works on a different Cat object.
9. ## makefile always builds everything - why?

SOLVED : See solution below I can't get the makefile for my software library Eagle to only build the files that are out of date. Can anyone see why this makefile always builds everything? Does it have anything to do with implicit rules? It should only rebuild the .d files when the source files or their dependencies are newer than they are. It should only rebuild the object files when the .d files or their .c or .cpp file dependencies are newer than they are. It should only rebuild the libraries when the object files are newer than they are. However, it rebuilds all the .d files, all the .o files, and the library every time I run make and I don't understand why. Any makefile gurus out there who can help me? If you want to try building the library yourself, you can download the latest SVN code from sourceforge : [i]svn checkout "http://svn.code.sf.net/p/eaglegui/code/trunk eaglegui-code"[/i] Here's the current makefile : [code] #/* # * # * _______ ___ ____ __ _______ # * /\ ____\ /| \ / __\ /\ \ /\ ____\ # * \ \ \___/_ || _ \ | /__/____\ \ \ \ \ \___/_ # * \ \ ____\ || |_\ \ |\ \ /\_ _\\ \ \ \ \ ____\ # * \ \ \___/_ || ___ \ \ \ \\//\ \/ \ \ \____\ \ \___/_ # * \ \______\||_|__/\_\ \ \ \_\/ | \ \_____\\ \______\ # * \/______/|/_/ \/_/ \_\_____/ \/_____/ \/______/ # * # * # * EAGLE # * Edgar's Allegro Gui Library and Extensions # * # * Copyright 2009-2011 by Edgar Reynaldo # * # * See EagleLicense.txt for allowed uses of this library. # * # */ # Must include makefile.version before makefile.platform! include makefile.version # Platform specific shiznit goes here # makefile.platform is generated by fix.* include makefile.platform ifndef STATICLINK DYNAMICLINK = 1 endif ifndef DEBUGMODE ifndef PROFILEMODE RELEASEMODE = 1 endif else PROFILEMODE= RELEASEMODE= endif ifndef PROFILEMODE ifndef DEBUGMODE RELEASEMODE = 1 endif else DEBUGMODE= RELEASEMODE= endif ifndef BUILDDIR BUILDDIR = testbuild endif WFLAGS = -Wall -Wshadow CC = g++ ifeq (WINDOWS,$(PLATFORM)) LIBALLEGROPROFILE := -lalleg44-profile.dll LIBALLEGRODEBUG := -lalleg44-debug.dll LIBALLEGRORELEASE := -lalleg44.dll endif ifeq (NIX,$(PLATFORM)) LIBALLEGROPROFILE := -lalleg-profile LIBALLEGRODEBUG := -lalleg-debug LIBALLEGRORELEASE := -lalleg endif ifdef STATICLINK ifdef PROFILEMODE OBJDIR := $(BUILDDIR)/obj/Static/Profiling LIBSUFFIX := _ps CFLAGS := -pg LFLAGS := -pg$(GMON) MODE := Static Profiling mode endif ifdef DEBUGMODE OBJDIR := $(BUILDDIR)/obj/Static/Debug LIBSUFFIX := _ds CFLAGS := -g -DDEBUGMODE -DEAGLE_ASSERT_EXCEPTION LFLAGS := MODE := Static Debugging mode endif ifdef RELEASEMODE OBJDIR :=$(BUILDDIR)/obj/Static/Release LIBSUFFIX := _rs CFLAGS := -O2 LFLAGS := MODE := Static Release mode endif CFLAGS := $(CFLAGS) -c -DALLEGRO_STATICLINK endif ifdef DYNAMICLINK ifdef PROFILEMODE OBJDIR :=$(BUILDDIR)/obj/Dynamic/Profiling LIBSUFFIX := _p CFLAGS := -pg LFLAGS := -pg $(GMON)$(LIBALLEGROPROFILE) MODE := Dynamic Profiling mode endif ifdef DEBUGMODE OBJDIR := $(BUILDDIR)/obj/Dynamic/Debug LIBSUFFIX := _d CFLAGS := -g -DDEBUGMODE -DEAGLE_ASSERT_EXCEPTION LFLAGS :=$(LIBALLEGRODEBUG) MODE := Dynamic Debugging mode endif ifdef RELEASEMODE OBJDIR := $(BUILDDIR)/obj/Dynamic/Release LIBSUFFIX := _r CFLAGS := -O2 LFLAGS :=$(LIBALLEGRORELEASE) -s MODE := Dynamic Release mode endif CFLAGS := $(CFLAGS) -c CFLAGS :=$(CFLAGS) $(EXTRACFLAGS) endif COMPILEFLAGS =$(WFLAGS) $(CFLAGS) LINKFLAGS =$(LFLAGS) CPPSRCS = $(notdir$(wildcard src/*.cpp)) CSRCS = $(notdir$(wildcard src/*.c)) CPPGUISRCS = $(notdir$(wildcard src/GuiCode/*.cpp)) CGUISRCS = $(notdir$(wildcard src/GuiCode/*.c)) CPPOBJS = $(addsuffix .o ,$(basename $(CPPSRCS))) COBJS =$(addsuffix .o , $(basename$(CSRCS))) CPPGUIOBJS = $(addsuffix .o ,$(basename $(CPPGUISRCS))) CGUIOBJS =$(addsuffix .o , $(basename$(CGUISRCS))) CPPOBJS := $(addprefix$(OBJDIR)/,$(CPPOBJS)) COBJS :=$(addprefix $(OBJDIR)/,$(COBJS)) CPPGUIOBJS := $(addprefix$(OBJDIR)/,$(CPPGUIOBJS)) CGUIOBJS :=$(addprefix $(OBJDIR)/,$(CGUIOBJS)) CPPSRCS := $(addprefix src/,$(CPPSRCS)) CSRCS := $(addprefix src/,$(CSRCS)) CPPGUISRCS := $(addprefix src/GuiCode/,$(CPPGUISRCS)) CGUISRCS := $(addprefix src/GuiCode/,$(CGUISRCS)) ALLCSRCS := $(CSRCS)$(CGUISRCS) ALLCPPSRCS := $(CPPSRCS)$(CPPGUISRCS) ALLSRCS := $(ALLCSRCS)$(ALLCPPSRCS) ALLCOBJS := $(COBJS)$(CGUIOBJS) ALLCPPOBJS := $(CPPOBJS)$(CPPGUIOBJS) ALLOBJS := $(ALLCOBJS)$(ALLCPPOBJS) $(warning Including *.d files...) include$(ALLOBJS:%.c:$(OBJDIR)$(SLASH)%.d) include $(ALLOBJS:%.cpp:$(OBJDIR)$(SLASH)%.d) #CHDRS =$(notdir $(wildcard include/*.h)) #CPPHDRS =$(notdir $(wildcard include/*.hpp)) #CGUIHDRS =$(notdir $(wildcard include/GuiCode/*.h)) #CPPGUIHDRS =$(notdir $(wildcard include/GuiCode/*.hpp)) EAGLEHDR = include/Eagle.hpp CHDRS =$(wildcard include/Eagle/*.h) CPPHDRS = $(wildcard include/Eagle/*.hpp) CGUIHDRS =$(wildcard include/Eagle/GuiCode/*.h) CPPGUIHDRS = $(wildcard include/Eagle/GuiCode/*.hpp) HDRS :=$(CHDRS) $(CPPHDRS) GUIHDRS :=$(CGUIHDRS) $(CPPGUIHDRS) ALLHDRS :=$(EAGLEHDR) $(HDRS)$(GUIHDRS) LIBDIR := $(BUILDDIR)$(SLASH)lib LIBNAME = eagle # eagle_* FULLLIBNAME := $(LIBNAME)$(LIBSUFFIX) # WIN = eagle_*.dll NIX = eagle_*.so.1 DLLNAME := $(FULLLIBNAME)$(SHAREDLIBEXT) #soname = dll , -o = .a #static libs on *NIX are .a files ifdef STATICLINK # libeagle_*.a ARCHIVENAME := lib$(FULLLIBNAME).a else # libeagle_*.so on unix , libeagle_*.dll.a on MinGW ifeq (WINDOWS,$(PLATFORM)) # WIN = libeagle_*.dll.a ARCHIVENAME := lib$(DLLNAME).a endif ifeq (NIX,$(PLATFORM)) # NIX libeagle_*.so ARCHIVENAME := lib$(FULLLIBNAME).so SONAME =$(ARCHIVENAME).$(MAJORVERSION).$(MINORVERSION) DLLNAME := lib$(DLLNAME).$(FULLVERSION) endif endif BINDIR = $(INSTALLDIR)$(SLASH)bin OUTPUTLIB := $(LIBDIR)$(SLASH)$(ARCHIVENAME) OUTPUTDLL :=$(LIBDIR)$(SLASH)$(DLLNAME) #fake : ifeq (WINDOWS,$(PLATFORM)) #$(ECHO) Platform is WINDOWS! OUTPUTDEF = $(LIBDIR)$(SLASH)$(DLLNAME).def CREATEDEF = -Wl,--output-def=$(OUTPUTDEF) CREATEIMPLIB = -Wl,--out-implib=$(OUTPUTLIB) MAKEDLL = -Wl,--dll endif ifeq (NIX,$(PLATFORM)) # $(ECHO) Platform is NIX! CREATEIMPLIB = -Wl,-soname,$(SONAME) endif # Targets begin here #$(OUTPUTLIB)$(OUTPUTDLL) $(OUTPUTDEF) :$(ALLOBJS) # $(ECHO) Building lib$(OUTPUTLIB) in $(MODE) #ifdef STATICLINK #$(TEST) ar.exe -rcs $(OUTPUTLIB)$(ALLOBJS) #endif #ifdef DYNAMICLINK # mingw32-g++.exe -shared -Wl,--output-def=build\lib\libeagle_r.dll.def -Wl,--out-implib=build\lib\libeagle_r.dll.a -Wl,--dll # $(TEST)$(CC) -shared -Wl,--output-def=$(OUTPUTDEF) -Wl,--out-implib=$(OUTPUTLIB) -Wl,--dll $(ALLOBJS) -o$(OUTPUTDLL) $(LINKFLAGS) #endif ifdef STATICLINK$(OUTPUTLIB) : $(ALLOBJS)$(ECHO) Building lib $(OUTPUTLIB) in$(MODE) $(TEST) ar.exe -rcs$(OUTPUTLIB) $(ALLOBJS) endif ifdef DYNAMICLINK$(OUTPUTLIB) $(OUTPUTDLL)$(OUTPUTDEF) : $(ALLOBJS) # Windows # mingw32-g++.exe -shared -Wl,--output-def=build\lib\libeagle_r.dll.def -Wl,--out-implib=build\lib\libeagle_r.dll.a -Wl,--dll # *NIX # g++ -shared -Wl,-soname,libprint.so.1 -o libprint.so.1.0$(OBJS) $(ECHO) Building lib$(OUTPUTLIB) in $(MODE)$(TEST) $(CC) -shared$(CREATEDEF) $(CREATEIMPLIB)$(MAKEDLL) $(ALLOBJS) -o$(OUTPUTDLL) $(LINKFLAGS) endif$(FIXDFILES) : Fixdfiles.cpp $(CC) -Wall -O2 -o$(FIXDFILES) Fixdfiles.cpp ifeq (NIX,$(PLATFORM)) chmod +x$(FIXDFILES) endif .PRECIOUS : $(OBJDIR)/%.d$(OBJDIR)/%.d : src/%.c makebuilddirs $(FIXDFILES)$(TEST) $(CC) -MM$< -Iinclude > $@ #$(FIXDFILES) $(OBJDIR)$(@F) > $@$(FIXDFILES) $(OBJDIR)$(@F) $(OBJDIR)/%.d : src/%.cpp makebuilddirs$(FIXDFILES) $(TEST)$(CC) -MM $< -Iinclude >$@ # $(FIXDFILES)$(OBJDIR) $(@F) >$@ $(FIXDFILES)$(OBJDIR) $(@F)$(OBJDIR)/%.d : src/GuiCode/%.c makebuilddirs $(FIXDFILES)$(TEST) $(CC) -MM$< -Iinclude > $@ #$(FIXDFILES) $(OBJDIR)$(@F) > $@$(FIXDFILES) $(OBJDIR)$(@F) $(OBJDIR)/%.d : src/GuiCode/%.cpp makebuilddirs$(FIXDFILES) $(TEST)$(CC) -MM $< -Iinclude >$@ # $(FIXDFILES)$(OBJDIR) $(@F) >$@ $(FIXDFILES)$(OBJDIR) $(@F) #$(warning Including d files!) #include $(COBJS:%.o:%.d) #include$(CPPOBJS:%.o:%.d) #include $(CGUIOBJS:%.o:%.d) #include$(CPPGUIOBJS:%.o:%.d) $(OBJDIR)/%.o : src/%.c$(OBJDIR)/%.d $(TEST)$(CC) $(COMPILEFLAGS) -Iinclude -o$@ $<$(OBJDIR)/%.o : src/%.cpp $(OBJDIR)/%.d$(TEST) $(CC)$(COMPILEFLAGS) -Iinclude -o $<$(OBJDIR)/%.o : src/GuiCode/%.c $(OBJDIR)/%.d$(TEST) $(CC)$(COMPILEFLAGS) -Iinclude -o $@$< $(OBJDIR)/%.o : src/GuiCode/%.cpp$(OBJDIR)/%.d $(TEST)$(CC) $(COMPILEFLAGS) -Iinclude -o$@ $< .PHONY : makefile.platform makefile.platform : ifeq (,$(findstring makefile.platform,$(wildcard makefile.platform)))$(error Please run fix.bat for Windows or ./fix.sh for *nix to generate makefile.platform) endif makebuilddirs : -$(MKDIR)$(LIBDIR) -$(MKDIR)$(subst /,$(SLASH),$(OBJDIR)) makeinstalldirs : -$(MKDIR)$(BINDIR) -$(MKDIR)$(INSTALLDIR)$(SLASH)lib # -$(MKDIR) $(INSTALLDIR)$(SLASH)include # -$(MKDIR)$(INSTALLDIR)$(SLASH)include$(SLASH)Eagle # This should take care of creating include and Eagle as well -$(MKDIR)$(INSTALLDIR)$(SLASH)include$(SLASH)Eagle$(SLASH)GuiCode all :$(MAKE) DEBUGMODE=1 $(MAKE) PROFILEMODE=1$(MAKE) $(MAKE) DEBUGMODE=1 STATICLINK=1$(MAKE) PROFILEMODE=1 STATICLINK=1 $(MAKE) STATICLINK=1 install :$(OUTPUTLIB) $(OUTPUTDLL)$(OUTPUTDEF) makeinstalldirs installheaders ifeq (WINDOWS,$(PLATFORM))$(COPY) $(OUTPUTDLL)$(INSTALLDIR)$(SLASH)bin$(COPY) $(OUTPUTLIB)$(INSTALLDIR)$(SLASH)lib endif ifeq (NIX,$(PLATFORM)) $(COPY)$(OUTPUTDLL) $(INSTALLDIR)$(SLASH)lib ln -sf $(INSTALLDIR)$(SLASH)lib$(SLASH)$(DLLNAME) $(INSTALLDIR)$(SLASH)lib$(SLASH)$(SONAME) ln -sf $(INSTALLDIR)$(SLASH)lib$(SLASH)$(SONAME) $(INSTALLDIR)$(SLASH)lib$(SLASH)$(ARCHIVEAME) endif installheaders : $(ALLHDRS)$(COPY) include$(SLASH)Eagle$(SLASH)*.* $(INSTALLDIR)$(SLASH)include$(SLASH)Eagle$(COPY) include$(SLASH)Eagle$(SLASH)GuiCode$(SLASH)*.*$(INSTALLDIR)$(SLASH)include$(SLASH)Eagle$(SLASH)GuiCode$(COPY) include$(SLASH)Eagle.hpp$(INSTALLDIR)$(SLASH)include uninstall : -$(REMOVE) $(INSTALLDIR)$(SLASH)bin$(SLASH)$(DLLNAME) -$(REMOVE)$(INSTALLDIR)$(SLASH)lib$(SLASH)$(ARCHIVENAME) -$(REMDIR) $(INSTALLDIR)$(SLASH)include$(SLASH)Eagle -$(REMOVE) $(INSTALLDIR)$(SLASH)include$(SLASH)Eagle.hpp installall : all$(MAKE) DEBUGMODE=1 install INSTALLDIR=$(INSTALLDIR)$(MAKE) PROFILEMODE=1 install INSTALLDIR=$(INSTALLDIR)$(MAKE) install INSTALLDIR=$(INSTALLDIR)$(MAKE) DEBUGMODE=1 STATICLINK=1 install INSTALLDIR=$(INSTALLDIR)$(MAKE) PROFILEMODE=1 STATICLINK=1 install INSTALLDIR=$(INSTALLDIR)$(MAKE) STATICLINK=1 install INSTALLDIR=$(INSTALLDIR) uninstallall :$(MAKE) DEBUGMODE=1 uninstall INSTALLDIR=$(INSTALLDIR)$(MAKE) PROFILEMODE=1 uninstall INSTALLDIR=$(INSTALLDIR)$(MAKE) uninstall INSTALLDIR=$(INSTALLDIR)$(MAKE) DEBUGMODE=1 STATICLINK=1 uninstall INSTALLDIR=$(INSTALLDIR)$(MAKE) PROFILEMODE=1 STATICLINK=1 uninstall INSTALLDIR=$(INSTALLDIR)$(MAKE) STATICLINK=1 uninstall INSTALLDIR=$(INSTALLDIR) .PHONY : clean cleanobj cleanlib clean : cleanobj cleanlib cleanobj :$(REMOVE) $(subst /,$(SLASH),$(OBJDIR))$(SLASH)*.* cleanlib : $(REMOVE)$(subst /,$(SLASH),$(OUTPUTLIB)) cleanall : $(MAKE) DEBUGMODE=1 clean$(MAKE) PROFILEMODE=1 clean $(MAKE) clean$(MAKE) DEBUGMODE=1 STATICLINK=1 clean $(MAKE) PROFILEMODE=1 STATICLINK=1 clean$(MAKE) STATICLINK=1 clean help : $(ECHO) Available options : (Default build is dynamic release mode)$(ECHO) DEBUGMODE=1 $(ECHO) PROFILEMODE=1$(ECHO) STATICLINK=1 $(ECHO) on$(ECHO) Available targets : (Default target is dynamic release library) $(ECHO) all$(ECHO) install $(ECHO) uninstall$(ECHO) installall $(ECHO) uninstallall$(ECHO) clean $(ECHO) cleanall$(ECHO) on $(ECHO) Default installation directory is$MINGDIR$for Windows and /usr for *nix$(ECHO) Set using INSTALLDIR=install/directory/path [/code] The rules for building the *.d and *.o and the *.dll / *.so / *.a files are here : [code] # Targets begin here #$(OUTPUTLIB)$(OUTPUTDLL) $(OUTPUTDEF) :$(ALLOBJS) # $(ECHO) Building lib$(OUTPUTLIB) in $(MODE) #ifdef STATICLINK #$(TEST) ar.exe -rcs $(OUTPUTLIB)$(ALLOBJS) #endif #ifdef DYNAMICLINK # mingw32-g++.exe -shared -Wl,--output-def=build\lib\libeagle_r.dll.def -Wl,--out-implib=build\lib\libeagle_r.dll.a -Wl,--dll # $(TEST)$(CC) -shared -Wl,--output-def=$(OUTPUTDEF) -Wl,--out-implib=$(OUTPUTLIB) -Wl,--dll $(ALLOBJS) -o$(OUTPUTDLL) $(LINKFLAGS) #endif ifdef STATICLINK$(OUTPUTLIB) : $(ALLOBJS)$(ECHO) Building lib $(OUTPUTLIB) in$(MODE) $(TEST) ar.exe -rcs$(OUTPUTLIB) $(ALLOBJS) endif ifdef DYNAMICLINK$(OUTPUTLIB) $(OUTPUTDLL)$(OUTPUTDEF) : $(ALLOBJS) # Windows # mingw32-g++.exe -shared -Wl,--output-def=build\lib\libeagle_r.dll.def -Wl,--out-implib=build\lib\libeagle_r.dll.a -Wl,--dll # *NIX # g++ -shared -Wl,-soname,libprint.so.1 -o libprint.so.1.0$(OBJS) $(ECHO) Building lib$(OUTPUTLIB) in $(MODE)$(TEST) $(CC) -shared$(CREATEDEF) $(CREATEIMPLIB)$(MAKEDLL) $(ALLOBJS) -o$(OUTPUTDLL) $(LINKFLAGS) endif$(FIXDFILES) : Fixdfiles.cpp $(CC) -Wall -O2 -o$(FIXDFILES) Fixdfiles.cpp ifeq (NIX,$(PLATFORM)) chmod +x$(FIXDFILES) endif .PRECIOUS : $(OBJDIR)/%.d$(OBJDIR)/%.d : src/%.c makebuilddirs $(FIXDFILES)$(TEST) $(CC) -MM$< -Iinclude > $@ #$(FIXDFILES) $(OBJDIR)$(@F) > $@$(FIXDFILES) $(OBJDIR)$(@F) $(OBJDIR)/%.d : src/%.cpp makebuilddirs$(FIXDFILES) $(TEST)$(CC) -MM $< -Iinclude >$@ # $(FIXDFILES)$(OBJDIR) $(@F) >$@ $(FIXDFILES)$(OBJDIR) $(@F)$(OBJDIR)/%.d : src/GuiCode/%.c makebuilddirs $(FIXDFILES)$(TEST) $(CC) -MM$< -Iinclude > $@ #$(FIXDFILES) $(OBJDIR)$(@F) > $@$(FIXDFILES) $(OBJDIR)$(@F) $(OBJDIR)/%.d : src/GuiCode/%.cpp makebuilddirs$(FIXDFILES) $(TEST)$(CC) -MM $< -Iinclude >$@ # $(FIXDFILES)$(OBJDIR) $(@F) >$@ $(FIXDFILES)$(OBJDIR) $(@F) #$(warning Including d files!) #include $(COBJS:%.o:%.d) #include$(CPPOBJS:%.o:%.d) #include $(CGUIOBJS:%.o:%.d) #include$(CPPGUIOBJS:%.o:%.d) $(OBJDIR)/%.o : src/%.c$(OBJDIR)/%.d $(TEST)$(CC) $(COMPILEFLAGS) -Iinclude -o$@ $<$(OBJDIR)/%.o : src/%.cpp $(OBJDIR)/%.d$(TEST) $(CC)$(COMPILEFLAGS) -Iinclude -o $@$< $(OBJDIR)/%.o : src/GuiCode/%.c$(OBJDIR)/%.d $(TEST)$(CC) $(COMPILEFLAGS) -Iinclude -o$@ $<$(OBJDIR)/%.o : src/GuiCode/%.cpp $(OBJDIR)/%.d$(TEST) $(CC)$(COMPILEFLAGS) -Iinclude -o $@$< [/code] To build the library, run (fix.bat on Windows or ./fix.sh on *NIX) and then make [DEBUGMODE=1 | PROFILEMODE=1] [STATICLINK=1] [install | clean | installall | cleanall | help] [BUILDDIR=build/directory] [INSTALLDIR=install/directory] SOLUTION : These solutions were kindly given by the folks on the help-make mailing list. [quote] All your rules have extra prerequisites on them: $(OBJDIR)/%.d : src/%.c makebuilddirs$(FIXDFILES) ... $(OBJDIR)/%.o : src/%.c$(OBJDIR)/%.d ... makebuilddirs : -$(MKDIR)$(LIBDIR) -$(MKDIR)$(subst /,$(SLASH),$(OBJDIR)) Here we see that all .o's depend on the .d files and all .d files depend on a target "makebuilddirs". That target creates directories, but the target itself (a file named "makebuilddirs") is never created. That means that the target "makebuilddirs" is never up to date, and that means that the .d target is always out of date, and that means that the .o target is always out of date, and that means make will always rebuild it. Every time you run make it "rebuilds" the makebuilddirs target and that causes every other target in your makefile which depends on it (or depends on something that depends on it) to be rebuilt. [/quote] Also, a further solution for creating directories was to make them an 'order only prerequisite' by placing them in the prerequisites after a pipe symbol. This way they are only run once before the target's recipe is executed. [code] BUILDDIR = obj/$(LINKTYPE)/$(BUILDTYPE) //... %.d : %.cpp | $(BUILDDIR)$(GCC) -MM -o $@$< $(BUILDDIR) :$(MKDIR) \$(BUILDDIR) [/code]
10. ## Line Collision Response

A few notes about your code : Indent when you start a new block of code - it's hard to follow your code when it's all at the same column. Your initial distance check only compares against the first element of 'closePoints'. Shouldn't it be for each element? When you create the velocity line segments, you should add the velocity to the point, not subtract it. The algorithm itself should go something like this : [i] 1. Find three line segments that represent where your vertical line segment will be between now and the update with regard to velocity. (2 are created by extending the endpoints by the velocity vector, and the other is where it would be if it didn't collide with anything) 2. For each line segment in the world, test whether the three line segments from #1 intersect it. 2a. If they intersect, store the smallest distance of the three intersection tests. 3. Set the velocity of the object to the smallest distance detected (using the original velocity as the initial vector). [/i]
11. ## problems building Allegro

If the CodeBlocks template Cmake generates is not working for you, then try using the "MinGW Makefiles" generator with -G. [code] cd allegro5.0.3 mkdir build cd build cmake -G "MinGW Makefiles" .. mingw32-make mingw32-make install [/code] Also, the correct generator for Code Blocks and MinGW is [code] cmake -G "CodeBlocks - MinGW Makefiles" [/code] And, the error you are getting may be fixed by renaming mingw32-make to make.
12. ## Best Calculus Textbook?

[quote name='guyver23'] Have you considered using MIT OpenCourseWare as an alternative tobuying a textbook? His style may not suit you, but Gilbert Strang'scalculus textbook is also available for free online: [/quote] I'm not terribly fond of PDF's, since they are usually poorly linked together, but that probably wouldn't matter as a textbook is so logically organized. It may be a nice reference in a pinch, so I'll consider it. I'd still like a hard copy though, and that was last published in 1991. It would be nice to get something more recent, but things probably haven't changed much since then. [quote name='jesse007'] I don't have any recommendations because almost all standard calculusbook like James Stewart's Calculus will have #1,2,4,5. If you reallywant to know the proofs behind calculus, then you will need to studyelementary real analysis. A good elementary analysis book like TomApostol's One Variable Calculus with Introduction Linear Algebra willmore than suffice. I learned analysis as a math major but it'spractically useless for programming. (except maybe in the case when youwant to design a numerical method) [/quote] I've been looking over [url="http://www.amazon.com/Calculus-James-Stewart/dp/0538497815/ref=dp_ob_title_bk"]Stewart's 'Calculus' 7th Edition[/url] and it looks pretty thorough. One review did say that there were some cases where necessary explanations of how/why equations were transformed were glossed over in the 6th edition, but maybe those have been remedied. So I guess unless there are any other recommendations for textbooks over that of Stewart's, I will go with that one in the next week or so.
13. ## Best Calculus Textbook?

I used to know calculus rather well, but I'm afraid the years have taken their toll and rusted out the portion of my brain that knew about it. So, I'm looking for a good calculus text book that fits these criteria : 1) Is hard bound. 2) Has good reference tables of common derivatives and integrals. 3) Provides good proofs for learning the formulas that govern it. 4) Covers derivatives, integrals, and volume calculations at the least. 5) Advanced calculus like partial differentials not necessary, but might be nice to learn anyway (new to these). So if you've got a good textbook that you can recommend to me to buy, that would be really great. Please make sure to include the ISBN number of the book so I can get an exact copy. Thanks, Edgar