Initial clone in from local subversion server

This commit is contained in:
2011-05-26 02:24:33 +00:00
commit ccca81e04e
87 changed files with 20290 additions and 0 deletions

78
demo/exploder/Makefile Executable file
View File

@@ -0,0 +1,78 @@
# This makefile is a bit hackish. I wrote it early in the AM.
# Fohgiveuhness, please!!
ifndef $(CFG)
CFG=Debug
endif
# you can also pass : mingw32 and macosx
ifndef $(OS)
OS=linux
endif
TARGET=demo
BINTARGET=$(TARGET)
PROJECTHOME=$(shell pwd)
SDL_CFLAGS=$(shell sdl-config --cflags)
SDL_LDFLAGS=$(shell sdl-config --libs)
LIBDIR=/usr/lib
HEADERDIR=/usr/include
ADDL_CFLAGS=
ifeq "$(OS)" "mingw32"
ADDL_CFLAGS=-mwindows -DBUILD_MINGW32
endif
ifeq "$(OS)" "linux"
ADDL_CFLAGS=-DBUILD_LINUX
endif
# default for release configs
ifeq "$(CFG)" "Release"
OUTDIR=Release
ifeq "$(OS)" "mingw32"
BINTARGET=$(TARGET).exe
else
BINTARGET=$(TARGET)
endif
LINKLIB=game
CXXFLAGS=-I../../../ -I$(HEADERDIR) -I./cpp -c $(SDL_CFLAGS) $(ADDL_CFLAGS)
endif
ifeq "$(CFG)" "Debug"
OUTDIR=Debug
ifeq "$(OS)" "mingw32"
BINTARGET=$(TARGET)-dbg.exe
else
BINTARGET=$(TARGET)-dbg
endif
LINKLIB=game-dbg
CXXFLAGS=-I../../../ -I$(HEADERDIR) -I./cpp -pg -g -ggdb -gstabs -Wall -c $(SDL_CFLAGS) $(ADDL_CFLAGS)
endif
LINKLIBS=-L../../$(CFG) -L$(LIBDIR) -l$(LINKLIB) $(SDL_LDFLAGS) -lSDL_image -lSDL_mixer -lSDL_gfx -lSDL_ttf
BINOBJ=$(OUTDIR)/demo.o
CC = gcc
CXX = g++
LD = $(CXX)
INSTALL = $(which install)
$(OUTDIR)/%.o : cpp/%.cpp
$(CXX) $(CXXFLAGS) -o $@ $<
all: bin
bin: $(BINOBJ)
$(LD) -pg -o $(OUTDIR)/$(BINTARGET) \
-pg $(BINOBJ) $(LINKLIBS)
.PHONY: clean
clean:
rm -f $(OUTDIR)/*.o
rm -f $(OUTDIR)/$(BINTARGET)
.PHONY: rebuild
rebuild:
make clean
make CFG=$(CFG)

BIN
demo/exploder/Release/demo Executable file

Binary file not shown.

BIN
demo/exploder/Release/demo.exe Executable file

Binary file not shown.

33
demo/exploder/cpp/demo.cpp Executable file
View File

@@ -0,0 +1,33 @@
#include <libgame/libgame.h>
int main(int argc, char *argv[])
{
Display2D display = Display2D();
Game &myGame = Game::NewSingleton();
Animation *anim = NULL;
Actor exploder;
SpriteStrip *strip = NULL;
myGame.initSDL();
myGame.initVideo(640, 480, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
display.initVideo((Vector){0,0,0}, 640, 480, 32, SDL_HWSURFACE);
display.setActive(1);
myGame.windows.push_back(&display);
strip = myGame.newSpriteStrip("explosion");
strip->loadFromFile("explosion.png", 110, 110, (Vector){0,0,0});
anim = myGame.newAnimation("explosion");
anim->setStrip(strip, 12, 0, (Vector){0,0,0});
exploder.addAnimation(anim, STATE_DEFAULT);
exploder.setState(STATE_NONE);
display.addActor(&exploder, LAYER_SPRITE1);
while ( 1 ) {
myGame.update();
if ( myGame.keyHeldDown(SDLK_ESCAPE) ) {
break;
}
myGame.finishFrame();
}
}

BIN
demo/exploder/explosion.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
demo/exploder/gmon.out Executable file

Binary file not shown.