solarus-games / solarus

This repository was moved to GitLab: https://gitlab.com/solarus-games/solarus
http://www.solarus-games.org
Other
712 stars 133 forks source link

Internal error: Failed to create software surface #760

Open wrightmat opened 9 years ago

wrightmat commented 9 years ago

Error throws with the following code, the exact line referenced is room_overlay:fill_color. No further details on error, but I thought it might have something to do with overwriting room_overlay?

for i = 1, #rooms do if game:get_value("dungeon_8_room"..i.."_lit") then if room_overlay then room_overlay = nil end room_overlay = sol.surface.create("entities/dark_room.png") room_overlay:draw_region(rooms[i].x, rooms[i].y, 328, 262, dst_surface) else if room_overlay then room_overlay = nil end room_overlay = sol.surface.create(328,262) room_overlay:fill_color{0, 0, 0} room_overlay:set_opacity(0.9 * 255) room_overlay:draw_region(rooms[i].x, rooms[i].y, 328, 262, dst_surface) end end

Diarandor commented 9 years ago

I would try with "room_overlay:fill_color({0, 0, 0})", with the parentheses, instead of "room_overlay:fill_color{0, 0, 0}", to rule out a possible syntax error.

christopho commented 9 years ago

Parentheses are optional when there is a single argument of type table or string. This is a real bug.

christopho commented 9 years ago

Does it work if you disable video acceleration? solarus_run -video-acceleration=no path/to/your/game (or from the preferences of the quest editor)

wrightmat commented 9 years ago

It does not - I still have a fatal crash. Of note, I have several other (working) surfaces that use the same syntax. The only difference (I think) in this case is that I'm reusing the same overlay variable in a loop.