Przeglądaj źródła

* configure.ac:

+ Check for sys/times.h and unistd.h.
    + Added calls to AC_C_CONST and AC_C_INLINE.
  * src/time.c src/graphics.c:
    + Fixes for MSVC compilation warnings.
    + Additional sanity checks in the Win32 driver.
  * src/caca.c:
    + Use raw()/noraw() in the curses driver instead of cbreak().
  * msvc/libcaca.sln:
    + Added an MSVC solution.
  * examples/aafire.c:
    + Slightly reduced the maximum cacafire framerate.
tags/v0.99.beta14
Sam Hocevar sam 21 lat temu
rodzic
commit
1257f58fbb
17 zmienionych plików z 1039 dodań i 16 usunięć
  1. +1
    -1
      Makefile.am
  2. +6
    -2
      configure.ac
  3. +1
    -1
      examples/aafire.c
  4. +0
    -1
      examples/cacaview.c
  5. +16
    -0
      msvc/Makefile.am
  6. +122
    -0
      msvc/cacaball.vcproj
  7. +122
    -0
      msvc/cacademo.vcproj
  8. +122
    -0
      msvc/cacafire.vcproj
  9. +122
    -0
      msvc/cacamoir.vcproj
  10. +122
    -0
      msvc/cacaplas.vcproj
  11. +122
    -0
      msvc/cacaview.vcproj
  12. +47
    -0
      msvc/config.h
  13. +63
    -0
      msvc/libcaca.sln
  14. +142
    -0
      msvc/libcaca.vcproj
  15. +5
    -1
      src/caca.c
  16. +16
    -4
      src/graphics.c
  17. +10
    -6
      src/time.c

+ 1
- 1
Makefile.am Wyświetl plik

@@ -1,7 +1,7 @@
# $Id$

SUBDIRS = src examples test doc
DIST_SUBDIRS = $(SUBDIRS) autotools debian
DIST_SUBDIRS = $(SUBDIRS) autotools debian msvc

EXTRA_DIST = BUGS NOTES bootstrap build-win32 caca-config.in libcaca.spec
AUTOMAKE_OPTIONS = dist-bzip2


+ 6
- 2
configure.ac Wyświetl plik

@@ -13,6 +13,9 @@ AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_RANLIB

AC_C_CONST
AC_C_INLINE

dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
dnl now otherwise it might be set in an obscure if statement.
AC_EGREP_CPP(foo, foo)
@@ -28,8 +31,8 @@ AC_ARG_ENABLE(conio,
AC_ARG_ENABLE(x11,
[ --enable-x11 X11 support (autodetected)])

AC_CHECK_HEADERS(inttypes.h endian.h)
AC_CHECK_FUNCS(vsnprintf getenv putenv strcasecmp usleep gettimeofday)
AC_CHECK_HEADERS(sys/time.h inttypes.h endian.h unistd.h)
AC_CHECK_FUNCS(vsnprintf _vsnprintf getenv putenv strcasecmp usleep gettimeofday)
AC_MSG_CHECKING(for Sleep)
AC_TRY_COMPILE([#include <windows.h>],[Sleep(42);],
[AC_MSG_RESULT(yes)
@@ -191,6 +194,7 @@ AC_CONFIG_FILES([
doc/doxygen.cfg
autotools/Makefile
debian/Makefile
msvc/Makefile
])
AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
AC_OUTPUT


+ 1
- 1
examples/aafire.c Wyświetl plik

@@ -100,7 +100,7 @@ initialize (void)
printf ("Failed to initialize libcaca\n");
exit (1);
}
caca_set_delay(0);
caca_set_delay(10000);
XSIZ = caca_get_width() * 2;
YSIZ = caca_get_height() * 2 - 4;
#else


+ 0
- 1
examples/cacaview.c Wyświetl plik

@@ -26,7 +26,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

#if defined(HAVE_IMLIB2_H)
# include <Imlib2.h>


+ 16
- 0
msvc/Makefile.am Wyświetl plik

@@ -0,0 +1,16 @@
# $Id$

NULL =

EXTRA_DIST = \
libcaca.sln \
config.h \
libcaca.vcproj \
cacaball.vcproj \
cacademo.vcproj \
cacafire.vcproj \
cacamoir.vcproj \
cacaplas.vcproj \
cacaview.vcproj \
$(NULL)


+ 122
- 0
msvc/cacaball.vcproj Wyświetl plik

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="cacaball"
ProjectGUID="{7C6ECE78-045C-458D-8B8F-DEC2C9CB9C14}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacaball.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/cacaball.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacaball.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\examples\cacaball.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

+ 122
- 0
msvc/cacademo.vcproj Wyświetl plik

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="cacademo"
ProjectGUID="{C2C2652D-A50D-4803-90B5-0DCD041980CF}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacademo.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/cacademo.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacademo.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\examples\demo.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

+ 122
- 0
msvc/cacafire.vcproj Wyświetl plik

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="cacafire"
ProjectGUID="{F25D1237-9ED8-4343-B958-308C95FE392F}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="LIBCACA=1"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacafire.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/cacafire.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="LIBCACA=1"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacafire.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\examples\aafire.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

+ 122
- 0
msvc/cacamoir.vcproj Wyświetl plik

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="cacamoir"
ProjectGUID="{5D336F08-9B06-4C19-94C7-EB423296B83E}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacamoir.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/cacamoir.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacamoir.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\examples\cacamoir.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

+ 122
- 0
msvc/cacaplas.vcproj Wyświetl plik

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="cacaplas"
ProjectGUID="{04CC61FD-CC15-4B08-9028-BD87A63E7365}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacaplas.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/cacaplas.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacaplas.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\examples\cacaplas.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

+ 122
- 0
msvc/cacaview.vcproj Wyświetl plik

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="cacaview"
ProjectGUID="{62E567BD-73B7-4C1E-9919-6423C8A8F72E}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacaview.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/cacaview.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\src;..\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/cacaview.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\examples\cacaview.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

+ 47
- 0
msvc/config.h Wyświetl plik

@@ -0,0 +1,47 @@
/* $Id$ */

#define ALLOCCONSOLE_IN_WINDOWS_H 1
/* #undef HAVE_CONIO_H */
/* #undef HAVE_ENDIAN_H */
#define HAVE_GETENV 1
/* #undef HAVE_GETTIMEOFDAY */
/* #undef HAVE_IMLIB2_H */
/* #undef HAVE_INTTYPES_H */
#define HAVE_MEMORY_H 1
/* #undef HAVE_NCURSES_H */
#define HAVE_PUTENV 1
/* #undef HAVE_SLANG_H */
/* #undef HAVE_SLANG_SLANG_H */
#define HAVE_SLEEP 1
/* #undef HAVE_STDINT_H */
#define HAVE_STDLIB_H 1
/* #undef HAVE_STRCASECMP */
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
/* #undef HAVE_UNISTD_H */
/* #undef HAVE_USLEEP */
/* #undef HAVE_VSNPRINTF */
#define HAVE_WINDOWS_H 1
/* #undef HAVE_X11_XKBLIB_H */
#define HAVE__VSNPRINTF 1
/* #undef NO_MINUS_C_MINUS_O */
#define PACKAGE "libcaca"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
/* #undef SCREENUPDATE_IN_PC_H */
#define STDC_HEADERS 1
/* #undef USE_CONIO */
/* #undef USE_NCURSES */
/* #undef USE_SLANG */
#define USE_WIN32 1
/* #undef USE_X11 */
#define VERSION "0.7"
/* #undef const */
#ifndef __cplusplus
#define inline __inline
#endif

+ 63
- 0
msvc/libcaca.sln Wyświetl plik

@@ -0,0 +1,63 @@
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcaca", "libcaca.vcproj", "{8951ECB0-7CFE-41AB-A426-98D7C441BEA4}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cacaview", "cacaview.vcproj", "{62E567BD-73B7-4C1E-9919-6423C8A8F72E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cacaball", "cacaball.vcproj", "{7C6ECE78-045C-458D-8B8F-DEC2C9CB9C14}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cacademo", "cacademo.vcproj", "{C2C2652D-A50D-4803-90B5-0DCD041980CF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cacafire", "cacafire.vcproj", "{F25D1237-9ED8-4343-B958-308C95FE392F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cacamoir", "cacamoir.vcproj", "{5D336F08-9B06-4C19-94C7-EB423296B83E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cacaplas", "cacaplas.vcproj", "{04CC61FD-CC15-4B08-9028-BD87A63E7365}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
{62E567BD-73B7-4C1E-9919-6423C8A8F72E}.0 = {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}
{7C6ECE78-045C-458D-8B8F-DEC2C9CB9C14}.0 = {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}
{C2C2652D-A50D-4803-90B5-0DCD041980CF}.0 = {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}
{F25D1237-9ED8-4343-B958-308C95FE392F}.0 = {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}
{5D336F08-9B06-4C19-94C7-EB423296B83E}.0 = {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}
{04CC61FD-CC15-4B08-9028-BD87A63E7365}.0 = {8951ECB0-7CFE-41AB-A426-98D7C441BEA4}
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Debug.ActiveCfg = Debug|Win32
{8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Debug.Build.0 = Debug|Win32
{8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Release.ActiveCfg = Release|Win32
{8951ECB0-7CFE-41AB-A426-98D7C441BEA4}.Release.Build.0 = Release|Win32
{62E567BD-73B7-4C1E-9919-6423C8A8F72E}.Debug.ActiveCfg = Debug|Win32
{62E567BD-73B7-4C1E-9919-6423C8A8F72E}.Debug.Build.0 = Debug|Win32
{62E567BD-73B7-4C1E-9919-6423C8A8F72E}.Release.ActiveCfg = Release|Win32
{62E567BD-73B7-4C1E-9919-6423C8A8F72E}.Release.Build.0 = Release|Win32
{7C6ECE78-045C-458D-8B8F-DEC2C9CB9C14}.Debug.ActiveCfg = Debug|Win32
{7C6ECE78-045C-458D-8B8F-DEC2C9CB9C14}.Debug.Build.0 = Debug|Win32
{7C6ECE78-045C-458D-8B8F-DEC2C9CB9C14}.Release.ActiveCfg = Release|Win32
{7C6ECE78-045C-458D-8B8F-DEC2C9CB9C14}.Release.Build.0 = Release|Win32
{C2C2652D-A50D-4803-90B5-0DCD041980CF}.Debug.ActiveCfg = Debug|Win32
{C2C2652D-A50D-4803-90B5-0DCD041980CF}.Debug.Build.0 = Debug|Win32
{C2C2652D-A50D-4803-90B5-0DCD041980CF}.Release.ActiveCfg = Release|Win32
{C2C2652D-A50D-4803-90B5-0DCD041980CF}.Release.Build.0 = Release|Win32
{F25D1237-9ED8-4343-B958-308C95FE392F}.Debug.ActiveCfg = Debug|Win32
{F25D1237-9ED8-4343-B958-308C95FE392F}.Debug.Build.0 = Debug|Win32
{F25D1237-9ED8-4343-B958-308C95FE392F}.Release.ActiveCfg = Release|Win32
{F25D1237-9ED8-4343-B958-308C95FE392F}.Release.Build.0 = Release|Win32
{5D336F08-9B06-4C19-94C7-EB423296B83E}.Debug.ActiveCfg = Debug|Win32
{5D336F08-9B06-4C19-94C7-EB423296B83E}.Debug.Build.0 = Debug|Win32
{5D336F08-9B06-4C19-94C7-EB423296B83E}.Release.ActiveCfg = Release|Win32
{5D336F08-9B06-4C19-94C7-EB423296B83E}.Release.Build.0 = Release|Win32
{04CC61FD-CC15-4B08-9028-BD87A63E7365}.Debug.ActiveCfg = Debug|Win32
{04CC61FD-CC15-4B08-9028-BD87A63E7365}.Debug.Build.0 = Debug|Win32
{04CC61FD-CC15-4B08-9028-BD87A63E7365}.Release.ActiveCfg = Release|Win32
{04CC61FD-CC15-4B08-9028-BD87A63E7365}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

+ 142
- 0
msvc/libcaca.vcproj Wyświetl plik

@@ -0,0 +1,142 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="libcaca"
ProjectGUID="{8951ECB0-7CFE-41AB-A426-98D7C441BEA4}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/cacaview.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="4"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/cacaview.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\src\bitmap.c">
</File>
<File
RelativePath="..\src\box.c">
</File>
<File
RelativePath="..\src\caca.c">
</File>
<File
RelativePath="..\src\conic.c">
</File>
<File
RelativePath="..\src\graphics.c">
</File>
<File
RelativePath="..\src\io.c">
</File>
<File
RelativePath="..\src\line.c">
</File>
<File
RelativePath="..\src\math.c">
</File>
<File
RelativePath="..\src\sprite.c">
</File>
<File
RelativePath="..\src\time.c">
</File>
<File
RelativePath="..\src\triangle.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
<File
RelativePath="..\src\caca.h">
</File>
<File
RelativePath="..\src\caca_internals.h">
</File>
<File
RelativePath="config.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

+ 5
- 1
src/caca.c Wyświetl plik

@@ -138,7 +138,7 @@ int caca_init(void)
initscr();
keypad(stdscr, TRUE);
nonl();
cbreak();
raw();
noecho();
nodelay(stdscr, TRUE);
curs_set(0);
@@ -172,6 +172,9 @@ int caca_init(void)
#if defined(USE_WIN32)
if(_caca_driver == CACA_DRIVER_WIN32)
{
if(!AllocConsole())
return -1;

win32_hin = GetStdHandle(STD_INPUT_HANDLE);
win32_hout = CreateFile("CONOUT$", GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
@@ -380,6 +383,7 @@ void caca_end(void)
{
mousemask(oldmask, NULL);
curs_set(1);
noraw();
endwin();
}
else


+ 16
- 4
src/graphics.c Wyświetl plik

@@ -64,7 +64,9 @@ typedef unsigned char uint8_t;
#include <stdio.h> /* BUFSIZ */
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include <stdarg.h>

#include "caca.h"
@@ -818,18 +820,21 @@ int _caca_init_graphics(void)
win32_front = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
0, NULL,
CONSOLE_TEXTMODE_BUFFER, NULL);
if(!win32_front)
if(!win32_front || win32_front == INVALID_HANDLE_VALUE)
return -1;

win32_back = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
0, NULL,
CONSOLE_TEXTMODE_BUFFER, NULL);
if(!win32_back)
if(!win32_back || win328back == INVALID_HANDLE_VALUE)
return -1;

if(!GetConsoleScreenBufferInfo(win32_hout, &csbi))
return -1;

/* Sample code to get the biggest possible window */
//size = GetLargestConsoleWindowSize(win32_hout);

_caca_width = csbi.srWindow.Right - csbi.srWindow.Left + 1;
_caca_height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;

@@ -842,6 +847,7 @@ int _caca_init_graphics(void)
SetConsoleMode(win32_back, 0);

GetConsoleCursorInfo(win32_front, &cci);
cci.dwSize = 0;
cci.bVisible = FALSE;
SetConsoleCursorInfo(win32_front, &cci);
SetConsoleCursorInfo(win32_back, &cci);
@@ -859,7 +865,13 @@ int _caca_init_graphics(void)
return -1;
}

win32_buffer = malloc(sizeof(CHAR_INFO) * _caca_width * _caca_height);
win32_buffer = malloc(_caca_width * _caca_height * sizeof(CHAR_INFO));
if(win32_buffer == NULL)
{
free(win32_attr);
free(win32_char);
return -1;
}

memset(win32_char, 0, _caca_width * _caca_height * sizeof(int));
memset(win32_attr, 0, _caca_width * _caca_height * sizeof(int));


+ 10
- 6
src/time.c Wyświetl plik

@@ -30,14 +30,18 @@
#include "config.h"

#include <stdlib.h>
#include <sys/time.h>
#if defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
#endif
#include <time.h>

#if defined(USE_WIN32)
# include <windows.h>
#endif

#include <unistd.h>
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
#endif

#include "caca.h"
#include "caca_internals.h"
@@ -58,8 +62,8 @@ unsigned int _caca_getticks(struct caca_timer *timer)
#if defined(HAVE_GETTIMEOFDAY)
struct timeval tv;
#elif defined(USE_WIN32)
static long long int freq = -1;
unsigned long long int usec;
static __int64 freq = -1;
unsigned __int64 usec;
#endif
unsigned int ticks = 0;
int new_sec, new_usec;
@@ -76,8 +80,8 @@ unsigned int _caca_getticks(struct caca_timer *timer)
}

QueryPerformanceCounter((LARGE_INTEGER *)&usec);
new_sec = usec * 1000000 / freq / 1000000;
new_usec = (usec * 1000000 / freq) % 1000000;
new_sec = (int)(usec * 1000000 / freq / 1000000);
new_usec = (int)((usec * 1000000 / freq) % 1000000);
#endif

if(timer->last_sec != 0)


Ładowanie…
Anuluj
Zapisz