XProger / OpenLara

Classic Tomb Raider open-source engine
http://xproger.info/projects/OpenLara/
BSD 2-Clause "Simplified" License
4.64k stars 360 forks source link

32X - pointer conversion error #416

Closed ChillyWillyGuru closed 2 years ago

ChillyWillyGuru commented 2 years ago

While trying the latest commit for the 32X, I got a compile error:

In file included from render.cpp:59:
rasterizer.h: In function ‘void rasterizeS_c(uint16*, const VertexLink*, const VertexLink*)’:
rasterizer.h:110:58: error: invalid conversion from ‘uint8*’ {aka ‘unsigned char*’} to ‘volatile ColorIndex*’ {aka ‘volatile signed char*’} [-fpermissive]
  110 |                 volatile ColorIndex* ptr = (uint8*)pixel + x1;
      |                                            ~~~~~~~~~~~~~~^~~~
      |                                                          |
      |                                                          uint8* {aka unsigned char*}
make: *** [Makefile:85: build/render.o] Error 1

Adding -fpermissive to the 32X makefile allows the code to compile, but you still get a warning about the conversion. It would probably be better to cast the pointer rather than setting the permissive flag.

Once it's compiled, I tried the binary on my system. I noticed this version has the menu enabled. It looks like the scaling is on the small side - you can't really tell what each entry is without the text telling you. It does work, though. I was able to change the video setting and start a game or go to Lara's house... but when you do so, I only get what looks like a doorframe and a stick figure drawn. I'm guessing there's something not enabled for the full rendering in the code I'm trying. It does get 28 FPS by not drawing much. :)

Oh, and one more bug report - make clean doesn't clean the src-md folder. I guess the main makefile clean target isn't passing along clean to the md makefile. Looking at the main makefile... yeah. You have

clean:
    $(RM) $(BUILD)/* $(TARGET).32x $(TARGET).elf

when you should have

clean:
    make clean -C src-md
    $(RM) $(BUILD)/* $(TARGET).32x $(TARGET).elf