Skip to content

u/ickysticky

In this archive from Jan 2009 to May 2022

7
posts
60
comments
0
media
200
score
1 saved before deletion

Top posts

When running scene: Condition ' base.begins_with("local://") || base == "" ' is true. Continuing..

I am seeing this editor/plugins/script_editor_plugin.cpp:1432 - Condition ' base.begins_with("local://") || base == "" ' is true. Continuing..: editor/plugins/script_editor_plugin.cpp:1432 - Condition ' base.begins_with("local://") || base == "" ' is true. Continuing..: Any ideas what this means? Ho...

2 points5 comments
Open on Reddit

Top comments

Wait. Do people really get anxious without understanding why?! That sounds terrible! I am constantly anxious, but I understand the reasons why, and that is what helps me dismiss it. But to just feel anxious and not have a reason sounds like torture..

79 points

A few more details would be helpful. How have you narrowed down that it is the blitting causing the slowdown? Can we see the profile? More details about how you are drawing?
Are you doing the "optimized surface loading" mentioned in http://lazyfoo.net/SDL_tutorials/lesson02/ (see the load_image function)? IIRC, this method makes sure that the loaded surface pixel format matches the screen pixel format so that it is a straight copy.
If it is a single layer of tiles, am I right to assume there are about 800 tiles on a screen at a time? That is a lot of draw calls to make happen in <16ms(assuming your target is 60fps). You would probably be hard pressed to et even OpenGL to do that many texture binds and draws in that time frame.
I think your best bet will be to draw the tiles to a larger off screen surface(or surfaces) first and then draw those fewer surfaces. This shouldn't be too difficult as long as the majority of your tiles are static..
Finally, if there is nothing wrong with the current frame rate(you say it runs at 35 fps on an old computer, that sounds pretty good) then don't go optimizing it, optimizing things without specific goals is a road to a lot of wasted time in my experience :).

10 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.