Skip to content

Commit

Permalink
Release 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
makuke1234 committed Jan 15, 2022
1 parent 940f66e commit 6aa3df0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PongD2D

![Release version](https://img.shields.io/badge/release-v1.3.1-green.svg)
![Release version](https://img.shields.io/badge/release-v1.3.2-green.svg)
![C version](https://img.shields.io/badge/version-C20-blue.svg)
![C++ version](https://img.shields.io/badge/version-C++20-blue.svg)

Expand All @@ -22,10 +22,14 @@ Windows binaries can be downloaded [here](https://github.com/makuke1234/PongD2D/
| Down | Move right wall down |
| Escape | Pause/unpause |
| Enter | Restart game |
| F11 | Toggle fullscreen |


# Changelog

* 1.3.2
* Fix UB when going to fullscreen

* 1.3.1
* Add window resizing support

Expand Down
3 changes: 2 additions & 1 deletion src/pongerr.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const wchar_t * c_errorIds[PongErr_num_errs] = {
L"Error creating D2D geometry!",
L"Error creating DWrite factory!",
L"Error creating DWrite font!",
L"Error settings DWrite font alignment!"
L"Error settings DWrite font alignment!",
L"Error going to fullscreen!",
};

PongErr_e g_pongLastError = PongErr_unknown;
Expand Down
1 change: 1 addition & 0 deletions src/pongerr.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ typedef enum PongErr
PongErr_dwFactory,
PongErr_dwFont,
PongErr_dwFontAlignment,
PongErr_fullscreen,

PongErr_num_errs
} PongErr_e;
Expand Down
4 changes: 2 additions & 2 deletions src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#define PONG_WALL_MAX ((PONG_MINH - PONG_WALL_Y) / 2.0f)

#define VERSION_STR "1.3.1"
#define VERSION_SEQ 1,3,1
#define VERSION_STR "1.3.2"
#define VERSION_SEQ 1,3,2


#endif
11 changes: 9 additions & 2 deletions src/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,15 @@ void PongWnd_toggleFullScreen(PongWnd_t * restrict pong)

// Get screen size
SIZE screen;
w32_getScreenSize(pong->hwnd, &screen);
MoveWindow(pong->hwnd, 0, 0, screen.cx, screen.cy, TRUE);
if (w32_getScreenSize(pong->hwnd, &screen))
{
MoveWindow(pong->hwnd, 0, 0, screen.cx, screen.cy, TRUE);
}
else
{
g_pongLastError = PongErr_fullscreen;
pongLastErr(pong);
}
}
else
{
Expand Down

0 comments on commit 6aa3df0

Please sign in to comment.