libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
194 stars 40 forks source link

Dynamite Jack hangs at the title screen #133

Closed chewi closed 2 years ago

chewi commented 2 years ago

Tried a few things to no avail. Original SDL1 works fine.

Game::init ...
SDL Runtime Version: 1.2.50
SDL Compile Version: 1.2.14
SDL_BYTEORDER == SDL_LIL_ENDIAN
== joystick init.............
irrKlang sound library version 1.4.0
Loaded plugin: ikpMP3.so
Loaded plugin: ikpFlac.so
Using ALSA driver
udid:1c1b0d9de366-1633903719, name:Anonymous, uid:a:1c1b0d9de366-1633903719 token:0cda58aa2be38f43503552146d446cec
init_video: 1024 768 640 480 320 320 0
_try_init_video(1024,768,0)
VideoInfo->vfmt->BitsPerPixel:32
res: 1
GL_RED_SIZE:0
GL_GREEN_SIZE:0
GL_BLUE_SIZE:0
GL_ALPHA_SIZE:0
GL_DEPTH_SIZE:0
GL_BUFFER_SIZE:0
GL_DOUBLEBUFFER:0
GL_STENCIL_SIZE:0
res: 1024 x 768
vinfo: 1920 x 1080
trying load tex atlas2
doing load tex atlas2 (1)
driver_tex_load ../data/atlas2.png
loaded ../data/atlas2.png as 1
gfx_tex_load: 255 ms, total 255 ms
create_fbo success
create_fbo success
create_fbo success
unable to find img 
trying load tex atlas1
doing load tex atlas1 (2)
driver_tex_load ../data/atlas1.png
loaded ../data/atlas1.png as 5
gfx_tex_load: 0 ms, total 255 ms
trying load tex atlas3
doing load tex atlas3 (3)
driver_tex_load ../data/atlas3.png
loaded ../data/atlas3.png as 6
gfx_tex_load: 0 ms, total 255 ms
trying load tex atlas4
doing load tex atlas4 (4)
driver_tex_load ../data/atlas4.png
loaded ../data/atlas4.png as 7
gfx_tex_load: 77 ms, total 332 ms
trying load tex atlas5
doing load tex atlas5 (5)
driver_tex_load ../data/atlas5.png
loaded ../data/atlas5.png as 8
gfx_tex_load: 240 ms, total 572 ms
trying load tex atlas6
doing load tex atlas6 (6)
driver_tex_load ../data/atlas6.png
loaded ../data/atlas6.png as 9
gfx_tex_load: 232 ms, total 804 ms
trying load tex atlas7
doing load tex atlas7 (7)
driver_tex_load ../data/atlas7.png
loaded ../data/atlas7.png as 10
gfx_tex_load: 1 ms, total 805 ms
trying load tex atlas8
doing load tex atlas8 (8)
driver_tex_load ../data/atlas8.png
loaded ../data/atlas8.png as 11
gfx_tex_load: 231 ms, total 1036 ms
trying load tex atlas9
doing load tex atlas9 (9)
driver_tex_load ../data/atlas9.png
loaded ../data/atlas9.png as 12
gfx_tex_load: 0 ms, total 1036 ms
trying load tex beam.png
doing load tex beam.png (10)
driver_tex_load ../data/beam.png
loaded ../data/beam.png as 13
gfx_tex_load: 0 ms, total 1036 ms
trying load tex black.png
doing load tex black.png (11)
driver_tex_load ../data/black.png
loaded ../data/black.png as 14
gfx_tex_load: 2 ms, total 1038 ms
trying load tex blank.png
doing load tex blank.png (12)
driver_tex_load ../data/blank.png
loaded ../data/blank.png as 15
gfx_tex_load: 0 ms, total 1038 ms
trying load tex blast1.png
doing load tex blast1.png (13)
driver_tex_load ../data/blast1.png
loaded ../data/blast1.png as 16
gfx_tex_load: 1 ms, total 1039 ms
trying load tex blast2.png
doing load tex blast2.png (14)
driver_tex_load ../data/blast2.png
loaded ../data/blast2.png as 17
gfx_tex_load: 0 ms, total 1039 ms
trying load tex blast3.png
doing load tex blast3.png (15)
driver_tex_load ../data/blast3.png
loaded ../data/blast3.png as 18
gfx_tex_load: 1 ms, total 1040 ms
trying load tex blast4.png
doing load tex blast4.png (16)
driver_tex_load ../data/blast4.png
loaded ../data/blast4.png as 19
gfx_tex_load: 1 ms, total 1041 ms
trying load tex blast5.png
doing load tex blast5.png (17)
driver_tex_load ../data/blast5.png
loaded ../data/blast5.png as 20
gfx_tex_load: 1 ms, total 1042 ms
trying load tex box1.png
doing load tex box1.png (18)
driver_tex_load ../data/box1.png
loaded ../data/box1.png as 21
gfx_tex_load: 0 ms, total 1042 ms
trying load tex box2.png
doing load tex box2.png (19)
driver_tex_load ../data/box2.png
loaded ../data/box2.png as 22
gfx_tex_load: 1 ms, total 1043 ms
trying load tex box3.png
doing load tex box3.png (20)
driver_tex_load ../data/box3.png
loaded ../data/box3.png as 23
gfx_tex_load: 1 ms, total 1044 ms
trying load tex box4.png
doing load tex box4.png (21)
driver_tex_load ../data/box4.png
loaded ../data/box4.png as 24
gfx_tex_load: 0 ms, total 1044 ms
trying load tex dot.png
doing load tex dot.png (22)
driver_tex_load ../data/dot.png
loaded ../data/dot.png as 25
gfx_tex_load: 1 ms, total 1045 ms
trying load tex fan.png
doing load tex fan.png (23)
driver_tex_load ../data/fan.png
loaded ../data/fan.png as 26
gfx_tex_load: 6 ms, total 1051 ms
trying load tex font1.png
doing load tex font1.png (24)
driver_tex_load ../data/font1.png
loaded ../data/font1.png as 27
gfx_tex_load: 16 ms, total 1067 ms
trying load tex font15.png
doing load tex font15.png (25)
driver_tex_load ../data/font15.png
loaded ../data/font15.png as 28
gfx_tex_load: 10 ms, total 1077 ms
trying load tex font1s.png
doing load tex font1s.png (26)
driver_tex_load ../data/font1s.png
loaded ../data/font1s.png as 29
gfx_tex_load: 16 ms, total 1093 ms
trying load tex font2.png
doing load tex font2.png (27)
driver_tex_load ../data/font2.png
loaded ../data/font2.png as 30
gfx_tex_load: 5 ms, total 1098 ms
trying load tex font2s.png
doing load tex font2s.png (28)
driver_tex_load ../data/font2s.png
loaded ../data/font2s.png as 31
gfx_tex_load: 5 ms, total 1103 ms
trying load tex font3.png
doing load tex font3.png (29)
driver_tex_load ../data/font3.png
loaded ../data/font3.png as 32
gfx_tex_load: 2 ms, total 1105 ms
trying load tex guard_atlas
doing load tex guard_atlas (30)
driver_tex_load ../data/guard.png
loaded ../data/guard.png as 33
gfx_tex_load: 117 ms, total 1222 ms
trying load tex laser_atlas
doing load tex laser_atlas (31)
driver_tex_load ../data/laser.png
loaded ../data/laser.png as 34
gfx_tex_load: 0 ms, total 1222 ms
trying load tex player_atlas
doing load tex player_atlas (32)
driver_tex_load ../data/player.png
loaded ../data/player.png as 35
gfx_tex_load: 0 ms, total 1222 ms
trying load tex sniper_atlas
doing load tex sniper_atlas (33)
driver_tex_load ../data/sniper.png
loaded ../data/sniper.png as 36
gfx_tex_load: 0 ms, total 1222 ms
trying load tex spider_atlas
doing load tex spider_atlas (34)
driver_tex_load ../data/spider.png
loaded ../data/spider.png as 37
gfx_tex_load: 1 ms, total 1223 ms
trying load tex white.png
doing load tex white.png (35)
driver_tex_load ../data/white.png
loaded ../data/white.png as 38
gfx_tex_load: 1 ms, total 1224 ms
trying load tex zombie_atlas
doing load tex zombie_atlas (36)
driver_tex_load ../data/zombie.png
loaded ../data/zombie.png as 39
gfx_tex_load: 0 ms, total 1224 ms
opening ../data/gameinfo.db in READONLY mode
:: trying load sample sfx-blast
doing load sample sfx-blast
loading: ../data/sfx-blast.wav as 1
:: trying load sample sfx-bomb-drop
doing load sample sfx-bomb-drop
loading: ../data/sfx-bomb-drop.wav as 2
:: trying load sample sfx-bomb-get
doing load sample sfx-bomb-get
loading: ../data/sfx-bomb-get.wav as 3
:: trying load sample sfx-bomb-step
doing load sample sfx-bomb-step
loading: ../data/sfx-bomb-step.wav as 4
:: trying load sample sfx-cartridge-get
doing load sample sfx-cartridge-get
loading: ../data/sfx-cartridge-get.wav as 5
:: trying load sample sfx-detonator-get
doing load sample sfx-detonator-get
loading: ../data/sfx-detonator-get.wav as 6
:: trying load sample sfx-detonator-missing
doing load sample sfx-detonator-missing
loading: ../data/sfx-detonator-missing.wav as 7
:: trying load sample sfx-detonator-use
doing load sample sfx-detonator-use
loading: ../data/sfx-detonator-use.wav as 8
:: trying load sample sfx-die-blast
doing load sample sfx-die-blast
loading: ../data/sfx-die-blast.wav as 9
:: trying load sample sfx-die-guard
doing load sample sfx-die-guard
loading: ../data/sfx-die-guard.wav as 10
:: trying load sample sfx-die-laser
doing load sample sfx-die-laser
loading: ../data/sfx-die-laser.wav as 11
:: trying load sample sfx-die-pit
doing load sample sfx-die-pit
loading: ../data/sfx-die-pit.wav as 12
:: trying load sample sfx-die-sniper
doing load sample sfx-die-sniper
loading: ../data/sfx-die-sniper.wav as 13
:: trying load sample sfx-die-spider
doing load sample sfx-die-spider
loading: ../data/sfx-die-spider.wav as 14
:: trying load sample sfx-die-zombie
doing load sample sfx-die-zombie
loading: ../data/sfx-die-zombie.wav as 15
:: trying load sample sfx-exit
doing load sample sfx-exit
loading: ../data/sfx-exit.wav as 16
:: trying load sample sfx-flashlight-get
doing load sample sfx-flashlight-get
loading: ../data/sfx-flashlight-get.wav as 17
:: trying load sample sfx-flashlight-off
doing load sample sfx-flashlight-off
loading: ../data/sfx-flashlight-off.wav as 18
:: trying load sample sfx-flashlight-on
doing load sample sfx-flashlight-on
loading: ../data/sfx-flashlight-on.wav as 19
:: trying load sample sfx-blast-guard
doing load sample sfx-blast-guard
loading: ../data/sfx-blast-guard.wav as 20
:: trying load sample sfx-blast-laser
doing load sample sfx-blast-laser
loading: ../data/sfx-blast-laser.wav as 21
:: trying load sample sfx-blast-sniper
doing load sample sfx-blast-sniper
loading: ../data/sfx-blast-sniper.wav as 22
:: trying load sample sfx-blast-zombie
doing load sample sfx-blast-zombie
loading: ../data/sfx-blast-zombie.wav as 23
:: trying load sample sfx-guard-alert
doing load sample sfx-guard-alert
loading: ../data/sfx-guard-alert.wav as 24
:: trying load sample sfx-jewel-get
doing load sample sfx-jewel-get
loading: ../data/sfx-jewel-get.wav as 25
:: trying load sample sfx-keycard-get
doing load sample sfx-keycard-get
loading: ../data/sfx-keycard-get.wav as 26
:: trying load sample sfx-lock-locked
doing load sample sfx-lock-locked
loading: ../data/sfx-lock-locked.wav as 27
:: trying load sample sfx-lock-unlock
doing load sample sfx-lock-unlock
loading: ../data/sfx-lock-unlock.wav as 28
:: trying load sample sfx-savept-restore
doing load sample sfx-savept-restore
loading: ../data/sfx-savept-restore.wav as 29
:: trying load sample sfx-savept-save
doing load sample sfx-savept-save
loading: ../data/sfx-savept-save.wav as 30
:: trying load sample sfx-sniper-alert
doing load sample sfx-sniper-alert
loading: ../data/sfx-sniper-alert.wav as 31
:: trying load sample sfx-spider-alert
doing load sample sfx-spider-alert
loading: ../data/sfx-spider-alert.wav as 32
:: trying load sample sfx-tech-blast
doing load sample sfx-tech-blast
loading: ../data/sfx-tech-blast.wav as 33
:: trying load sample sfx-tech-locked
doing load sample sfx-tech-locked
loading: ../data/sfx-tech-locked.wav as 34
:: trying load sample sfx-tech-unlock
doing load sample sfx-tech-unlock
loading: ../data/sfx-tech-unlock.wav as 35
:: trying load sample sfx-trans-fade
doing load sample sfx-trans-fade
loading: ../data/sfx-trans-fade.wav as 36
:: trying load sample sfx-zombie-growl
doing load sample sfx-zombie-growl
loading: ../data/sfx-zombie-growl.wav as 37
:: trying load sample sfx-gui-change
doing load sample sfx-gui-change
loading: ../data/sfx-gui-change.wav as 38
:: trying load sample sfx-gui-click
doing load sample sfx-gui-click
loading: ../data/sfx-gui-click.wav as 39
:: trying load sample sfx-gui-down
doing load sample sfx-gui-down
loading: ../data/sfx-gui-down.wav as 40
:: trying load sample sfx-gui-enter
doing load sample sfx-gui-enter
loading: ../data/sfx-gui-enter.wav as 41
:: trying load sample sfx-map-scroll
doing load sample sfx-map-scroll
loading: ../data/sfx-map-scroll.wav as 42
:: trying load sample sfx-die-scream1
doing load sample sfx-die-scream1
loading: ../data/sfx-die-scream1.wav as 43
:: trying load sample sfx-die-scream2
doing load sample sfx-die-scream2
loading: ../data/sfx-die-scream2.wav as 44
:: trying load sample sfx-die-scream3
doing load sample sfx-die-scream3
loading: ../data/sfx-die-scream3.wav as 45
:: trying load sample sfx-die-scream4
doing load sample sfx-die-scream4
loading: ../data/sfx-die-scream4.wav as 46
:: trying load sample sfx-die-scream5
doing load sample sfx-die-scream5
loading: ../data/sfx-die-scream5.wav as 47
opening ../data/gameinfo.db in READONLY mode
n:0,value:0
init_tile: 0 none
n:1,value:0
init_tile: 1 floor1
n:2,value:0
init_tile: 2 wall1
n:3,value:0
init_tile: 3 pit
n:4,value:257
init_tile: 4 player
n:5,value:258
init_tile: 5 guard
n:6,value:0
init_tile: 6 flashlight
n:7,value:261
init_tile: 7 exit
n:8,value:259
init_tile: 8 arrow1
n:9,value:259
init_tile: 9 arrow2
n:10,value:259
init_tile: 10 arrow3
n:11,value:259
init_tile: 11 arrow4
n:12,value:259
init_tile: 12 arrow6
n:13,value:259
init_tile: 13 arrow7
n:14,value:259
init_tile: 14 arrow8
n:15,value:259
init_tile: 15 arrow9
n:16,value:0
init_tile: 16 edge
n:17,value:0
init_tile: 17 detonator
n:18,value:0
init_tile: 18 jewel
n:19,value:0
init_tile: 19 cartridge
n:20,value:0
init_tile: 20 tech1
n:21,value:0
init_tile: 21 sandbag
n:22,value:0
init_tile: 22 light1
n:23,value:0
init_tile: 23 light2
n:24,value:0
init_tile: 24 light3
n:25,value:0
init_tile: 25 light4
n:26,value:0
init_tile: 26 reaction1
n:27,value:0
init_tile: 27 icon-0
n:28,value:1
init_tile: 28 icon-1
n:29,value:2
init_tile: 29 icon-2
n:30,value:3
init_tile: 30 icon-3
n:31,value:4
init_tile: 31 icon-4
n:32,value:5
init_tile: 32 icon-5
n:33,value:6
init_tile: 33 icon-6
n:34,value:7
init_tile: 34 icon-7
n:35,value:8
init_tile: 35 icon-8
n:36,value:9
init_tile: 36 icon-9
n:37,value:10
init_tile: 37 icon-a
n:38,value:11
init_tile: 38 icon-b
n:39,value:12
init_tile: 39 icon-c
n:40,value:13
init_tile: 40 icon-d
n:41,value:14
init_tile: 41 icon-e
n:42,value:15
init_tile: 42 icon-f
n:43,value:0
init_tile: 43 tech2
n:44,value:0
init_tile: 44 tech3
n:45,value:0
init_tile: 45 lock1
n:46,value:0
init_tile: 46 lock2
n:47,value:0
init_tile: 47 lock3
n:48,value:0
init_tile: 48 reaction2
n:49,value:0
init_tile: 49 reaction3
n:50,value:0
init_tile: 50 unlock
n:51,value:0
init_tile: 51 floor2
n:52,value:0
init_tile: 52 wall2
n:53,value:0
init_tile: 53 wall3
n:54,value:0
init_tile: 54 floor3
n:55,value:260
init_tile: 55 clight1
n:56,value:260
init_tile: 56 clight2
n:57,value:260
init_tile: 57 clight3
n:58,value:260
init_tile: 58 clight4
n:59,value:262
init_tile: 59 toggle-on
n:60,value:262
init_tile: 60 toggle-off
n:61,value:263
init_tile: 61 sniper
n:62,value:0
init_tile: 62 light5
n:63,value:260
init_tile: 63 clight5
n:64,value:0
init_tile: 64 secret
n:65,value:0
init_tile: 65 floor4
n:66,value:0
init_tile: 66 floor5
n:67,value:0
init_tile: 67 wall4
n:68,value:0
init_tile: 68 wall5
n:69,value:0
init_tile: 69 floor6
n:70,value:0
init_tile: 70 floor7
n:71,value:0
init_tile: 71 floor8
n:72,value:0
init_tile: 72 floor9
n:73,value:0
init_tile: 73 floor10
n:74,value:0
init_tile: 74 floor11
n:75,value:0
init_tile: 75 floor12
n:76,value:0
init_tile: 76 floor13
n:77,value:0
init_tile: 77 floor14
n:78,value:0
init_tile: 78 floor15
n:79,value:0
init_tile: 79 floor16
n:80,value:264
init_tile: 80 zombie
n:81,value:0
init_tile: 81 savept
n:82,value:0
init_tile: 82 dust
n:83,value:0
init_tile: 83 noguard
n:84,value:0
init_tile: 84 keycard1
n:85,value:0
init_tile: 85 keycard2
n:86,value:0
init_tile: 86 keycard3
n:87,value:0
init_tile: 87 gate1
n:88,value:0
init_tile: 88 gate2
n:89,value:0
init_tile: 89 gate3
n:90,value:265
init_tile: 90 laser1
n:91,value:265
init_tile: 91 laser2
n:92,value:265
init_tile: 92 laser3
n:93,value:0
init_tile: 93 crystal
n:94,value:266
init_tile: 94 spider
init_level: 1 easybomber
init_level: 2 square-mini-maze
init_level: 3 dark03
init_level: 4 intro-take-5
init_level: 5 smallbomber
init_level: 6 smallgenerator
init_level: 7 advanced-lab
init_level: 8 triplelab
init_level: 9 the-halls
init_level: 10 dualcity
init_level: 11 big-tech-cave-crystals
init_level: 12 prison1
init_level: 13 castle17
init_level: 14 the-core
init_level: 15 palace89
init_level: 16 laser-lab
init_level: 17 stealthgems
init_level: 18 large-castle
init_level: 19 unobtainium
init_level: 20 factory-7
init_level: 21 crystalrefinery
init_level: 22 difficult-cave
init_level: 23 final4
init_level: 24 final7
init_level: 25 final3c
init_level: 26 crystal234
init_level: 27 abandonedmine
init_level: 28 windswept
init_ach: 1 mercy
init_ach: 2 nolight
init_ach: 3 nokeys
init_ach: 4 cartridges
init_ach: 5 kills
init_ach: 6 bombs
init_ach: 7 slow
init_ach: 8 fast
init_ach: 9 tutorial
init_ach: 10 win
init_ach: 11 deaths
init_ach: 12 jewels
init_ach: 13 packrat
init_ach: 14 completion
init_ach: 15 nodeaths
unable to find img arrow1

unable to find img jewel
unable to find img sandbag
unable to find img toggle-on
unable to find img toggle-off
unable to find img dust
alpha.dat: 262144
opening /home/chewi/.dynamitejack/userns.db in READWRITE/CREATE mode
sqlite3:prepare [1] table levels already exists; sql=create table levels (id text primary key, data blob, ts int, author text, title text, q text, uid text, stars float, skulls float)
sqlite3:prepare [1] table ratings already exists; sql=create table ratings (lid text primary key, stars int, skulls int)
sqlite3:prepare [1] duplicate column name: type; sql=alter table levels add type text
sqlite3:prepare [1] duplicate column name: value; sql=alter table levels add value int
sqlite3:prepare [1] duplicate column name: intro; sql=alter table levels add intro text
sqlite3:prepare [1] duplicate column name: name; sql=alter table levels add name text
sqlite3:prepare [1] duplicate column name: style; sql=alter table levels add style text
sqlite3:prepare [1] index idx_levels_q already exists; sql=create index idx_levels_q on levels (q)
opening /home/chewi/.dynamitejack/shared.db in READWRITE/CREATE mode
sqlite3:prepare [1] table levels already exists; sql=create table levels (id text primary key, data blob, ts int, author text, title text, q text, uid text, stars float, skulls float)
sqlite3:prepare [1] table ratings already exists; sql=create table ratings (lid text primary key, stars int, skulls int)
sqlite3:prepare [1] duplicate column name: type; sql=alter table levels add type text
sqlite3:prepare [1] duplicate column name: value; sql=alter table levels add value int
sqlite3:prepare [1] duplicate column name: intro; sql=alter table levels add intro text
sqlite3:prepare [1] duplicate column name: name; sql=alter table levels add name text
sqlite3:prepare [1] duplicate column name: style; sql=alter table levels add style text
sqlite3:prepare [1] index idx_levels_q already exists; sql=create index idx_levels_q on levels (q)
orient: 0.000000 -> 0.000000
trying load stream mus-menus
doing load stream mus-menus
stream_load in ticks: 1
opening ../data/gameinfo.db in READONLY mode
trying load font font1
doing load font font1 (1)
trying load font font15
doing load font font15 (2)
trying load font font2
doing load font font2 (3)
opening /home/chewi/.dynamitejack/reliable.db in READWRITE/CREATE mode
sqlite3:prepare [1] table events already exists; sql=create table events (n text primary key, name text, data blob, ts int)
sizeof(Entity) = 580 b
sizeof(level) = 117k
sizeof(game) = 433k
udid:1c1b0d9de366-1633903719, name:Anonymous, uid:a:1c1b0d9de366-1633903719 token:0cda58aa2be38f43503552146d446cec
gethostbyname ...
cuz_gethostbyname('www.galcon.com') cached
setvol: 0
setplayposition: 0
setispaused: 0
Pos: set: 0 get: 0 tt:1575
sulix commented 2 years ago

Hmm… I haven't been able to find a copy of the SDL 1.2 based Dynamite Jack lying around. All the recent versions (from Steam and Humble) are SDL2-based, and work fine here.

chewi commented 2 years ago

Ah okay, I'll update the Gentoo package for it. Maybe there's still an issue to be fixed here, but could be tricky without the source.

sezero commented 2 years ago

Maybe there's still an issue to be fixed here, but could be tricky without the source.

That it works with real SDL1.2 mean that there is an issue to be fixed. Don't have access to that game myself, though.

sezero commented 2 years ago

Does anyone have this game and had a chance to investigate this issue? @icculus, @slouken?

chewi commented 2 years ago

I could send someone my copy if they can convince me they legally own it.

icculus commented 2 years ago

I could send someone my copy if they can convince me they legally own it.

It's Dynamite Jack, not Dynamic Jack, right? I own it, you can find it in my list of Steam games:

https://steamcommunity.com/id/icculus/games/?tab=all

chewi commented 2 years ago

D'oh! Can't believe I didn't spot that.

And yes, I have no doubt you own it, Ryan! I'll mail you the binaries.

icculus commented 2 years ago

Binaries obtained, will look into this soon!

icculus commented 2 years ago

This is an issue with OpenGL scaling; if I turn it off, this gets past the title screen. Looking into it.

icculus commented 2 years ago

So what's happening is that Dynamic Jack links directly against libGL.so.1, and calls glXGetProcAddressARB() to look up GL entry points it needs, including glBindFramebufferEXT().

Later, it binds an FBO to use as a render target of some sort, and then binds FBO 0 when done, but our logical scaling code doesn't catch this so the game is rendering correctly to the backbuffer and then gets overwritten by the original frame that's sitting in our scaling FBO right before we swapbuffers.

The solution is to catch the call to glXGetProcAddressARB and slide our shims in, but I'm not sure how to force it to do so in a reasonable way, since the binary links directly to it in libGL.so.1. Would we have to resort to LD_PRELOAD?

Also assuming this will fail outright on Wayland, scaling or not.

Note that the Steam version is migrated to SDL2 and may or may not have solved these problems already.

For the old SDL 1.2 binary, I'd just say force OpenGL scaling off with the environment variable and call it a day, unless anyone has a good idea here?

slouken commented 2 years ago

No, that sounds like a reasonable resolution to me.

icculus commented 2 years ago

Fwiw, adding this to sdl12-compat fixes Dynamic Jack with OpenGL scaling without using LD_PRELOAD:

DECLSPEC void * SDLCALL glXGetProcAddressARB(const char *sym) { return SDL_GL_GetProcAddress(sym); }

(this isn't the exact function signature of the real glXGetProcAddressARB, but close enough.)

But this feels hella risky in case we get into an infinite loop where we eventually try to call the real glXGetProcAddressARB inside SDL2 but end up back here. I don't know if this was merely working by the grace of the dynamic linker in this instance, but in this case it did manage to route their function lookups through our stuff so we could override the proper framebuffer object entry points.

icculus commented 2 years ago

(or the dynamic linker could choose the real glXGetProcAddressARB over ours, too, I dunno.)

chewi commented 2 years ago

Could you guard against the loop with a static variable? Still not great though, so probably not worth it. It really depends how likely it is that other games do this. I'm getting the impression that this is a very isolated case.

sezero commented 2 years ago

Fwiw, adding this to sdl12-compat fixes Dynamic Jack with OpenGL scaling without using LD_PRELOAD:

DECLSPEC void * SDLCALL glXGetProcAddressARB(const char *sym) { return SDL_GL_GetProcAddress(sym); }

I think that is a bad idea..

icculus commented 2 years ago

I'm honestly surprised it worked here, but it makes sense when you think about it: SDL2 doesn't link against libGL, it looks up this function from a specific library it dlopen'd, so we aren't at the mercy of the dynamic linker there...but this still feels like too much of a gamble to commit.

icculus commented 2 years ago

One more followup on this: the SDL2 version of this game does not call glXGetProcAddress() directly. It's statically linked to SDL 2.0.8, but with a 32-bit build of SDL2 that has Wayland support, we can probably get this running natively on Wayland with the SDL_DYNAMIC_API environment variable.