Browse Source

Merge pull request #327 from losinggeneration/make_fixes

Fix Make build
Peter Robinson 9 years ago
parent
commit
41a47297c8

+ 2 - 0
engine/compilers/Make/Makefile

@@ -19,6 +19,8 @@ clean:
 -include x zlib
 -include x lpng
 -include x ljpeg
+-include x vorbis
+-include x ogg
 
 release: $(LIB_TARGETS) $(SHARED_LIB_TARGETS) $(APP_TARGETS)
 	@echo Built libraries: $(LIB_TARGETS)

+ 9 - 3
engine/compilers/Make/Torque2D

@@ -1,6 +1,7 @@
 APPNAME := ../../../Torque2D
 
 SOURCES := ../../source/2d/assets/AnimationAsset.cc \
+	../../source/2d/assets/FontAsset.cc \
 	../../source/2d/assets/ImageAsset.cc \
 	../../source/2d/assets/ParticleAsset.cc \
 	../../source/2d/assets/ParticleAssetEmitter.cc \
@@ -30,7 +31,6 @@ SOURCES := ../../source/2d/assets/AnimationAsset.cc \
 	../../source/2d/gui/guiSpriteCtrl.cc \
 	../../source/2d/gui/SceneWindow.cc \
 	../../source/2d/sceneobject/CompositeSprite.cc \
-	../../source/2d/sceneobject/ImageFont.cc \
 	../../source/2d/sceneobject/ParticlePlayer.cc \
 	../../source/2d/sceneobject/SceneObject.cc \
 	../../source/2d/sceneobject/SceneObjectList.cc \
@@ -39,6 +39,7 @@ SOURCES := ../../source/2d/assets/AnimationAsset.cc \
 	../../source/2d/sceneobject/ShapeVector.cc \
 	../../source/2d/sceneobject/SkeletonObject.cc \
 	../../source/2d/sceneobject/Sprite.cc \
+	../../source/2d/sceneobject/TextSprite.cc \
 	../../source/2d/sceneobject/Trigger.cc \
 	../../source/2d/scene/ContactFilter.cc \
 	../../source/2d/scene/DebugDraw.cc \
@@ -56,6 +57,8 @@ SOURCES := ../../source/2d/assets/AnimationAsset.cc \
 	../../source/assets/declaredAssets.cc \
 	../../source/assets/referencedAssets.cc \
 	../../source/audio/AudioAsset.cc \
+	../../source/bitmapFont/BitmapFont.cc \
+	../../source/bitmapFont/BitmapFontCharacter.cc \
 	../../source/Box2D/Collision/b2BroadPhase.cpp \
 	../../source/Box2D/Collision/b2CollideCircle.cpp \
 	../../source/Box2D/Collision/b2CollideEdge.cpp \
@@ -238,6 +241,7 @@ SOURCES := ../../source/2d/assets/AnimationAsset.cc \
 	../../source/persistence/tinyXML/tinyxml.cpp \
 	../../source/persistence/tinyXML/tinyxmlerror.cpp \
 	../../source/persistence/tinyXML/tinyxmlparser.cpp \
+	../../source/audio/vorbisStreamSource.cc \
 	../../source/audio/audio.cc \
 	../../source/audio/audioBuffer.cc \
 	../../source/audio/audioDataBlock.cc \
@@ -398,12 +402,12 @@ SOURCES := ../../source/2d/assets/AnimationAsset.cc \
 	../../source/gui/editor/guiInspector.cc \
 	../../source/gui/editor/guiInspectorTypes.cc \
 	../../source/gui/editor/guiMenuBar.cc \
-	../../source/gui/editor/guiSeparatorCtrl.cc 
+	../../source/gui/editor/guiSeparatorCtrl.cc
 
 LDFLAGS := -g -m32
 LDLIBS := -lstdc++ -lm -ldl -lpthread -lrt -lX11 -lXft -lSDL -lopenal
 
-CFLAGS := -MMD -I. -Wfatal-errors -Wunused -m32 -msse -march=i686 -pipe
+CFLAGS := -std=gnu++11 -MMD -I. -Wfatal-errors -Wunused -m32 -msse -march=i686 -pipe
 
 CFLAGS += -I/usr/include
 CFLAGS += -I/usr/include/freetype2
@@ -413,6 +417,8 @@ CFLAGS += -I../../lib/ljpeg
 CFLAGS += -I../../lib/zlib
 CFLAGS += -I../../lib/lpng
 CFLAGS += -I../../lib/freetype
+CFLAGS += -I../../lib/libvorbis/include
+CFLAGS += -I../../lib/libogg/include
 
 CFLAGS += -DLINUX
 

+ 64 - 0
engine/compilers/Make/ogg

@@ -0,0 +1,64 @@
+# I release this sample under the MIT license: free for any use, provided
+# you hold me harmless from any such use you make, and you retain my
+# copyright on the actual sources.
+# Copyright 2005 Jon Watte.
+
+LIBNAME := ogg
+SOURCES := \
+../../lib/libogg/src/bitwise.c \
+../../lib/libogg/src/framing.c \
+
+LDFLAGS_ogg := -g -m32
+
+CFLAGS_ogg := -MMD -I. -m32 -msse -mmmx -march=i686
+
+CFLAGS_ogg += -I../../lib/libogg/include
+
+CFLAGS_ogg += -DUNICODE
+CFLAGS_ogg += -DLINUX
+
+CFLAGS_DEBUG_ogg := $(CFLAGS_ogg) -ggdb
+CFLAGS_DEBUG_ogg += -DTORQUE_DEBUG
+CFLAGS_DEBUG_ogg += -DTORQUE_DEBUG_GUARD
+CFLAGS_DEBUG_ogg += -DTORQUE_NET_STATS
+
+CFLAGS_ogg += -O3
+
+CC := gcc
+LD := gcc
+
+TARGET_ogg := lib/libogg.a
+TARGET_ogg_DEBUG := lib/libogg_DEBUG.a
+
+LIB_TARGETS += $(TARGET_ogg)
+LIB_TARGETS_DEBUG += $(TARGET_ogg_DEBUG)
+
+OBJS_ogg := $(patsubst ../../lib/libogg/%,Release/ogg/%.o,$(SOURCES))
+OBJS_ogg_DEBUG := $(patsubst ../../lib/libogg/%,Debug/ogg/%.o,$(SOURCES))
+
+# Deriving the variable name from the target name is the secret sauce
+# of the build system.
+#
+$(TARGET_ogg):	$(OBJS_ogg)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_ogg)
+
+$(TARGET_ogg_DEBUG):	$(OBJS_ogg_DEBUG)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_ogg_DEBUG)
+
+Release/ogg/%.o:	../../lib/libogg/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_ogg) $< -o $@
+
+Debug/ogg/%.o:	../../lib/libogg/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_DEBUG_ogg) $< -o $@
+
+release_ogg: $(TARGET_ogg)
+debug_ogg: $(TARGET_ogg_DEBUG)
+
+.PHONY: debug_ogg release_ogg
+
+DEPS += $(patsubst %.o,%.d,$(OBJS_ogg))
+DEPS += $(patsubst %.o,%.d,$(OBJS_ogg_DEBUG))

+ 89 - 0
engine/compilers/Make/vorbis

@@ -0,0 +1,89 @@
+# I release this sample under the MIT license: free for any use, provided
+# you hold me harmless from any such use you make, and you retain my
+# copyright on the actual sources.
+# Copyright 2005 Jon Watte.
+
+LIBNAME := vorbis
+SOURCES := \
+../../lib/libvorbis/analysis.c \
+../../lib/libvorbis/barkmel.c \
+../../lib/libvorbis/bitrate.c \
+../../lib/libvorbis/block.c \
+../../lib/libvorbis/codebook.c \
+../../lib/libvorbis/envelope.c \
+../../lib/libvorbis/floor0.c \
+../../lib/libvorbis/floor1.c \
+../../lib/libvorbis/info.c \
+../../lib/libvorbis/lookup.c \
+../../lib/libvorbis/lpc.c \
+../../lib/libvorbis/lsp.c \
+../../lib/libvorbis/mapping0.c \
+../../lib/libvorbis/mdct.c \
+../../lib/libvorbis/psy.c \
+../../lib/libvorbis/registry.c \
+../../lib/libvorbis/res0.c \
+../../lib/libvorbis/sharedbook.c \
+../../lib/libvorbis/smallft.c \
+../../lib/libvorbis/synthesis.c \
+../../lib/libvorbis/tone.c \
+../../lib/libvorbis/vorbisenc.c \
+../../lib/libvorbis/vorbisfile.c \
+../../lib/libvorbis/window.c \
+
+LDFLAGS_vorbis := -g -m32
+
+CFLAGS_vorbis := -MMD -I. -m32 -msse -mmmx -march=i686
+
+CFLAGS_vorbis += -I../../lib/libvorbis
+CFLAGS_vorbis += -I../../lib/libvorbis/lib
+CFLAGS_vorbis += -I../../lib/libvorbis/include
+CFLAGS_vorbis += -I../../lib/libogg/include
+
+CFLAGS_vorbis += -DUNICODE
+CFLAGS_vorbis += -DLINUX
+
+CFLAGS_DEBUG_vorbis := $(CFLAGS_vorbis) -ggdb
+CFLAGS_DEBUG_vorbis += -DTORQUE_DEBUG
+CFLAGS_DEBUG_vorbis += -DTORQUE_DEBUG_GUARD
+CFLAGS_DEBUG_vorbis += -DTORQUE_NET_STATS
+
+CFLAGS_vorbis += -O3
+
+CC := gcc
+LD := gcc
+
+TARGET_vorbis := lib/libvorbis.a
+TARGET_vorbis_DEBUG := lib/libvorbis_DEBUG.a
+
+LIB_TARGETS += $(TARGET_vorbis)
+LIB_TARGETS_DEBUG += $(TARGET_vorbis_DEBUG)
+
+OBJS_vorbis := $(patsubst ../../lib/libvorbis/%,Release/vorbis/%.o,$(SOURCES))
+OBJS_vorbis_DEBUG := $(patsubst ../../lib/libvorbis/%,Debug/vorbis/%.o,$(SOURCES))
+
+# Deriving the variable name from the target name is the secret sauce
+# of the build system.
+#
+$(TARGET_vorbis):	$(OBJS_vorbis)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_vorbis)
+
+$(TARGET_vorbis_DEBUG):	$(OBJS_vorbis_DEBUG)
+	@mkdir -p $(dir $@)
+	ar cr $@ $(OBJS_vorbis_DEBUG)
+
+Release/vorbis/%.o:	../../lib/libvorbis/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_vorbis) $< -o $@
+
+Debug/vorbis/%.o:	../../lib/libvorbis/%
+	@mkdir -p $(dir $@)
+	$(CC) -c $(CFLAGS_DEBUG_vorbis) $< -o $@
+
+release_vorbis: $(TARGET_vorbis)
+debug_vorbis: $(TARGET_vorbis_DEBUG)
+
+.PHONY: debug_vorbis release_vorbis
+
+DEPS += $(patsubst %.o,%.d,$(OBJS_vorbis))
+DEPS += $(patsubst %.o,%.d,$(OBJS_vorbis_DEBUG))

+ 4 - 4
engine/source/2d/sceneobject/TextSprite.h

@@ -231,11 +231,11 @@ protected:
 
 private:
    void RenderLetter(BatchRender* pBatchRenderer, Vector2& cursor, U32 charID, F32 ratio, U32 charNum);
-   void TextSprite::ApplyAlignment(Vector2& cursor, U32 totalRows, U32 row, F32 length, U32 charCount, F32 ratio);
-   F32 TextSprite::getCursorAdvance(U32 charID, S32 prevCharID, F32 ratio);
-   F32 TextSprite::getCursorAdvance(const BitmapFontCharacter& bmChar, S32 prevCharID, F32 ratio);
+   void ApplyAlignment(Vector2& cursor, U32 totalRows, U32 row, F32 length, U32 charCount, F32 ratio);
+   F32 getCursorAdvance(U32 charID, S32 prevCharID, F32 ratio);
+   F32 getCursorAdvance(const BitmapFontCharacter& bmChar, S32 prevCharID, F32 ratio);
    F32 GetLineHeight() { return (mAutoLineHeight) ? mFontSize : mCustomLineHeight; }
-   void TextSprite::CalculateSpatials(F32 ratio);
+   void CalculateSpatials(F32 ratio);
 };
 
 #endif // _TEXT_SPRITE_H_

+ 3 - 3
engine/source/bitmapFont/BitmapFont.h

@@ -24,11 +24,11 @@
 #define _BITMAP_FONT_H_
 
 #ifndef _BITMAP_FONT_CHARACTER_H_
-#include "bitmapFont\BitmapFontCharacter.h"
+#include "bitmapFont/BitmapFontCharacter.h"
 #endif
 
 #ifndef _UTILITY_H_
-#include "2d/core/utility.h"
+#include "2d/core/Utility.h"
 #endif
 
 #ifndef _TEXTURE_MANAGER_H_
@@ -72,4 +72,4 @@ namespace font
    };
 }
 
-#endif // _BITMAP_FONT_H_
+#endif // _BITMAP_FONT_H_

+ 3 - 3
engine/source/bitmapFont/BitmapFontCharacter.h

@@ -24,11 +24,11 @@
 #define _BITMAP_FONT_CHARACTER_H_
 
 #ifndef _UTILITY_H_
-#include "2d/core/utility.h"
+#include "2d/core/Utility.h"
 #endif
 
 #ifndef _VECTOR2_H_
-#include "2d/Core/Vector2.h"
+#include "2d/core/Vector2.h"
 #endif
 
 namespace font
@@ -54,4 +54,4 @@ namespace font
    };
 }
 
-#endif // _BITMAP_FONT_CHARACTER_H_
+#endif // _BITMAP_FONT_CHARACTER_H_