dungeon_crawler

changeset 69:45172d087ebe

fixed some windows compatibility crap fixed a terrible stack overrun in psys (TODO: remember to fix in libpsys too)
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 07 Oct 2012 03:42:44 +0200
parents 1141a325cb73
children f55ddab0f3a4
files prototype/prototype.vcxproj prototype/prototype.vcxproj.filters prototype/psys/pattr.c prototype/psys/psys.c prototype/psys/psys_gl.c prototype/src/audio/sample.cc prototype/src/audio/stream.cc prototype/src/audio/stream.h prototype/src/main.cc prototype/src/renderer_deferred.cc prototype/src/renderer_multipass.cc prototype/src/timer.cc
diffstat 12 files changed, 162 insertions(+), 27 deletions(-) [+]
line diff
     1.1 --- a/prototype/prototype.vcxproj	Sun Oct 07 02:05:11 2012 +0300
     1.2 +++ b/prototype/prototype.vcxproj	Sun Oct 07 03:42:44 2012 +0200
     1.3 @@ -52,13 +52,13 @@
     1.4        <WarningLevel>Level3</WarningLevel>
     1.5        <Optimization>Disabled</Optimization>
     1.6        <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     1.7 -      <AdditionalIncludeDirectories>$(SolutionDir)\vmath;$(SolutionDir)\drawtext;$(SolutionDir)\kdtree;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     1.8 -      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
     1.9 +      <AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)\src;$(SolutionDir)\vmath;$(SolutionDir)\drawtext;$(SolutionDir)\kdtree;$(SolutionDir)\imago2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    1.10 +      <DisableSpecificWarnings>4996;4244</DisableSpecificWarnings>
    1.11      </ClCompile>
    1.12      <Link>
    1.13        <SubSystem>Console</SubSystem>
    1.14        <GenerateDebugInformation>true</GenerateDebugInformation>
    1.15 -      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;assimp.lib;glut32.lib;glew32.lib;libimago2.lib;zlib.lib;jpeglib.lib;libpng.lib;%(AdditionalDependencies)</AdditionalDependencies>
    1.16 +      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;assimp.lib;glut32.lib;glew32.lib;zlib.lib;jpeglib.lib;libpng.lib;freetype.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;OpenAL32.lib;%(AdditionalDependencies)</AdditionalDependencies>
    1.17      </Link>
    1.18    </ItemDefinitionGroup>
    1.19    <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    1.20 @@ -70,22 +70,39 @@
    1.21        <FunctionLevelLinking>true</FunctionLevelLinking>
    1.22        <IntrinsicFunctions>true</IntrinsicFunctions>
    1.23        <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    1.24 -      <AdditionalIncludeDirectories>$(SolutionDir)\vmath;$(SolutionDir)\drawtext;$(SolutionDir)\kdtree;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    1.25 -      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
    1.26 +      <AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)\src;$(SolutionDir)\vmath;$(SolutionDir)\drawtext;$(SolutionDir)\kdtree;$(SolutionDir)\imago2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    1.27 +      <DisableSpecificWarnings>4996;4244</DisableSpecificWarnings>
    1.28      </ClCompile>
    1.29      <Link>
    1.30        <SubSystem>Console</SubSystem>
    1.31        <GenerateDebugInformation>true</GenerateDebugInformation>
    1.32        <EnableCOMDATFolding>true</EnableCOMDATFolding>
    1.33        <OptimizeReferences>true</OptimizeReferences>
    1.34 -      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;assimp.lib;glut32.lib;glew32.lib;libimago2.lib;zlib.lib;jpeglib.lib;libpng.lib;%(AdditionalDependencies)</AdditionalDependencies>
    1.35 +      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;assimp.lib;glut32.lib;glew32.lib;zlib.lib;jpeglib.lib;libpng.lib;freetype.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;OpenAL32.lib;%(AdditionalDependencies)</AdditionalDependencies>
    1.36      </Link>
    1.37    </ItemDefinitionGroup>
    1.38    <ItemGroup>
    1.39 +    <ClCompile Include="anim\anim.c" />
    1.40 +    <ClCompile Include="anim\dynarr.c" />
    1.41 +    <ClCompile Include="anim\track.c" />
    1.42      <ClCompile Include="drawtext\drawgl.c" />
    1.43      <ClCompile Include="drawtext\font.c" />
    1.44      <ClCompile Include="drawtext\utf8.c" />
    1.45 +    <ClCompile Include="imago2\conv.c" />
    1.46 +    <ClCompile Include="imago2\file_jpeg.c" />
    1.47 +    <ClCompile Include="imago2\file_png.c" />
    1.48 +    <ClCompile Include="imago2\file_ppm.c" />
    1.49 +    <ClCompile Include="imago2\file_rgbe.c" />
    1.50 +    <ClCompile Include="imago2\ftype_module.c" />
    1.51 +    <ClCompile Include="imago2\imago2.c" />
    1.52 +    <ClCompile Include="imago2\imago_gl.c" />
    1.53 +    <ClCompile Include="imago2\modules.c" />
    1.54      <ClCompile Include="kdtree\kdtree.c" />
    1.55 +    <ClCompile Include="psys\pattr.c" />
    1.56 +    <ClCompile Include="psys\pstrack.c" />
    1.57 +    <ClCompile Include="psys\psys.c" />
    1.58 +    <ClCompile Include="psys\psys_gl.c" />
    1.59 +    <ClCompile Include="psys\rndval.c" />
    1.60      <ClCompile Include="src\audio\audio.cc" />
    1.61      <ClCompile Include="src\audio\auman.cc" />
    1.62      <ClCompile Include="src\audio\ovstream.cc" />
    1.63 @@ -124,9 +141,20 @@
    1.64      <ClCompile Include="vmath\vmath.c" />
    1.65    </ItemGroup>
    1.66    <ItemGroup>
    1.67 +    <ClInclude Include="anim\anim.h" />
    1.68 +    <ClInclude Include="anim\config.h" />
    1.69 +    <ClInclude Include="anim\dynarr.h" />
    1.70 +    <ClInclude Include="anim\track.h" />
    1.71      <ClInclude Include="drawtext\drawtext.h" />
    1.72      <ClInclude Include="drawtext\drawtext_impl.h" />
    1.73 +    <ClInclude Include="imago2\ftype_module.h" />
    1.74 +    <ClInclude Include="imago2\imago2.h" />
    1.75      <ClInclude Include="kdtree\kdtree.h" />
    1.76 +    <ClInclude Include="psys\pattr.h" />
    1.77 +    <ClInclude Include="psys\pstrack.h" />
    1.78 +    <ClInclude Include="psys\psys.h" />
    1.79 +    <ClInclude Include="psys\psys_gl.h" />
    1.80 +    <ClInclude Include="psys\rndval.h" />
    1.81      <ClInclude Include="src\audio\audio.h" />
    1.82      <ClInclude Include="src\audio\auman.h" />
    1.83      <ClInclude Include="src\audio\openal.h" />
     2.1 --- a/prototype/prototype.vcxproj.filters	Sun Oct 07 02:05:11 2012 +0300
     2.2 +++ b/prototype/prototype.vcxproj.filters	Sun Oct 07 03:42:44 2012 +0200
     2.3 @@ -20,6 +20,15 @@
     2.4      <Filter Include="libs\drawtext">
     2.5        <UniqueIdentifier>{a1933fec-b18b-4122-a680-4da3e97a2d88}</UniqueIdentifier>
     2.6      </Filter>
     2.7 +    <Filter Include="libs\imago2">
     2.8 +      <UniqueIdentifier>{23054168-9ccf-414e-8c00-2d8205e8ae2d}</UniqueIdentifier>
     2.9 +    </Filter>
    2.10 +    <Filter Include="libs\anim">
    2.11 +      <UniqueIdentifier>{d76c7356-d473-4aeb-b7d8-6a577100d636}</UniqueIdentifier>
    2.12 +    </Filter>
    2.13 +    <Filter Include="libs\psys">
    2.14 +      <UniqueIdentifier>{22905ba8-8498-4dc4-8be2-6f4def2528f3}</UniqueIdentifier>
    2.15 +    </Filter>
    2.16    </ItemGroup>
    2.17    <ItemGroup>
    2.18      <ClCompile Include="src\camera.cc">
    2.19 @@ -142,6 +151,57 @@
    2.20      <ClCompile Include="drawtext\utf8.c">
    2.21        <Filter>libs\drawtext</Filter>
    2.22      </ClCompile>
    2.23 +    <ClCompile Include="imago2\conv.c">
    2.24 +      <Filter>libs\imago2</Filter>
    2.25 +    </ClCompile>
    2.26 +    <ClCompile Include="imago2\file_jpeg.c">
    2.27 +      <Filter>libs\imago2</Filter>
    2.28 +    </ClCompile>
    2.29 +    <ClCompile Include="imago2\file_png.c">
    2.30 +      <Filter>libs\imago2</Filter>
    2.31 +    </ClCompile>
    2.32 +    <ClCompile Include="imago2\file_ppm.c">
    2.33 +      <Filter>libs\imago2</Filter>
    2.34 +    </ClCompile>
    2.35 +    <ClCompile Include="imago2\file_rgbe.c">
    2.36 +      <Filter>libs\imago2</Filter>
    2.37 +    </ClCompile>
    2.38 +    <ClCompile Include="imago2\ftype_module.c">
    2.39 +      <Filter>libs\imago2</Filter>
    2.40 +    </ClCompile>
    2.41 +    <ClCompile Include="imago2\imago_gl.c">
    2.42 +      <Filter>libs\imago2</Filter>
    2.43 +    </ClCompile>
    2.44 +    <ClCompile Include="imago2\imago2.c">
    2.45 +      <Filter>libs\imago2</Filter>
    2.46 +    </ClCompile>
    2.47 +    <ClCompile Include="imago2\modules.c">
    2.48 +      <Filter>libs\imago2</Filter>
    2.49 +    </ClCompile>
    2.50 +    <ClCompile Include="anim\anim.c">
    2.51 +      <Filter>libs\anim</Filter>
    2.52 +    </ClCompile>
    2.53 +    <ClCompile Include="anim\dynarr.c">
    2.54 +      <Filter>libs\anim</Filter>
    2.55 +    </ClCompile>
    2.56 +    <ClCompile Include="anim\track.c">
    2.57 +      <Filter>libs\anim</Filter>
    2.58 +    </ClCompile>
    2.59 +    <ClCompile Include="psys\pattr.c">
    2.60 +      <Filter>libs\psys</Filter>
    2.61 +    </ClCompile>
    2.62 +    <ClCompile Include="psys\pstrack.c">
    2.63 +      <Filter>libs\psys</Filter>
    2.64 +    </ClCompile>
    2.65 +    <ClCompile Include="psys\psys.c">
    2.66 +      <Filter>libs\psys</Filter>
    2.67 +    </ClCompile>
    2.68 +    <ClCompile Include="psys\psys_gl.c">
    2.69 +      <Filter>libs\psys</Filter>
    2.70 +    </ClCompile>
    2.71 +    <ClCompile Include="psys\rndval.c">
    2.72 +      <Filter>libs\psys</Filter>
    2.73 +    </ClCompile>
    2.74    </ItemGroup>
    2.75    <ItemGroup>
    2.76      <ClInclude Include="src\camera.h">
    2.77 @@ -261,6 +321,39 @@
    2.78      <ClInclude Include="drawtext\drawtext_impl.h">
    2.79        <Filter>libs\drawtext</Filter>
    2.80      </ClInclude>
    2.81 +    <ClInclude Include="imago2\ftype_module.h">
    2.82 +      <Filter>libs\imago2</Filter>
    2.83 +    </ClInclude>
    2.84 +    <ClInclude Include="imago2\imago2.h">
    2.85 +      <Filter>libs\imago2</Filter>
    2.86 +    </ClInclude>
    2.87 +    <ClInclude Include="anim\anim.h">
    2.88 +      <Filter>libs\anim</Filter>
    2.89 +    </ClInclude>
    2.90 +    <ClInclude Include="anim\config.h">
    2.91 +      <Filter>libs\anim</Filter>
    2.92 +    </ClInclude>
    2.93 +    <ClInclude Include="anim\dynarr.h">
    2.94 +      <Filter>libs\anim</Filter>
    2.95 +    </ClInclude>
    2.96 +    <ClInclude Include="anim\track.h">
    2.97 +      <Filter>libs\anim</Filter>
    2.98 +    </ClInclude>
    2.99 +    <ClInclude Include="psys\pattr.h">
   2.100 +      <Filter>libs\psys</Filter>
   2.101 +    </ClInclude>
   2.102 +    <ClInclude Include="psys\pstrack.h">
   2.103 +      <Filter>libs\psys</Filter>
   2.104 +    </ClInclude>
   2.105 +    <ClInclude Include="psys\psys.h">
   2.106 +      <Filter>libs\psys</Filter>
   2.107 +    </ClInclude>
   2.108 +    <ClInclude Include="psys\psys_gl.h">
   2.109 +      <Filter>libs\psys</Filter>
   2.110 +    </ClInclude>
   2.111 +    <ClInclude Include="psys\rndval.h">
   2.112 +      <Filter>libs\psys</Filter>
   2.113 +    </ClInclude>
   2.114    </ItemGroup>
   2.115    <ItemGroup>
   2.116      <None Include="vmath\matrix.inl">
     3.1 --- a/prototype/psys/pattr.c	Sun Oct 07 02:05:11 2012 +0300
     3.2 +++ b/prototype/psys/pattr.c	Sun Oct 07 03:42:44 2012 +0200
     3.3 @@ -166,7 +166,7 @@
     3.4  	}
     3.5  
     3.6  	if(!(fp = fopen(fname, "r"))) {
     3.7 -		fprintf(stderr, "%s: failed to read file: %s: %s\n", __func__, fname, strerror(errno));
     3.8 +		fprintf(stderr, "%s: failed to read file: %s: %s\n", __FUNCTION__, fname, strerror(errno));
     3.9  		return -1;
    3.10  	}
    3.11  	res = psys_load_attr_stream(attr, fp);
    3.12 @@ -247,6 +247,9 @@
    3.13  	char *buf, *tmp;
    3.14  	struct cfgopt *opt;
    3.15  
    3.16 +	/* allocate a working buffer on the stack that could fit the current line */
    3.17 +	buf = alloca(strlen(line) + 1);
    3.18 +
    3.19  	line = stripspace((char*)line);
    3.20  	if(line[0] == '#' || !line[0]) {
    3.21  		return 0;	/* skip empty lines and comments */
    3.22 @@ -263,8 +266,6 @@
    3.23  	*opt->valstr++ = 0;
    3.24  	opt->valstr = stripspace(opt->valstr);
    3.25  
    3.26 -	/* allocate a working buffer on the stack that could fit the current line */
    3.27 -	buf = alloca(strlen(line) + 1);
    3.28  	strcpy(buf, line);
    3.29  	buf = stripspace(buf);
    3.30  
    3.31 @@ -274,7 +275,8 @@
    3.32  		float tval;
    3.33  
    3.34  		*tmp++ = 0;
    3.35 -		opt->name = strdup(buf);
    3.36 +		opt->name = malloc(strlen(buf) + 1);
    3.37 +		strcpy(opt->name, buf);
    3.38  
    3.39  		tval = strtod(tmp, &endp);
    3.40  		if(endp == tmp) { /* nada ... */
    3.41 @@ -285,7 +287,8 @@
    3.42  			opt->tm = (long)tval;
    3.43  		}
    3.44  	} else {
    3.45 -		opt->name = strdup(buf);
    3.46 +		opt->name = malloc(strlen(buf) + 1);
    3.47 +		strcpy(opt->name, buf);
    3.48  		opt->tm = 0;
    3.49  	}
    3.50  
    3.51 @@ -331,7 +334,9 @@
    3.52  {
    3.53  	if(opt) {
    3.54  		free(opt->name);
    3.55 +		opt->name = 0;
    3.56  	}
    3.57 +	opt = 0;
    3.58  }
    3.59  
    3.60  
    3.61 @@ -341,7 +346,7 @@
    3.62  	int res;
    3.63  
    3.64  	if(!(fp = fopen(fname, "w"))) {
    3.65 -		fprintf(stderr, "%s: failed to write file: %s: %s\n", __func__, fname, strerror(errno));
    3.66 +		fprintf(stderr, "%s: failed to write file: %s: %s\n", __FUNCTION__, fname, strerror(errno));
    3.67  		return -1;
    3.68  	}
    3.69  	res = psys_save_attr_stream(attr, fp);
     4.1 --- a/prototype/psys/psys.c	Sun Oct 07 02:05:11 2012 +0300
     4.2 +++ b/prototype/psys/psys.c	Sun Oct 07 03:42:44 2012 +0200
     4.3 @@ -1,7 +1,7 @@
     4.4  #include <stdlib.h>
     4.5  #include <math.h>
     4.6  #include <assert.h>
     4.7 -#include <pthread.h>
     4.8 +/*#include <pthread.h>*/
     4.9  #include "psys.h"
    4.10  #include "psys_gl.h"
    4.11  
    4.12 @@ -11,7 +11,7 @@
    4.13  /* particle pool */
    4.14  static struct psys_particle *ppool;
    4.15  static int ppool_size;
    4.16 -static pthread_mutex_t pool_lock = PTHREAD_MUTEX_INITIALIZER;
    4.17 +/*static pthread_mutex_t pool_lock = PTHREAD_MUTEX_INITIALIZER;*/
    4.18  
    4.19  static struct psys_particle *palloc(void);
    4.20  static void pfree(struct psys_particle *p);
    4.21 @@ -302,7 +302,7 @@
    4.22  {
    4.23  	struct psys_particle *p;
    4.24  
    4.25 -	pthread_mutex_lock(&pool_lock);
    4.26 +	/*pthread_mutex_lock(&pool_lock);*/
    4.27  	if(ppool) {
    4.28  		p = ppool;
    4.29  		ppool = ppool->next;
    4.30 @@ -310,16 +310,16 @@
    4.31  	} else {
    4.32  		p = malloc(sizeof *p);
    4.33  	}
    4.34 -	pthread_mutex_unlock(&pool_lock);
    4.35 +	/*pthread_mutex_unlock(&pool_lock);*/
    4.36  
    4.37  	return p;
    4.38  }
    4.39  
    4.40  static void pfree(struct psys_particle *p)
    4.41  {
    4.42 -	pthread_mutex_lock(&pool_lock);
    4.43 +	/*pthread_mutex_lock(&pool_lock);*/
    4.44  	p->next = ppool;
    4.45  	ppool = p;
    4.46  	ppool_size++;
    4.47 -	pthread_mutex_unlock(&pool_lock);
    4.48 +	/*pthread_mutex_unlock(&pool_lock);*/
    4.49  }
     5.1 --- a/prototype/psys/psys_gl.c	Sun Oct 07 02:05:11 2012 +0300
     5.2 +++ b/prototype/psys/psys_gl.c	Sun Oct 07 03:42:44 2012 +0200
     5.3 @@ -84,7 +84,7 @@
     5.4  	if(!(pixels = img_load_pixels(fname, &xsz, &ysz, IMG_FMT_RGBA32))) {
     5.5  		return 0;
     5.6  	}
     5.7 -	printf("%s: creating texture %s (%dx%d)\n", __func__, fname, xsz, ysz);
     5.8 +	printf("%s: creating texture %s (%dx%d)\n", __FUNCTION__, fname, xsz, ysz);
     5.9  
    5.10  	glGenTextures(1, &tex);
    5.11  	glBindTexture(GL_TEXTURE_2D, tex);
     6.1 --- a/prototype/src/audio/sample.cc	Sun Oct 07 02:05:11 2012 +0300
     6.2 +++ b/prototype/src/audio/sample.cc	Sun Oct 07 03:42:44 2012 +0200
     6.3 @@ -1,5 +1,6 @@
     6.4  #include <stdio.h>
     6.5  #include <stdlib.h>
     6.6 +#include <stdint.h>
     6.7  #include <assert.h>
     6.8  #include <vorbis/vorbisfile.h>
     6.9  #include "openal.h"
     7.1 --- a/prototype/src/audio/stream.cc	Sun Oct 07 02:05:11 2012 +0300
     7.2 +++ b/prototype/src/audio/stream.cc	Sun Oct 07 03:42:44 2012 +0200
     7.3 @@ -32,7 +32,7 @@
     7.4  	return volume;
     7.5  }
     7.6  
     7.7 -void AudioStream::play(enum PlayMode mode)
     7.8 +void AudioStream::play(PlayMode mode)
     7.9  {
    7.10  	loop = (mode == PlayMode::loop);
    7.11  	done = false;
    7.12 @@ -153,7 +153,7 @@
    7.13  
    7.14  		mutex.unlock();
    7.15  
    7.16 -		std::chrono::milliseconds dur{poll_interval};
    7.17 +		std::chrono::milliseconds dur(poll_interval);
    7.18  		std::this_thread::sleep_for(dur);
    7.19  
    7.20  		mutex.lock();
     8.1 --- a/prototype/src/audio/stream.h	Sun Oct 07 02:05:11 2012 +0300
     8.2 +++ b/prototype/src/audio/stream.h	Sun Oct 07 03:42:44 2012 +0200
     8.3 @@ -38,7 +38,7 @@
     8.4  	void set_volume(float vol);
     8.5  	float get_volume() const;
     8.6  
     8.7 -	void play(enum PlayMode mode);
     8.8 +	void play(PlayMode mode);
     8.9  	void stop();
    8.10  
    8.11  	virtual void rewind() = 0;
     9.1 --- a/prototype/src/main.cc	Sun Oct 07 02:05:11 2012 +0300
     9.2 +++ b/prototype/src/main.cc	Sun Oct 07 03:42:44 2012 +0200
     9.3 @@ -1,7 +1,6 @@
     9.4  #include <stdio.h>
     9.5  #include <stdlib.h>
     9.6  #include <assert.h>
     9.7 -#include <unistd.h>
     9.8  #include "opengl.h"
     9.9  #include "psys/psys.h"
    9.10  #include "level.h"
    10.1 --- a/prototype/src/renderer_deferred.cc	Sun Oct 07 02:05:11 2012 +0300
    10.2 +++ b/prototype/src/renderer_deferred.cc	Sun Oct 07 03:42:44 2012 +0200
    10.3 @@ -61,11 +61,11 @@
    10.4  	height = ysz;
    10.5  
    10.6  	if(!GLEW_ARB_texture_float) {
    10.7 -		fprintf(stderr, "%s: error: no floating point texture support\n", __func__);
    10.8 +		fprintf(stderr, "%s: error: no floating point texture support\n", __FUNCTION__);
    10.9  		return false;
   10.10  	}
   10.11  	if(!GLEW_ARB_draw_buffers) {
   10.12 -		fprintf(stderr, "%s: error: no multiple render target support\n", __func__);
   10.13 +		fprintf(stderr, "%s: error: no multiple render target support\n", __FUNCTION__);
   10.14  		return false;
   10.15  	}
   10.16  
   10.17 @@ -73,7 +73,7 @@
   10.18  	glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &max_draw_buf);
   10.19  	printf("max draw buffers: %d\n", max_draw_buf);
   10.20  	if(max_draw_buf < MRT_COUNT) {
   10.21 -		fprintf(stderr, "%s: error: not enough draw buffers (%d), %d required\n", __func__, max_draw_buf, MRT_COUNT);
   10.22 +		fprintf(stderr, "%s: error: not enough draw buffers (%d), %d required\n", __FUNCTION__, max_draw_buf, MRT_COUNT);
   10.23  		return false;
   10.24  	}
   10.25  	num_draw_bufs = MRT_COUNT;
    11.1 --- a/prototype/src/renderer_multipass.cc	Sun Oct 07 02:05:11 2012 +0300
    11.2 +++ b/prototype/src/renderer_multipass.cc	Sun Oct 07 03:42:44 2012 +0200
    11.3 @@ -32,7 +32,7 @@
    11.4  	height = ysz;
    11.5  
    11.6  	if(!GLEW_ARB_texture_float) {
    11.7 -		fprintf(stderr, "%s: error: no floating point texture support\n", __func__);
    11.8 +		fprintf(stderr, "%s: error: no floating point texture support\n", __FUNCTION__);
    11.9  		return false;
   11.10  	}
   11.11  
    12.1 --- a/prototype/src/timer.cc	Sun Oct 07 02:05:11 2012 +0300
    12.2 +++ b/prototype/src/timer.cc	Sun Oct 07 03:42:44 2012 +0200
    12.3 @@ -1,3 +1,4 @@
    12.4 +#ifndef _MSC_VER
    12.5  #include <chrono>
    12.6  #include "timer.h"
    12.7  
    12.8 @@ -16,3 +17,11 @@
    12.9  	auto dur = steady_clock::now() - start_time;
   12.10  	return duration_cast<milliseconds>(dur).count();
   12.11  }
   12.12 +#else
   12.13 +#include <Windows.h>
   12.14 +
   12.15 +unsigned long get_time_msec(void)
   12.16 +{
   12.17 +	return GetTickCount();
   12.18 +}
   12.19 +#endif
   12.20 \ No newline at end of file