wateret / mengde

A turn-based RPG game engine inspired by 三國志曹操傳.
MIT License
27 stars 10 forks source link

Crashes when using Metal API #112

Closed wateret closed 5 years ago

wateret commented 5 years ago

When try to attack a unit, I get this error.

...
CmdQueue {
Action
}
[INFO] Unit 'CaoCao' moved from (9, 2) to (9, 5)
CmdQueue {
BasicAttack (atk:CaoCao def:LuBu)
EndAction
}
[INFO] Attack(1st) 'CaoCao' -> 'LuBu'
[INFO] Chance of Hit : 100
[INFO] Chance of Critical : 100
[INFO] Chance of Double Attack : 100
[INFO] StateMachine Pushed   [3] Top : StateUIAttack
[FATAL] <texture.cc:105 NewWhitenedTexture()> SDL_LockTexture Failed : That operation is not supported
Process 93623 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010013f14c libgui.dylib`mengde::gui::foundation::Renderer::GetRawRenderer(this=0x0000000000000000) at renderer.cc:80
   77     }
   78   }
   79
-> 80   SDL_Renderer* Renderer::GetRawRenderer() { return handle_; }
   81
   82   uint32_t Renderer::GetPixelFormat() { return pixel_format_; }
   83
Target 0: (game) stopped.
wateret commented 5 years ago

This is when creating a whitened texture for a texture, for critical attack effect.

wateret commented 5 years ago

113 will fix this by not using SDL_LockTexture. It does not seems like supported by all backends.