04-28-2010, 04:12 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
I did a quick test(2695) and hit a segfault on game restart.
The stack trace:
Code: #0 004CA82D RENDER_INPUT_SCENE::SelectTexturing(this=0x28afa8, forme=..., glstate=...) (E:\vdrift\vdrift\src\graphics_renderers.cpp:504)
#1 004C9CB6 RENDER_INPUT_SCENE::DrawList(this=0x28afa8, glstate=..., drawlist=..., preculled=true) (E:\vdrift\vdrift\src\graphics_renderers.cpp:236)
#2 004C9BDC RENDER_INPUT_SCENE::Render(this=0x28afa8, glstate=...) (E:\vdrift\vdrift\src\graphics_renderers.cpp:211)
#3 004C8870 GRAPHICS_SDLGL::Render(this=0x28aba4, input=0x28afa8, output=..., error_output=...) (E:\vdrift\vdrift\src\graphics.cpp:968)
#4 004C7B03 GRAPHICS_SDLGL::RenderDrawlists(this=0x28aba4, dynamic_drawlist=..., static_drawlist=..., render_scene=..., render_output=..., error_output=...) (E:\vdrift\vdrift\src\graphics.cpp:887)
#5 004C5B34 GRAPHICS_SDLGL::DrawScene(this=0x28aba4, error_output=...) (E:\vdrift\vdrift\src\graphics.cpp:603)
#6 004BFDCB GAME::LoadingScreen(this=0x28a770, progress=0, max=1) (E:\vdrift\vdrift\src\game.cpp:2116)
#7 004BBF84 GAME::LoadTrack(this=0x28a770, trackname=...) (E:\vdrift\vdrift\src\game.cpp:1760)
#8 004BA2CB GAME::NewGame(this=0x28a770, playreplay=false, addopponents=false, num_laps=0) (E:\vdrift\vdrift\src\game.cpp:1512)
#9 004B86A0 GAME::ProcessGUIAction(this=0x28a770, action=...) (E:\vdrift\vdrift\src\game.cpp:1306)
#10 004B4C52 GAME::ProcessGUIInputs(this=0x28a770) (E:\vdrift\vdrift\src\game.cpp:1023)
#11 004B246B GAME::AdvanceGameLogic(this=0x28a770) (E:\vdrift\vdrift\src\game.cpp:622)
#12 004B236D GAME::Tick(this=0x28a770, deltat=0.00700000022) (E:\vdrift\vdrift\src\game.cpp:606)
#13 004B221D GAME::MainLoop(this=0x28a770) (E:\vdrift\vdrift\src\game.cpp:572)
#14 004AE2F9 GAME::Start(this=0x28a770, args=...) (E:\vdrift\vdrift\src\game.cpp:175)
#15 004F716F SDL_main(argc=2, argv=0x28fd40) (E:\vdrift\vdrift\src\main.cpp:70)
#16 0052C716 console_main(argc=2, argv=0x28fd40) (src/main/win32/SDL_win32_main.c:217)
#17 0052C8D7 WinMain(hInst=0x400000, hPrev=0x0, szCmdLine=0x22830dc "-debug", sw=10) (src/main/win32/SDL_win32_main.c:353)
#18 00000000 0x0052c180 in main() (??:??)
|
|
05-01-2010, 12:38 PM,
|
|
joevenzon
Administrator
|
Posts: 2,679
Threads: 52
Joined: Jun 2005
|
|
NaN Wrote:I would like to switch to a common content manager. It would keep track of loaded/used content like TEXTURE, SOUND, MODEL(VERTEXARRAY) and (re)load them on demand. But this means changes in the affected classes and DRAWABLE (replacing raw pointers with shared_ptr and modifying the interfaces). What do you think?
Just don't make the common content manager a global or singleton or anything -- instead, pass a reference to the appropriate content manager object into the loader functions. Were you thinking you'd make a generic (templated) content manager class, then instances for TEXTURE, SOUND, etc? If so, sounds great.
The DRAWABLE changes are fine. Please use the tr1 shared_ptr.
|
|
05-06-2010, 06:54 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
I've got the texture manager running. There is one issue to be fixed(before check in). It looks like I am deleting the textures at the wrong place:
Code: "Texture ID deletion (../vdrift-data/tracks/rouen/objects/road1a.bmp.png)"
PS: Some debug output(loading ruudskogen ). One object reference is kept in the manager.
Code: Texture manager debug print:
References: 56 Texture: ../vdrift-data/skins/simple/textures/box.png
References: 2 Texture: ../vdrift-data/skins/simple/textures/timerbox.png
References: 3 Texture: ../vdrift-data/cars/360/textures/wheel_rear.png
References: 2 Texture: ../vdrift-data/cars/360/textures/brake.png
References: 4 Texture: ../vdrift-data/skins/simple/textures/progressbar.png
References: 4 Texture: ../vdrift-data/tracks/ruudskogen/objects/ruudskog.tga.png
References: 24 Texture: ../vdrift-data/tracks/ruudskogen/objects/road03.jpg.png
References: 59 Texture: ../vdrift-data/skins/simple/textures/widgets/controls/key_sel.png
References: 2 Texture: ../vdrift-data/textures/hud/cardot0_focused.png
References: 2 Texture: ../vdrift-data/tracks/ruudskogen/objects/lave01.bmp.png
References: 2 Texture: ../vdrift-data/textures/smoke/particle1.png
References: 21 Texture: ../vdrift-data/skins/simple/textures/widgets/sld_cursor.png
References: 3 Texture: ../vdrift-data/skins/simple/textures/hudbox.png
References: 13 Texture: ../vdrift-data/skins/simple/textures/widgets/controls/mouse.png
References: 12 Texture: ../vdrift-data/tracks/ruudskogen/objects/road01.jpg.png
References: 2 Texture: ../vdrift-data/textures/smoke/particle5.png
References: 42 Texture: ../vdrift-data/skins/simple/textures/widgets/tog_on_up.png
References: 2 Texture: ../vdrift-data/textures/hud/cardot0.png
References: 2 Texture: ../vdrift-data/tracks/ruudskogen/objects/grid02.tga.png
References: 2 Texture: ../vdrift-data/skins/simple/fonts/freesans_noshaders.png
References: 3 Texture: ../vdrift-data/tracks/ruudskogen/objects/grass02.jpg.png
References: 15 Texture: ../vdrift-data/tracks/ruudskogen/objects/auto01.tga.png
References: 23 Texture: ../vdrift-data/tracks/ruudskogen/objects/grass01.jpg.png
References: 2 Texture: ../vdrift-data/tracks/ruudskogen/trackshot.png
References: 37 Texture: ../vdrift-data/skins/simple/textures/widgets/wheel_down_l.png
References: 2 Texture: ../vdrift-data/skins/simple/textures/accdec-marker.png
References: 2 Texture: ../vdrift-data/textures/smoke/particle4.png
References: 2 Texture: ../vdrift-data/cars/360/textures/glass.png
References: 5 Texture: ../vdrift-data/tracks/ruudskogen/objects/sand01.jpg.png
References: 2 Texture: ../vdrift-data/tracks/ruudskogen/objects/hus02.tga.png
References: 2 Texture: ../vdrift-data/skins/simple/textures/loadingbox.png
References: 42 Texture: ../vdrift-data/skins/simple/textures/widgets/tog_on_up_unsel.png
References: 4 Texture: ../vdrift-data/tracks/ruudskogen/objects/dekk01.bmp.png
References: 20 Texture: ../vdrift-data/tracks/ruudskogen/objects/tre06.bmp.png
References: 42 Texture: ../vdrift-data/skins/simple/textures/widgets/tog_off_down.png
References: 2 Texture: ../vdrift-data/textures/smoke/particle3.png
References: 2 Texture: ../vdrift-data/textures/hud/cardot1.png
References: 73 Texture: ../vdrift-data/skins/simple/textures/widgets/wheel_up_l.png
References: 2 Texture: ruudskogen
References: 37 Texture: ../vdrift-data/skins/simple/textures/widgets/wheel_down_r.png
References: 2 Texture: ../vdrift-data/drivers/driver2/textures/body.png
References: 7 Texture: ../vdrift-data/tracks/ruudskogen/objects/gjerde01.tga.png
References: 42 Texture: ../vdrift-data/skins/simple/textures/widgets/tog_off_up_unsel.png
References: 723 Texture: ../vdrift-data/skins/simple/fonts/futuresans_noshaders.png
References: 2 Texture: ../vdrift-data/tracks/ruudskogen/objects/grid01.tga.png
References: 547 Texture: ../vdrift-data/textures/effects/racingline.png
References: 2 Texture: ../vdrift-data/textures/smoke/particle0.png
References: 2 Texture: ../vdrift-data/drivers/driver2/textures/body-misc1.png
References: 3 Texture: ../vdrift-data/tracks/ruudskogen/objects/kollisjon02.dof-00.png
References: 42 Texture: ../vdrift-data/skins/simple/textures/widgets/tog_off_up.png
References: 2 Texture: ../vdrift-data/textures/smoke/particle2.png
References: 2 Texture: ../vdrift-data/tracks/ruudskogen/objects/lave02.bmp.png
References: 18 Texture: ../vdrift-data/tracks/ruudskogen/objects/Tre10.bmp.png
References: 2 Texture: ../vdrift-data/skins/simple/textures/ball2.png
References: 86 Texture: ../vdrift-data/skins/simple/textures/widgets/controls/add.png
References: 2 Texture: ../vdrift-data/cars/360/textures/interior.png
References: 2 Texture: ../vdrift-data/cars/360/textures/body-misc1.png
References: 3 Texture: ../vdrift-data/skins/simple/textures/loadingbar.png
References: 171 Texture: ../vdrift-data/skins/simple/textures/widgets/controls/add_sel.png
References: 2 Texture: ../vdrift-data/skins/simple/textures/accdec-slider.png
References: 73 Texture: ../vdrift-data/skins/simple/textures/widgets/wheel_up_r.png
References: 10 Texture: ../vdrift-data/tracks/ruudskogen/objects/road02.jpg.png
References: 3 Texture: ../vdrift-data/tracks/ruudskogen/objects/hytte01.bmp.png
References: 2 Texture: ../vdrift-data/cars/360/textures/body00.png
References: 7 Texture: ../vdrift-data/tracks/ruudskogen/objects/skilt01.jpg.png
References: 25 Texture: ../vdrift-data/skins/simple/textures/widgets/controls/mouse_sel.png
References: 2 Texture: ../vdrift-data/cars/360/textures/reverse.png
References: 2 Texture: ../vdrift-data/cars/360/textures/glass-misc1.png
References: 21 Texture: ../vdrift-data/skins/simple/textures/widgets/sld_wedge.png
References: 30 Texture: ../vdrift-data/skins/simple/textures/widgets/controls/key.png
References: 27 Texture: ../vdrift-data/skins/simple/fonts/lcd_noshaders.png
References: 2 Texture: ../vdrift-data/tracks/rouen/trackshot.png
References: 144 Texture: ../vdrift-data/skins/simple/textures/widgets/btn_up_unsel.png
References: 2 Texture: ../vdrift-data/tracks/ruudskogen/objects/himmel03.jpg.png
References: 144 Texture: ../vdrift-data/skins/simple/textures/widgets/btn_down.png
References: 2 Texture: ../vdrift-data/textures/hud/cardot1_focused.png
References: 23 Texture: ../vdrift-data/tracks/ruudskogen/objects/busk01.bmp.png
References: 3 Texture: ../vdrift-data/cars/360/textures/wheel_front.png
References: 2 Texture: ../vdrift-data/skins/simple/textures/logo.png
References: 22 Texture: ../vdrift-data/tracks/ruudskogen/objects/tre02.bmp.png
References: 144 Texture: ../vdrift-data/skins/simple/textures/widgets/btn_up.png
References: 2 Texture: ../vdrift-data/skins/simple/textures/slider2.png
References count: 2932
Objects count: 82, created: 44, reused: 186, deleted: 7
|
|
05-06-2010, 07:14 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Found the reason for the OpenGL error. Some textures are released after SDL_Quit():
Code: Texture ID deletion (../vdrift-data/skins/simple/textures/widgets/controls/key.png)
Texture ID deletion (../vdrift-data/skins/simple/textures/timerbox.png)
Texture ID deletion (../vdrift-data/skins/simple/textures/loadingbox.png)
...
The issue has been there before my changes. A number of widgets keep their texture until their destruction, which happens after SDL_Quit() call.
|
|
05-07-2010, 04:59 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Sorry to hijack your thread Joe.
I've started to integrate car coloring( http://vdrift.net/Forum/viewtopic.php?t=1325 ). My current idea is to create the car texture from color.png + rgb + bodyXX.png in software(using SDL). The alternative would be to add another texture to drawable and do it in the shader. I am not sure which approach is more appealing. What do you think? (I am too lazy to implement both, but I maybe will have to.)
|
|
|