From 61f79336d6fcff2c98509ae23ea1407726e0d04b Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 8 Nov 2012 21:54:17 +0000 Subject: [PATCH] Make ivfrate build standalone, Makefile tweaks. git-svn-id: https://svn.eduke32.com/eduke32@3132 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile | 4 ++-- polymer/eduke32/source/animvpx.h | 7 +++++-- polymer/eduke32/source/ivfrate.c | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 173ece225..c57a30f66 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -444,7 +444,7 @@ $(OBJ)/%.$o: $(SRC)/%.c #### Utilities -$(IVFRATE): $(SRC)/ivfrate.c +$(IVFRATE): $(SRC)/ivfrate.c $(SRC)/animvpx.h if $(COMPILER) -Wall -Wextra $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi #### Lunatic @@ -530,7 +530,7 @@ $(RSRC)/editor_banner.c: $(RSRC)/build.bmp # PHONIES clean: - -rm -f $(OBJ)/* $(EDUKE32) $(EDUKE32).memmap $(MAPSTER32) $(MAPSTER32).memmap core* duke3d_w32$(EXESUFFIX) && $(MAKE) -C $(JAUDIOLIBDIR) clean && $(MAKE) -C $(ENETDIR) clean + -rm -f $(OBJ)/* $(EDUKE32) $(EDUKE32).memmap $(MAPSTER32) $(MAPSTER32).memmap $(IVFRATE) core* duke3d_w32$(EXESUFFIX) && $(MAKE) -C $(JAUDIOLIBDIR) clean && $(MAKE) -C $(ENETDIR) clean ifeq ($(PLATFORM),DARWIN) -rm -rf EDuke32.app Mapster32.app endif diff --git a/polymer/eduke32/source/animvpx.h b/polymer/eduke32/source/animvpx.h index 3ca774f29..6abc284ef 100644 --- a/polymer/eduke32/source/animvpx.h +++ b/polymer/eduke32/source/animvpx.h @@ -6,8 +6,10 @@ #define ANIM_VPX_H #define VPX_CODEC_DISABLE_COMPAT 1 -#include +#ifndef ANIMVPX_STANDALONE +# include //#include +#endif // IVF format: http://wiki.multimedia.cx/index.php?title=IVF #pragma pack(push,1) @@ -29,10 +31,10 @@ typedef struct } animvpx_ivf_header_t; #pragma pack(pop) +#ifndef ANIMVPX_STANDALONE extern const char *animvpx_read_ivf_header_errmsg[7]; int32_t animvpx_read_ivf_header(int32_t inhandle, animvpx_ivf_header_t *hdr); - typedef struct { const char *errmsg; // non-NULL if codec error? better always check... @@ -85,6 +87,7 @@ void animvpx_restore_glstate(void); int32_t animvpx_render_frame(animvpx_codec_ctx *codec); void animvpx_print_stats(const animvpx_codec_ctx *codec); +#endif static inline int32_t animvpx_check_header(const animvpx_ivf_header_t *hdr) { diff --git a/polymer/eduke32/source/ivfrate.c b/polymer/eduke32/source/ivfrate.c index 8f58e07c9..09f0ea312 100644 --- a/polymer/eduke32/source/ivfrate.c +++ b/polymer/eduke32/source/ivfrate.c @@ -10,6 +10,7 @@ #include #define Bmemcmp memcmp #define USE_OPENGL +#define ANIMVPX_STANDALONE #include "animvpx.h" @@ -78,7 +79,7 @@ int main(int argc, char **argv) unsigned long numer = strtoul(argv[2], NULL, 10); unsigned long denom = strtoul(argv[3], NULL, 10); uint32_t numer32=numer, denom32=denom; - const int NUMER_OFS = offsetof(animvpx_ivf_header_t, fpsnumer); + const int NUMER_OFS = 16; //offsetof(animvpx_ivf_header_t, fpsnumer); if (denom == 0) {