Question

I have checked out my working code in another windows first time and it started not to see my files in Resources directory. I use cocos2d-x 3.0 RC1 and Visual Studio for development. And when I print full path like this:

CCLOG("---------- file name is %s", 
    cocos2d::CCFileUtils::getInstance()->fullPathForFilename(fileName).c_str());

it prints:

---------- file name is image.png 

What is this? How to tell cocos2d to look into Resources directory? Is this because of settings of visual studio?

Was it helpful?

Solution

This was a Visual Studio problem. In *.vcxproj.user file I had this:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <LocalDebuggerWorkingDirectory>$(ProjectDir)..\Resources</LocalDebuggerWorkingDirectory>
    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LocalDebuggerWorkingDirectory>$(ProjectDir)..\Resources</LocalDebuggerWorkingDirectory>
    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
  </PropertyGroup>
</Project>

which is doing the work. But I have added this file into .gitignore hence, it was not working.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top