Skip to content

Commit

Permalink
[WINDOWS] Embed Atlas texture in exe
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed May 11, 2019
1 parent c277857 commit 476ef4f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Release/
Debug/
StuntCarRacer_2008.VC.db

StuntCarRacer_2008.VC.VC.opendb
*.user
2 changes: 1 addition & 1 deletion StuntCarRacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ HRESULT CALLBACK OnResetDevice( IDirect3DDevice9 *pd3dDevice,
if (CreateCockpitVertexBuffer(pd3dDevice) != S_OK)
return E_FAIL;

if ( FAILED( D3DXCreateTextureFromFile( pd3dDevice, L"Bitmap\\atlas.png", &g_pAtlas ) ) )
if ( FAILED( D3DXCreateTextureFromResource( pd3dDevice, NULL, L"ATLAS", &g_pAtlas ) ) )
return E_FAIL;

InitAtlasCoord();
Expand Down
15 changes: 2 additions & 13 deletions StuntCarRacer.rc
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
// Bitmap
//

/*RoadYellowDark BITMAP "Bitmap\\RoadYellowDark.bmp"
RoadYellowLight BITMAP "Bitmap\\RoadYellowLight.bmp"
RoadRedDark BITMAP "Bitmap\\RoadRedDark.bmp"
RoadRedLight BITMAP "Bitmap\\RoadRedLight.bmp"
RoadBlack BITMAP "Bitmap\\RoadBlack.bmp"
RoadWhite BITMAP "Bitmap\\RoadWhite.bmp"
//Cockpit BITMAP "Bitmap\\cockpit.png"
LeftWheel1 BITMAP "Bitmap\\leftwheel1.png"
LeftWheel2 BITMAP "Bitmap\\leftwheel2.png"
LeftWheel3 BITMAP "Bitmap\\leftwheel3.png"
RightWheel1 BITMAP "Bitmap\\rightwheel1.png"
RightWheel2 BITMAP "Bitmap\\rightwheel2.png"
RightWheel3 BITMAP "Bitmap\\rightwheel3.png"*/
ATLAS RCDATA "Bitmap\\atlas.png"

#endif // English (U.K.) resources
/////////////////////////////////////////////////////////////////////////////

Expand Down
1 change: 1 addition & 0 deletions StuntCarRacer_2008.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@
<Media Include="Sounds\Smash.wav" />
<Media Include="Sounds\TickOver.wav" />
<Media Include="Sounds\Wreck.wav" />
<Media Include="Bitmap\atlas.png" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down

0 comments on commit 476ef4f

Please sign in to comment.