Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ifeq ($(PLATFORM), bittboy)
STRIP := arm-linux-strip
SYSROOT := $(shell $(CC) --print-sysroot)
CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
CFLAGS += -DSCREEN_SCALE=1
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this change to the previous commit, as it is unrelated to the tearing fix.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to move it around.

LDFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs) -lm
endif

Expand Down
2 changes: 1 addition & 1 deletion src/states.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void logic()

void draw()
{
clearScreen();
//clearScreen();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't leave commented out code like that.
It appears that clearScreen() has become redundant, as in both STATE_TITLE and STATE_GAME the whole screen area gets repainted with drawBackground() anyway, so we can safely remove this call from the code.
But how does it fix tearing on your platform?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bittboy does not have vsync and apparently the screen is being cleared directly after clearScreen() call. This is a probable reason of black horizontal bars showing in random positions on the screen. After removing that call, screen tearing is not visible to that extent and becomes acceptable (at least for me). Lack of vsync is a known issue on Bittboy.


switch (programStateActive)
{
Expand Down