Initial commit
This commit is contained in:
20
Endoomed.sln
Normal file
20
Endoomed.sln
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Endoomed", "Endoomed\Endoomed.vcxproj", "{B710A45C-2D83-42CD-9F6B-8213F2D54931}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B710A45C-2D83-42CD-9F6B-8213F2D54931}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B710A45C-2D83-42CD-9F6B-8213F2D54931}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B710A45C-2D83-42CD-9F6B-8213F2D54931}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B710A45C-2D83-42CD-9F6B-8213F2D54931}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
85
Endoomed/Endoomed.vcxproj
Normal file
85
Endoomed/Endoomed.vcxproj
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B710A45C-2D83-42CD-9F6B-8213F2D54931}</ProjectGuid>
|
||||
<RootNamespace>Endoomed</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>bin/win32/</OutDir>
|
||||
<IntDir>obj/win32/</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>bin/win32/</OutDir>
|
||||
<IntDir>obj/win32/</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>SDL2.lib;SDL2main.lib;SDL2_image.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>SDL2.lib;SDL2main.lib;SDL2_image.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\main.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
22
Endoomed/Endoomed.vcxproj.filters
Normal file
22
Endoomed/Endoomed.vcxproj.filters
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
BIN
Endoomed/res/codepage.png
Normal file
BIN
Endoomed/res/codepage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
383
Endoomed/src/main.cpp
Normal file
383
Endoomed/src/main.cpp
Normal file
@@ -0,0 +1,383 @@
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_image.h>
|
||||
#include <cstdio>
|
||||
#include <cmath>
|
||||
#include <memory.h>
|
||||
|
||||
#define CHARWIDTH 8
|
||||
#define CHARHEIGHT 16
|
||||
|
||||
enum class EColour : unsigned char
|
||||
{
|
||||
BLACK,
|
||||
BLUE,
|
||||
GREEN,
|
||||
CYAN,
|
||||
RED,
|
||||
MEGENTA,
|
||||
BROWN,
|
||||
LTGREY,
|
||||
DKGREY,
|
||||
LTBLUE,
|
||||
LTGREEN,
|
||||
LTCYAN,
|
||||
LTRED,
|
||||
LTMEGENTA,
|
||||
YELLOW,
|
||||
WHITE
|
||||
};
|
||||
|
||||
SDL_Colour g_aColourTable[] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0xFF }, // BLACK
|
||||
{ 0x00, 0x00, 0xAA, 0xFF }, // BLUE
|
||||
{ 0x00, 0xAA, 0x00, 0xFF }, // GREEN
|
||||
{ 0x00, 0xAA, 0xAA, 0xFF }, // CYAN
|
||||
{ 0xAA, 0x00, 0x00, 0xFF }, // RED
|
||||
{ 0xAA, 0x00, 0xAA, 0xFF }, // MEGENTA
|
||||
{ 0xAA, 0x55, 0x00, 0xFF }, // BROWN
|
||||
{ 0xAA, 0xAA, 0xAA, 0xFF }, // LTGREY
|
||||
{ 0x55, 0x55, 0x55, 0xFF }, // DKGREY
|
||||
{ 0x55, 0x55, 0xFF, 0xFF }, // BLUE
|
||||
{ 0x55, 0xFF, 0x55, 0xFF }, // GREEN
|
||||
{ 0x55, 0xFF, 0xFF, 0xFF }, // CYAN
|
||||
{ 0xFF, 0x55, 0x55, 0xFF }, // RED
|
||||
{ 0xFF, 0x55, 0xFF, 0xFF }, // MEGENTA
|
||||
{ 0xFF, 0xFF, 0x55, 0xFF }, // YELLOW
|
||||
{ 0xFF, 0xFF, 0xFF, 0xFF } // WHITE
|
||||
};
|
||||
|
||||
struct SChar
|
||||
{
|
||||
unsigned char character;
|
||||
EColour bgColour;
|
||||
EColour fgColour;
|
||||
bool blinking;
|
||||
};
|
||||
|
||||
inline int clampi ( int a_iVal, int a_iMin, int a_iMax )
|
||||
{
|
||||
return ( a_iVal < a_iMin ) ? a_iMin : ( a_iVal > a_iMax ) ? a_iMax : a_iVal;
|
||||
}
|
||||
|
||||
static Uint32 TimerCallback ( Uint32 a_uiInterval, void* a_pParam )
|
||||
{
|
||||
SDL_Event event;
|
||||
SDL_UserEvent userEvent;
|
||||
|
||||
userEvent.type = SDL_USEREVENT;
|
||||
userEvent.code = 0;
|
||||
userEvent.data1 = nullptr;
|
||||
userEvent.data2 = nullptr;
|
||||
|
||||
event.type = SDL_USEREVENT;
|
||||
event.user = userEvent;
|
||||
|
||||
SDL_PushEvent ( &event );
|
||||
|
||||
return a_uiInterval;
|
||||
}
|
||||
|
||||
int main ( int argc, char** argv )
|
||||
{
|
||||
if ( SDL_Init ( SDL_INIT_VIDEO ) < 0 )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( !( IMG_Init ( IMG_INIT_PNG ) & IMG_INIT_PNG ) )
|
||||
{
|
||||
SDL_Quit ();
|
||||
return -1;
|
||||
}
|
||||
|
||||
SDL_Window* pWindow = nullptr;
|
||||
SDL_Renderer* pRenderer = nullptr;
|
||||
if ( SDL_CreateWindowAndRenderer ( 640, 400, 0, &pWindow, &pRenderer ) < 0 )
|
||||
{
|
||||
IMG_Quit ();
|
||||
SDL_Quit ();
|
||||
return -1;
|
||||
}
|
||||
|
||||
SDL_SetWindowTitle ( pWindow, "EnDOOMed" );
|
||||
|
||||
SDL_Texture* pCodepage = IMG_LoadTexture ( pRenderer, "codepage.png" );
|
||||
if ( pCodepage == nullptr )
|
||||
{
|
||||
SDL_DestroyRenderer ( pRenderer );
|
||||
SDL_DestroyWindow ( pWindow );
|
||||
IMG_Quit ();
|
||||
SDL_Quit ();
|
||||
return -1;
|
||||
}
|
||||
|
||||
SChar aDisplay[2000];
|
||||
memset ( aDisplay, 0, sizeof(aDisplay) );
|
||||
|
||||
FILE* pFile = fopen ( "ENDOOM.bin", "rb" );
|
||||
if ( pFile == nullptr )
|
||||
{
|
||||
SDL_DestroyTexture ( pCodepage );
|
||||
SDL_DestroyRenderer ( pRenderer );
|
||||
SDL_DestroyWindow ( pWindow );
|
||||
IMG_Quit ();
|
||||
SDL_Quit ();
|
||||
return -1;
|
||||
}
|
||||
|
||||
for ( int i = 0; i < 2000; ++i )
|
||||
{
|
||||
SChar& currentCharacter = aDisplay[i];
|
||||
|
||||
unsigned char ucSpecial;
|
||||
fread ( ¤tCharacter.character, sizeof(unsigned char), 1, pFile );
|
||||
fread ( &ucSpecial, sizeof(unsigned char), 1, pFile );
|
||||
|
||||
currentCharacter.bgColour = EColour(( ucSpecial & 112 ) >> 4);
|
||||
currentCharacter.fgColour = EColour(ucSpecial & 15);
|
||||
currentCharacter.blinking = ( ucSpecial & 128 > 0 ) ? true : false;
|
||||
}
|
||||
|
||||
SDL_AddTimer ( 400, TimerCallback, nullptr );
|
||||
|
||||
SChar leftBrush;
|
||||
leftBrush.character = 219;
|
||||
leftBrush.bgColour = EColour::BLACK;
|
||||
leftBrush.fgColour = EColour::LTGREY;
|
||||
leftBrush.blinking = false;
|
||||
|
||||
SChar rightBrush;
|
||||
rightBrush.character = ' ';
|
||||
rightBrush.bgColour = EColour::BLACK;
|
||||
rightBrush.fgColour = EColour::LTGREY;
|
||||
rightBrush.blinking = false;
|
||||
|
||||
bool bMouseLeft = false, bMouseRight = false;
|
||||
int iMousePrevX = 0, iMousePrevY = 0;
|
||||
int iMouseX = 0, iMouseY = 0;
|
||||
bool bMouseInWindow = false;
|
||||
|
||||
bool bValidRender = false;
|
||||
bool bBlinkState = true;
|
||||
bool bRunning = true;
|
||||
SDL_Event event;
|
||||
while ( bRunning )
|
||||
{
|
||||
iMousePrevX = iMouseX;
|
||||
iMousePrevY = iMouseY;
|
||||
|
||||
SDL_PumpEvents ();
|
||||
if ( SDL_WaitEvent ( &event ) )
|
||||
{
|
||||
do
|
||||
{
|
||||
switch ( event.type )
|
||||
{
|
||||
case ( SDL_QUIT ):
|
||||
{
|
||||
bRunning = false;
|
||||
break;
|
||||
}
|
||||
case ( SDL_USEREVENT ):
|
||||
{
|
||||
bBlinkState = !bBlinkState;
|
||||
bValidRender = false;
|
||||
break;
|
||||
}
|
||||
case ( SDL_MOUSEBUTTONDOWN ):
|
||||
{
|
||||
if ( event.button.button == SDL_BUTTON_LEFT )
|
||||
{
|
||||
bMouseLeft = true;
|
||||
}
|
||||
else
|
||||
if ( event.button.button == SDL_BUTTON_RIGHT )
|
||||
{
|
||||
bMouseRight = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ( SDL_MOUSEBUTTONUP ):
|
||||
{
|
||||
if ( event.button.button == SDL_BUTTON_LEFT )
|
||||
{
|
||||
bMouseLeft = false;
|
||||
}
|
||||
else
|
||||
if ( event.button.button == SDL_BUTTON_RIGHT )
|
||||
{
|
||||
bMouseRight = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ( SDL_MOUSEMOTION ):
|
||||
{
|
||||
iMouseX = event.motion.x;
|
||||
iMouseY = event.motion.y;
|
||||
break;
|
||||
}
|
||||
case ( SDL_WINDOWEVENT ):
|
||||
{
|
||||
switch ( event.window.event )
|
||||
{
|
||||
case ( SDL_WINDOWEVENT_LEAVE ):
|
||||
{
|
||||
bMouseInWindow = false;
|
||||
break;
|
||||
};
|
||||
case ( SDL_WINDOWEVENT_ENTER ):
|
||||
{
|
||||
bMouseInWindow = true;
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while ( SDL_PollEvent ( &event ) > 0 );
|
||||
}
|
||||
|
||||
if ( bMouseInWindow && ( bMouseLeft || bMouseRight ) )
|
||||
{
|
||||
int iFromX = clampi ( iMouseX / CHARWIDTH, 0, 79 );
|
||||
int iFromY = clampi ( iMouseY / CHARHEIGHT, 0, 24 );
|
||||
int iToX = clampi ( iMousePrevX / CHARWIDTH, 0, 79 );
|
||||
int iToY = clampi ( iMousePrevY / CHARHEIGHT, 0, 24 );
|
||||
|
||||
SChar* srcChar = nullptr;
|
||||
if ( bMouseLeft )
|
||||
{
|
||||
srcChar = &leftBrush;
|
||||
}
|
||||
else
|
||||
if ( bMouseRight )
|
||||
{
|
||||
srcChar = &rightBrush;
|
||||
}
|
||||
|
||||
if ( iToX == iFromX && iToY == iFromY )
|
||||
{
|
||||
SChar& dstChar = aDisplay[iToX + iToY * 80];
|
||||
dstChar.blinking = srcChar->blinking;
|
||||
dstChar.bgColour = srcChar->bgColour;
|
||||
dstChar.fgColour = srcChar->fgColour;
|
||||
dstChar.character = srcChar->character;
|
||||
}
|
||||
else
|
||||
{
|
||||
int iTemp;
|
||||
bool bSteep = labs ( iToY - iFromY ) > labs ( iToX - iFromX );
|
||||
if ( bSteep )
|
||||
{
|
||||
iTemp = iFromY;
|
||||
iFromY = iFromX;
|
||||
iFromX = iTemp;
|
||||
|
||||
iTemp = iToY;
|
||||
iToY = iToX;
|
||||
iToX = iTemp;
|
||||
}
|
||||
if ( iFromX > iToX )
|
||||
{
|
||||
iTemp = iToX;
|
||||
iToX = iFromX;
|
||||
iFromX = iTemp;
|
||||
|
||||
iTemp = iToY;
|
||||
iToY = iFromY;
|
||||
iFromY = iTemp;
|
||||
}
|
||||
|
||||
int iDeltaX = iToX - iFromX;
|
||||
int iDeltaY = labs ( iToY - iFromY );
|
||||
int iError = iDeltaX / 2;
|
||||
int iY = iFromY;
|
||||
int iYStep = ( iFromY < iToY ) ? 1 : -1;
|
||||
for ( int iX = iFromX; iX <= iToX; ++iX )
|
||||
{
|
||||
if ( bSteep )
|
||||
{
|
||||
SChar& dstChar = aDisplay[iY + iX * 80];
|
||||
dstChar.blinking = srcChar->blinking;
|
||||
dstChar.bgColour = srcChar->bgColour;
|
||||
dstChar.fgColour = srcChar->fgColour;
|
||||
dstChar.character = srcChar->character;
|
||||
}
|
||||
else
|
||||
{
|
||||
SChar& dstChar = aDisplay[iX + iY * 80];
|
||||
dstChar.blinking = srcChar->blinking;
|
||||
dstChar.bgColour = srcChar->bgColour;
|
||||
dstChar.fgColour = srcChar->fgColour;
|
||||
dstChar.character = srcChar->character;
|
||||
}
|
||||
|
||||
iError -= iDeltaY;
|
||||
if ( iError < 0 )
|
||||
{
|
||||
iY += iYStep;
|
||||
iError += iDeltaX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bValidRender = false;
|
||||
}
|
||||
|
||||
if ( !bValidRender )
|
||||
{
|
||||
SDL_SetRenderDrawColor ( pRenderer, 48, 48, 48, 255 );
|
||||
SDL_RenderClear ( pRenderer );
|
||||
|
||||
SDL_Rect src, dst;
|
||||
|
||||
src.w = CHARWIDTH;
|
||||
src.h = CHARHEIGHT;
|
||||
dst.w = CHARWIDTH;
|
||||
dst.h = CHARHEIGHT;
|
||||
|
||||
int iX = 0, iY = 0;
|
||||
for ( int i = 0; i < 2000; ++i )
|
||||
{
|
||||
SChar& currentCharacter = aDisplay[i];
|
||||
SDL_Colour& currentBgColour = g_aColourTable[(unsigned char)aDisplay[i].bgColour];
|
||||
SDL_Colour& currentFgColour = g_aColourTable[(unsigned char)aDisplay[i].fgColour];
|
||||
|
||||
src.x = ( currentCharacter.character % 32 ) * CHARWIDTH;
|
||||
src.y = ( currentCharacter.character / 32 ) * CHARHEIGHT;
|
||||
dst.x = iX * CHARWIDTH;
|
||||
dst.y = iY * CHARHEIGHT;
|
||||
|
||||
SDL_SetRenderDrawColor ( pRenderer, currentBgColour.r, currentBgColour.g, currentBgColour.b, currentBgColour.a );
|
||||
SDL_RenderFillRect ( pRenderer, &dst );
|
||||
SDL_SetRenderDrawColor ( pRenderer, 0, 0, 0, currentFgColour.a );
|
||||
|
||||
if ( bBlinkState || !currentCharacter.blinking )
|
||||
{
|
||||
SDL_SetTextureColorMod ( pCodepage, currentFgColour.r, currentFgColour.g, currentFgColour.b );
|
||||
SDL_RenderCopy ( pRenderer, pCodepage, &src, &dst );
|
||||
}
|
||||
|
||||
if ( ++iX >= 80 )
|
||||
{
|
||||
iX = 0;
|
||||
++iY;
|
||||
}
|
||||
}
|
||||
|
||||
SDL_RenderPresent ( pRenderer );
|
||||
bValidRender = true;
|
||||
}
|
||||
}
|
||||
|
||||
fclose ( pFile );
|
||||
SDL_DestroyTexture ( pCodepage );
|
||||
SDL_DestroyRenderer ( pRenderer );
|
||||
SDL_DestroyWindow ( pWindow );
|
||||
IMG_Quit ();
|
||||
SDL_Quit ();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user