Yea I was thinking of doing this but if I wanted more then one torch I would have trouble
You could implent a basic lightmap:
Setup an array as big as your screen:
- Reset lightmap to 0 (black)
- Do one pass and fill this lightmap, you would basically take your lightsources, fill in whites in your lightmap at their position (use some fade out formula so it gets darker further away from the light source)
- Alpha blend (multiplicative blend) the screen with your lightmap
Although, doing this in software is gonna be pretty slow if you use a high resolution.