Jump to content

SpiderPig

Members
  • Posts

    2,412
  • Joined

  • Last visited

Posts posted by SpiderPig

  1. Hi guys,  I'm loading multiple packages from within sub folders and it although they are loading correctly and being password verified I cant load files from them.

    The package loads from a folder in my game directory;

    Loaded package!  C:/Users/Matt/Desktop/The Seventh World\GameData\Icons\Icons.zip Verified!

    Then I load an icon which fails;

    Error: Failed to load texture "C:/Users/Matt/Desktop/The Seventh World/GameData/Icons/Bark.tex"

    But this works;

    Loading texture "C:/Users/Matt/Desktop/The Seventh World/Bark.tex"

    It seems loading a package doesn't register itself with it's own directory but to that of the game directory?  @Joshis this a bug?

  2. I think what I'll end up doing is releasing the instance and creating a new instance of a harvested plant.

    int closestIndex = 25;
    if(window->keyHit(Key::E) == true){
    	instance[closestIndex]->Release();
    	instance[closestIndex] = harvestedPlant->Instance();
    }

    This means I could add different geometry in as well, like broken branches or something.

  3. I'm creating instances of a lot of vegetation.  When the player harvests a plant I wanted the material / texture to change to show it had been harvested.

    Model* plant = Model::Load("plant.mdl");
    Material* harvested = Material::Load("Harvested.mat");
    
    Entity* instances[100];
    
    //Load
    for(int id=0;id<100;id++) {
    	Instances[id] = plant->Instance();                  
    }
    
    //InGame
    int closestIndex = 25;
    if(window->keyHit(Key::E) == true){
    	instance[closestIndex]->SetMaterial(harvested);
    }

    This is essentially what I'm doing except setting the material of one changes all the instances.

    I can't use a copy because it can't be used in real-time.  As the player moves I create the foliage around them as required.

  4. PickInfo.triangle returns -1 for me, and PickInfo.face is NULL.  This is my code;

    Vec3 _mPos = window->GetMousePosition();
    PickInfo _pickInfo;
    if (camera->Pick(_mPos.x, _mPos.y, _pickInfo, 0.01f, true) == true) {
    	int _index = _pickInfo.triangle;
    	auto _face = _pickInfo.face;
    }

    Is there a way to get this data?

  5. Thanks.  Working now :D

    int _index = comboboxFullscreen->GetSelectedIndex();
    bool _oldFullscreenValue = Base::Config::fullScreen;
    Base::Config::fullScreen = (_index == 0 ? true : false);
    
    if (_oldFullscreenValue != Base::Config::fullScreen) {
    	Context::GetCurrent()->Release();
    	Window::GetCurrent()->Release();
    	
    	int _xPos = (Base::Config::fullScreen == true ? 0 : Base::desktopWidth / 2);
    	int _yPos = (Base::Config::fullScreen == true ? 0 : Base::desktopHeight / 2);
    	auto _newWindow = Window::Create(Base::GameTitle, _xPos, _yPos, Base::Config::screenWidth, Base::Config::screenHeight, (Base::Config::fullScreen == true ? Window::FullScreen : Window::Titlebar));
    	auto _context = Context::Create(_newWindow);
    }
    else {
    	Window::GetCurrent()->SetLayout((Base::desktopWidth / 2) - (Base::Config::screenWidth / 2),
    		(Base::desktopHeight / 2) - (Base::Config::screenHeight / 2),
    		Base::Config::screenWidth, Base::Config::screenHeight);
    }

     

    • Upvote 2
  6. Yeah I can change the resolution while it's running, but the only option I see for setting full-screen is in the Window::Create() function.  I was looking for window->SetFullscreenMode(bool) or something similar.  I'm wondering if releasing the window and recreating will cause problems... I should try it...

  7. I created a class specifically for steam callbacks;

    #header
    
    class cSteamCallbacks
    {
    private:
    	STEAM_CALLBACK(cSteamCallbacks, _onGameOverlayActivated, GameOverlayActivated_t);
    
    public:
    	bool steamOverlayActive = false;
    };
    #cpp
    
    void cSteamCallbacks::_onGameOverlayActivated(GameOverlayActivated_t * pCallback)
    {
    	if (pCallback->m_bActive == 1) {
    		steamOverlayActive = true;
    	}
    	else {
    		steamOverlayActive = false;
    	}
    }
    #App.cpp
    
    cSteamCallback* steamCallback = nullptr;
    
    bool _steamSuccess = Steamworks::Initialize();
    if (_steamSuccess == true) {
    	steamCallback = new cSteamCallback();
    }
    
    #Loop
    if(steamCallback->steamOverlayActive == false){
    	//Update mouse interaction
    }

     

    • Like 2
    • Upvote 1
×
×
  • Create New...