Got library and demos building on mingw32 and ubuntu again

This commit is contained in:
2013-01-22 07:49:01 -05:00
parent 1590271691
commit f1c2baf795
27 changed files with 220 additions and 13852 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +0,0 @@
Split 1 frames into new sprite strip
Split 10 frames into new sprite strip

View File

@@ -1,4 +1,4 @@
# This makefile is a bit hackish. I wrote it early in the AM.
# This makefile is a bit hackish. I wrote it early in the AM.
# Fohgiveuhness, please!!
@@ -10,7 +10,7 @@ endif
ifndef $(OS)
OS=linux
endif
TARGET=demo
BINTARGET=$(TARGET)
PROJECTHOME=$(shell pwd)
@@ -21,12 +21,12 @@ HEADERDIR=/usr/include
ADDL_CFLAGS=
ifeq "$(OS)" "mingw32"
ADDL_CFLAGS=-mwindows -DBUILD_MINGW32 -rdynamic
ADDL_CFLAGS=-mwindows -DBUILD_MINGW32
endif
ifeq "$(OS)" "linux"
ADDL_CFLAGS=-DBUILD_LINUX -rdynamic
ADDL_LDFLAGS=-rdynamic
endif
endif
# default for release configs
ifeq "$(CFG)" "Release"
@@ -64,30 +64,33 @@ LD = $(CXX)
INSTALL = $(which install)
$(OUTDIR)/%.o : cpp/%.cpp
mkdir -p $(OUTDIR)
$(CXX) $(CXXFLAGS) -o $@ $<
all: bin
.PHONY: $(BTOBJ)
$(BTOBJ):
cp /usr/local/lib/backtrace.dll $(OUTDIR)/
cp /usr/local/lib/av*dll $(OUTDIR)/
cp /usr/local/lib/swscale*dll $(OUTDIR)/
cp /usr/local/bin/*SDL*dll $(OUTDIR)/
cp /usr/local/bin/freetype*dll $(OUTDIR)/
cp /usr/local/bin/*png*dll $(OUTDIR)/
cp /usr/local/bin/*jpeg*dll $(OUTDIR)/
cp /usr/local/bin/libimage*dll $(OUTDIR)/
cp /usr/local/bin/libogg*dll $(OUTDIR)/
cp /usr/local/bin/*vorbis*dll $(OUTDIR)/
cp /usr/local/bin/librle*dll $(OUTDIR)/
cp /usr/local/bin/libtiff*dll $(OUTDIR)/
cp /usr/local/bin/libxml2*dll $(OUTDIR)/
cp /usr/local/bin/zlib*dll $(OUTDIR)/
$(BTOBJ):
if [ "$(OS)" == "mingw32" ]; then \
cp /usr/local/lib/backtrace.dll $(OUTDIR)/ \
cp /usr/lib/*av*dll* $(OUTDIR)/ \
cp /lib/*swscale*dll* $(OUTDIR)/ \
cp /usr/local/bin/*SDL*dll $(OUTDIR)/ \
cp /usr/local/bin/freetype*dll $(OUTDIR)/ \
cp /usr/local/bin/*png*dll $(OUTDIR)/ \
cp /usr/local/bin/*jpeg*dll $(OUTDIR)/ \
cp /usr/local/bin/libimage*dll $(OUTDIR)/ \
cp /usr/local/bin/libogg*dll $(OUTDIR)/ \
cp /usr/local/bin/*vorbis*dll $(OUTDIR)/ \
cp /usr/local/bin/librle*dll $(OUTDIR)/ \
cp /usr/local/bin/libtiff*dll $(OUTDIR)/ \
cp /lib/libxml2*dll* $(OUTDIR)/ \
cp /usr/local/bin/zlib*dll $(OUTDIR)/ \
fi
bin: $(BINOBJ) $(BTOBJ)
$(LD) -pg -o $(OUTDIR)/$(BINTARGET) \
-pg $(BINOBJ) $(LINKLIBS)
-pg $(BINOBJ) $(LINKLIBS)
.PHONY: clean
clean:

View File

@@ -1,16 +1,16 @@
/*
* This demo expands on the frictionball demo. It shows how to create objects dynamically, by
* This demo expands on the frictionball demo. It shows how to create objects dynamically, by
* creating an explosion every time the ball touches the ground
*/
#include <libgame/libgame.h>
#include <libsdlgame/libsdlgame.h>
#include <string>
int main(int argc, char *argv[])
{
Display2D display = Display2D();
Game &myGame = Game::NewSingleton();
Actor ball;
Actor ball;
Actor *exploder = NULL;
float gravity = 0.1;
//int exploderCount = 0;
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
exploder->setState(STATE_DYING);
exploder->setPosition(actorPos);
display.addActor(exploder, LAYER_SPRITE2);
actorPos.y = (480 - ball.nextFrame()->h);
ball.setPosition(actorPos);
}