Don't clobber refcounting in SDL_Init.

- Fixes bug 1712 by not overwriting SDL_SubsystemRefCount in SDL_Init.
       - Removes the SDL_initialized variable, and makes SDL_SubsystemRefCount
         the canonical source of truth for whether or not a subsystem has been
         initialized.
       - Refactors SDL_InitSubSystem and SDL_QuitSubSystem to use helper
         functions to manage refcount.
       - Adds automated tests for SDL_Init/Quit*.
       - Adds SDL_bits.h which contains SDL_MostSignificantBitIndex.
This commit is contained in:
Jørgen P. Tjernø 2013-02-12 11:47:31 -08:00
parent 781ab3764f
commit f85aeb98c7
9 changed files with 411 additions and 140 deletions

View file

@ -375,6 +375,10 @@
RelativePath="..\..\include\SDL_audio.h"
>
</File>
<File
RelativePath="..\..\include\SDL_bits.h"
>
</File>
<File
RelativePath="..\..\include\SDL_blendmode.h"
>

View file

@ -207,6 +207,7 @@
<ClInclude Include="..\..\include\SDL_assert.h" />
<ClInclude Include="..\..\include\SDL_atomic.h" />
<ClInclude Include="..\..\include\SDL_audio.h" />
<ClInclude Include="..\..\include\SDL_bits.h" />
<ClInclude Include="..\..\include\SDL_blendmode.h" />
<ClInclude Include="..\..\include\SDL_clipboard.h" />
<ClInclude Include="..\..\include\SDL_config.h" />

View file

@ -211,6 +211,7 @@
<ClInclude Include="..\..\include\SDL_assert.h" />
<ClInclude Include="..\..\include\SDL_atomic.h" />
<ClInclude Include="..\..\include\SDL_audio.h" />
<ClInclude Include="..\..\include\SDL_bits.h" />
<ClInclude Include="..\..\include\SDL_blendmode.h" />
<ClInclude Include="..\..\include\SDL_clipboard.h" />
<ClInclude Include="..\..\include\SDL_config.h" />
@ -454,4 +455,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>