fixes to code and a option for opengl building for release

This commit is contained in:
Bryan Hoyle 2012-06-20 15:05:25 -04:00
parent b6afd854d0
commit 3b29a74767
2 changed files with 7 additions and 9 deletions

View File

@ -16,6 +16,7 @@ all: build/powder
powder-release.exe: build/powder-release.exe powder-release.exe: build/powder-release.exe
powder.exe: build/powder.exe powder.exe: build/powder.exe
powder-release: build/powder-release powder-release: build/powder-release
powder-opengl-release: build/powder-opengl-release
powder: build/powder powder: build/powder
powder-x: build/powder-x powder-x: build/powder-x
powder-x.jnilib: build/powder-x.jnilib powder-x.jnilib: build/powder-x.jnilib
@ -26,6 +27,8 @@ build/powder.exe: CFLAGS += -DWIN32
build/powder.exe: LFLAGS := -lmingw32 -lregex -lws2_32 -lSDLmain -lpthread -lSDL -lm -lbz2 -llua -lfftw3f-3 #-mwindows build/powder.exe: LFLAGS := -lmingw32 -lregex -lws2_32 -lSDLmain -lpthread -lSDL -lm -lbz2 -llua -lfftw3f-3 #-mwindows
build/powder-release: CFLAGS += -DLIN32 -O3 -ftree-vectorize -msse3 -funsafe-math-optimizations -ffast-math -fomit-frame-pointer -funsafe-loop-optimizations -Wunsafe-loop-optimizations build/powder-release: CFLAGS += -DLIN32 -O3 -ftree-vectorize -msse3 -funsafe-math-optimizations -ffast-math -fomit-frame-pointer -funsafe-loop-optimizations -Wunsafe-loop-optimizations
build/powder-release: LFLAGS := -lSDL -lm -lbz2 -llua -lfftw3f build/powder-release: LFLAGS := -lSDL -lm -lbz2 -llua -lfftw3f
build/powder-opengl-release: CFLAGS += -DLIN32 -O3 -ftree-vectorize -msse3 -funsafe-math-optimizations -ffast-math -fomit-frame-pointer -funsafe-loop-optimizations -Wunsafe-loop-optimizations -DOGLR -DPIX32OGL -DPIXALPHA
build/powder-opengl-release: LFLAGS := -lSDL -lm -lbz2 -llua -lfftw3f -lGL -lGLEW -DOGLR -DPIX32OGL -DPIXALPHA
build/powder: CFLAGS += -DLIN32 build/powder: CFLAGS += -DLIN32
build/powder: LFLAGS := -lSDL -lm -lbz2 -llua -lfftw3f build/powder: LFLAGS := -lSDL -lm -lbz2 -llua -lfftw3f
#build/powder-x: CFLAGS += -DMACOSX -I/Library/Frameworks/SDL.framework/Headers -I/Library/Frameworks/Lua.framework/Headers -I/Library/Frameworks/OpenGL.framework/Headers -DOGLR -DPIX32OGL -DPIXALPHA #build/powder-x: CFLAGS += -DMACOSX -I/Library/Frameworks/SDL.framework/Headers -I/Library/Frameworks/Lua.framework/Headers -I/Library/Frameworks/OpenGL.framework/Headers -DOGLR -DPIX32OGL -DPIXALPHA
@ -46,6 +49,9 @@ build/powder-res.o: resources/powder-res.rc resources/powder.ico resources/docum
build/powder-release: $(SOURCES) build/powder-release: $(SOURCES)
$(CPPC) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(SOURCES) $(LFLAGS) -o $@ $(CPPC) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(SOURCES) $(LFLAGS) -o $@
strip $@ strip $@
build/powder-opengl-release: $(SOURCES)
$(CPPC) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(SOURCES) $(LFLAGS) -o $@
strip $@
build/powder.exe: buildpaths-powder.exe generate $(patsubst build/obj/%.o,build/obj/powder.exe/%.o,$(OBJS)) build/powder-res.o build/powder.exe: buildpaths-powder.exe generate $(patsubst build/obj/%.o,build/obj/powder.exe/%.o,$(OBJS)) build/powder-res.o
$(CPPC_WIN) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(patsubst build/obj/%.o,build/obj/powder.exe/%.o,$(OBJS)) build/powder-res.o $(LFLAGS) -o $@ -ggdb $(CPPC_WIN) $(CFLAGS) $(OFLAGS) $(LDFLAGS) $(patsubst build/obj/%.o,build/obj/powder.exe/%.o,$(OBJS)) build/powder-res.o $(LFLAGS) -o $@ -ggdb
build/obj/powder.exe/%.o: src/%.cpp $(HEADERS) build/obj/powder.exe/%.o: src/%.cpp $(HEADERS)

View File

@ -19,10 +19,7 @@ SaveRenderer::SaveRenderer(){
Thumbnail * SaveRenderer::Render(GameSave * save) Thumbnail * SaveRenderer::Render(GameSave * save)
{ {
#ifndef OGLR
Thumbnail * tempThumb = NULL;
int width, height; int width, height;
#ifdef OGLR #ifdef OGLR
width = save->blockWidth*CELL; width = save->blockWidth*CELL;
height = save->blockHeight*CELL; height = save->blockHeight*CELL;
@ -43,6 +40,7 @@ Thumbnail * SaveRenderer::Render(GameSave * save)
g->Clear(); g->Clear();
sim->clear_sim(); sim->clear_sim();
if(!sim->Load(save)) if(!sim->Load(save))
{ {
ren->render_parts(); ren->render_parts();
@ -55,17 +53,11 @@ Thumbnail * SaveRenderer::Render(GameSave * save)
dst+=(width*CELL);///PIXELSIZE; dst+=(width*CELL);///PIXELSIZE;
src+=XRES+BARSIZE; src+=XRES+BARSIZE;
} }
tempThumb = new Thumbnail(0, 0, pData, ui::Point(width*CELL, height*CELL)); tempThumb = new Thumbnail(0, 0, pData, ui::Point(width*CELL, height*CELL));
} }
if(pData) if(pData)
free(pData); free(pData);
return tempThumb; return tempThumb;
#else
VideoBuffer buffer(64, 64);
buffer.BlendCharacter(32, 32, 'X', 255, 255, 255, 255);
Thumbnail * thumb = new Thumbnail(0, 0, buffer.Buffer, ui::Point(64, 64));
return thumb;
#endif #endif
} }