Fix building on Visual Studio after GLAD & Polymost changes

git-svn-id: https://svn.eduke32.com/eduke32@6671 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2018-02-17 06:38:15 +00:00
parent 97de73a760
commit d6926cb7d3
4 changed files with 1524 additions and 1476 deletions

View file

@ -226,6 +226,8 @@
<ClInclude Include="..\..\source\audiolib\src\linklist.h" />
<ClInclude Include="..\..\source\audiolib\include\music.h" />
<ClInclude Include="..\..\source\audiolib\src\pitch.h" />
<ClInclude Include="..\..\source\glad\include\glad\glad.h" />
<ClInclude Include="..\..\source\glad\include\glad\glad_wgl.h" />
<ClInclude Include="..\..\source\mact\include\_control.h" />
<ClInclude Include="..\..\source\mact\src\_scrplib.h" />
<ClInclude Include="..\..\source\mact\include\animlib.h" />
@ -370,6 +372,8 @@
<ClCompile Include="..\..\source\audiolib\src\multivoc.cpp" />
<ClCompile Include="..\..\source\audiolib\src\pitch.cpp" />
<ClCompile Include="..\..\source\audiolib\src\vorbis.cpp" />
<ClCompile Include="..\..\source\glad\src\glad.c" />
<ClCompile Include="..\..\source\glad\src\glad_wgl.c" />
<ClCompile Include="..\..\source\mact\src\animlib.cpp" />
<ClCompile Include="..\..\source\mact\src\control.cpp" />
<ClCompile Include="..\..\source\mact\src\file_lib.cpp" />

View file

@ -82,6 +82,18 @@
<Filter Include="touchcontrols\source">
<UniqueIdentifier>{ed032f74-5d34-4314-9579-6a031cf615f1}</UniqueIdentifier>
</Filter>
<Filter Include="glad">
<UniqueIdentifier>{7cc363ab-f5ca-4caa-b082-a4b7b19a4b04}</UniqueIdentifier>
</Filter>
<Filter Include="glad\headers">
<UniqueIdentifier>{965e9834-14d4-48c6-a5b4-016d0bb5290e}</UniqueIdentifier>
</Filter>
<Filter Include="glad\source">
<UniqueIdentifier>{46fa3902-239e-408c-ad6d-29fb433f50f2}</UniqueIdentifier>
</Filter>
<Filter Include="glad\headers\glad">
<UniqueIdentifier>{51aa430b-dee3-4d5a-b657-6b829491fcdc}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\source\build\include\a.h">
@ -549,6 +561,12 @@
<ClInclude Include="..\..\source\build\include\miniz.h">
<Filter>build\headers</Filter>
</ClInclude>
<ClInclude Include="..\..\source\glad\include\glad\glad.h">
<Filter>glad\headers\glad</Filter>
</ClInclude>
<ClInclude Include="..\..\source\glad\include\glad\glad_wgl.h">
<Filter>glad\headers\glad</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\source\build\src\a-c.cpp">
@ -965,6 +983,12 @@
<ClCompile Include="..\..\source\build\src\miniz.c">
<Filter>build\source</Filter>
</ClCompile>
<ClCompile Include="..\..\source\glad\src\glad.c">
<Filter>glad\source</Filter>
</ClCompile>
<ClCompile Include="..\..\source\glad\src\glad_wgl.c">
<Filter>glad\source</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="msvc.mak">

View file

@ -35,6 +35,12 @@ ENET_OBJ=$(obj)\$(ENET)
ENET_INC=$(ENET_ROOT)\include
ENET_SRC=$(ENET_ROOT)\src
GLAD=glad
GLAD_ROOT=$(source)\$(GLAD)
GLAD_OBJ=$(obj)\$(GLAD)
GLAD_INC=$(GLAD_ROOT)\include
GLAD_SRC=$(GLAD_ROOT)\src
LIBXMPLITE=libxmp-lite
LIBXMPLITE_ROOT=$(source)\$(LIBXMPLITE)
LIBXMPLITE_OBJ=$(obj)\$(LIBXMPLITE)
@ -101,7 +107,7 @@ AS=ml
LINK=link /nologo /opt:ref
MT=mt
CFLAGS= /MT /J /nologo /std:c++latest $(flags_cl) \
/I$(DUKE3D_SRC) /I$(ENGINE_INC)\msvc /I$(ENGINE_INC) /I$(MACT_INC) /I$(AUDIOLIB_INC) /I$(ENET_INC) /I$(LIBXMPLITE_INC) \
/I$(DUKE3D_SRC) /I$(ENGINE_INC)\msvc /I$(ENGINE_INC) /I$(MACT_INC) /I$(AUDIOLIB_INC) /I$(ENET_INC) /I$(GLAD_INC) /I$(LIBXMPLITE_INC) \
/W2 $(ENGINEOPTS) \
/I$(PLATFORM)\include /DRENDERTYPE$(RENDERTYPE)=1 /DMIXERTYPE$(MIXERTYPE)=1 /DSDL_USEFOLDER /DSDL_TARGET=2
@ -194,6 +200,11 @@ ENET_OBJS=$(ENET_OBJ)\callbacks.$o \
$(ENET_OBJ)\win32.$o \
$(ENET_OBJ)\compress.$o
GLAD_OBJS=$(GLAD_OBJ)\glad.$o \
!if ("$(RENDERTYPE)"=="WIN")
$(GLAD_OBJ)\glad_wgl.$o
!endif
LIBXMPLITE_OBJS=$(LIBXMPLITE_OBJ)\control.$o \
$(LIBXMPLITE_OBJ)\dataio.$o \
$(LIBXMPLITE_OBJ)\effects.$o \
@ -315,6 +326,7 @@ DUKE3D_EDITOR_OBJS=$(DUKE3D_EDITOR_OBJS) $(MUSICOBJ)
CHECKDIR_ENGINE=@if not exist "$(ENGINE_OBJ)" mkdir "$(ENGINE_OBJ)"
CHECKDIR_DUKE3D=@if not exist "$(DUKE3D_OBJ)" mkdir "$(DUKE3D_OBJ)"
CHECKDIR_ENET=@if not exist "$(ENET_OBJ)" mkdir "$(ENET_OBJ)"
CHECKDIR_GLAD=@if not exist "$(GLAD_OBJ)" mkdir "$(GLAD_OBJ)"
CHECKDIR_MACT=@if not exist "$(MACT_OBJ)" mkdir "$(MACT_OBJ)"
CHECKDIR_AUDIOLIB=@if not exist "$(AUDIOLIB_OBJ)" mkdir "$(AUDIOLIB_OBJ)"
CHECKDIR_LIBXMPLITE=@if not exist "$(LIBXMPLITE_OBJ)" mkdir "$(LIBXMPLITE_OBJ)"
@ -341,6 +353,10 @@ MAPSTER32_TARGET=$(root)\mapster32$(EXESUFFIX)
$(CHECKDIR_ENET)
$(CC) /c $(CFLAGS) $(ENET_CFLAGS) /Fo$@ $<
{$(GLAD_SRC)}.c{$(GLAD_OBJ)}.$o:
$(CHECKDIR_GLAD)
$(CC) /c $(CFLAGS) /Fo$@ $<
{$(LIBXMPLITE_SRC)}.c{$(LIBXMPLITE_OBJ)}.$o:
$(CHECKDIR_LIBXMPLITE)
$(CC) /c $(CFLAGS) $(LIBXMPLITE_CFLAGS) /Fo$@ $<
@ -371,11 +387,11 @@ MAPSTER32_TARGET=$(root)\mapster32$(EXESUFFIX)
all: $(EDUKE32_TARGET) $(MAPSTER32_TARGET)
$(EDUKE32_TARGET): $(DUKE3D_OBJS) $(ENGINE_OBJS) $(AUDIOLIB_OBJS) $(MACT_OBJS) $(ENET_OBJS) $(LIBXMPLITE_OBJS)
$(EDUKE32_TARGET): $(DUKE3D_OBJS) $(ENGINE_OBJS) $(AUDIOLIB_OBJS) $(MACT_OBJS) $(ENET_OBJS) $(GLAD_OBJS) $(LIBXMPLITE_OBJS)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS $(WINMACHINE) /LIBPATH:$(PLATFORM)\lib$(WINLIB) $(flags_link) /MAP $** $(LIBS)
$(MT) -manifest $(DUKE3D_RSRC)\manifest.game.xml -hashupdate -outputresource:$@ -out:$@.manifest
$(MAPSTER32_TARGET): $(DUKE3D_EDITOR_OBJS) $(ENGINE_OBJS) $(ENGINE_EDITOR_OBJS) $(AUDIOLIB_OBJS)
$(MAPSTER32_TARGET): $(DUKE3D_EDITOR_OBJS) $(ENGINE_OBJS) $(ENGINE_EDITOR_OBJS) $(AUDIOLIB_OBJS) $(GLAD_OBJS)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS $(WINMACHINE) /LIBPATH:$(PLATFORM)\lib$(WINLIB) $(flags_link) /MAP $** $(LIBS)
$(MT) -manifest $(DUKE3D_RSRC)\manifest.build.xml -hashupdate -outputresource:$@ -out:$@.manifest
@ -386,5 +402,5 @@ $(MAPSTER32_TARGET): $(DUKE3D_EDITOR_OBJS) $(ENGINE_OBJS) $(ENGINE_EDITOR_OBJS)
clean:
-del /Q $(EDUKE32_TARGET) $(MAPSTER32_TARGET) $(DUKE3D_OBJS) $(DUKE3D_EDITOR_OBJS) $(ENGINE_OBJS) $(ENGINE_EDITOR_OBJS) *.pdb $(root)\*.pdb $(root)\*.map $(root)\*.manifest
-del /Q $(ENET_OBJS) $(LIBXMPLITE_OBJS) $(MACT_OBJS) $(AUDIOLIB_OBJS)
-del /Q $(ENET_OBJS) $(LIBXMPLITE_OBJS) $(MACT_OBJS) $(AUDIOLIB_OBJS) $(GLAD_OBJS)
veryclean: clean

View file

@ -385,17 +385,21 @@ static GLuint polymost2_compileShader(GLenum shaderType, const char* const sourc
NULL);
glCompileShader(shaderID);
int compileStatus[1];
glGetShaderiv(shaderID, GL_COMPILE_STATUS, compileStatus);
OSD_Printf("Compile Status: %u\n", compileStatus[0]);
GLint compileStatus;
glGetShaderiv(shaderID, GL_COMPILE_STATUS, &compileStatus);
OSD_Printf("Compile Status: %u\n", compileStatus);
int logLength[1];
glGetShaderiv(shaderID, GL_INFO_LOG_LENGTH, logLength);
if (logLength[0] > 0)
if (!compileStatus)
{
char infoLog[logLength[0]];
glGetShaderInfoLog(shaderID, logLength[0], NULL, infoLog);
OSD_Printf("Log:\n%s\n", infoLog);
GLint logLength;
glGetShaderiv(shaderID, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0)
{
char *infoLog = (char*) malloc(logLength);
glGetShaderInfoLog(shaderID, logLength, &logLength, infoLog);
OSD_Printf("Log:\n%s\n", infoLog);
free(infoLog);
}
}
return shaderID;