Skip to content

Commit edd6a39

Browse files
committed
SDL: fix issue #81 - numlock handling
1 parent 6ebc272 commit edd6a39

File tree

8 files changed

+26
-13
lines changed

8 files changed

+26
-13
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2019-12-21 (0.12.17)
2+
SDL: fix issue #81 - numlock handling
3+
14
2019-12-15 (0.12.17)
25
FLTK: add online samples command
36
FLTK: fix tab resizing

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system, sound, and graphic commands along with structured programming syntax
22

3+
### Initialise dependencies
4+
5+
```
6+
$ git submodule update --init
7+
```
8+
39
## Building the SDL version
410

511
Initial setup on linux

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ function buildConsole() {
285285
TARGET="Building Cygwin MinGW console version."
286286
AC_DEFINE(__MINGW32__, 1, [as above])
287287
AC_DEFINE(_UnixOS, 1, [Building under Unix like systems.])
288-
PACKAGE_LIBS="${PACKAGE_LIBS} -mconsole -lmingw32 -lwsock32 -lws2_32 -static-libgcc"
288+
PACKAGE_LIBS="${PACKAGE_LIBS} -Wl,-Bstatic -mconsole -lmingw32 -lwsock32 -lws2_32 -static-libgcc"
289289
BUILD_SUBDIRS="src/common src/platform/console"
290290
fi
291291
AC_DEFINE(_Win32, 1, [Windows build])

src/platform/sdl/display.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of SmallBASIC
22
//
3-
// Copyright(C) 2001-2015 Chris Warren-Smith.
3+
// Copyright(C) 2001-2019 Chris Warren-Smith.
44
//
55
// This program is distributed under the terms of the GPL v2.0 or later
66
// Download the GNU Public License (GPL) from www.gnu.org
@@ -9,7 +9,7 @@
99
#ifndef DISPLAY_H
1010
#define DISPLAY_H
1111

12-
#include <SDL.h>
12+
#include <SDL_video.h>
1313

1414
#include "lib/maapi.h"
1515
#include "ui/strlib.h"

src/platform/sdl/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// This file is part of SmallBASIC
22
//
3-
// Copyright(C) 2001-2014 Chris Warren-Smith.
3+
// Copyright(C) 2001-2019 Chris Warren-Smith.
44
//
55
// This program is distributed under the terms of the GPL v2.0 or later
66
// Download the GNU Public License (GPL) from www.gnu.org
77
//
88

99
#include "config.h"
10-
#include <SDL.h>
1110
#include <getopt.h>
1211
#include <locale.h>
1312

src/platform/sdl/runtime.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of SmallBASIC
22
//
3-
// Copyright(C) 2001-2015 Chris Warren-Smith.
3+
// Copyright(C) 2001-2019 Chris Warren-Smith.
44
//
55
// This program is distributed under the terms of the GPL v2.0 or later
66
// Download the GNU Public License (GPL) from www.gnu.org
@@ -22,8 +22,11 @@
2222
#include "platform/sdl/keymap.h"
2323
#include "platform/sdl/main_bas.h"
2424

25-
#include <SDL_clipboard.h>
2625
#include <SDL_audio.h>
26+
#include <SDL_clipboard.h>
27+
#include <SDL_events.h>
28+
#include <SDL_messagebox.h>
29+
#include <SDL_timer.h>
2730
#include <math.h>
2831
#include <wchar.h>
2932

@@ -483,9 +486,9 @@ void Runtime::pause(int timeout) {
483486
void Runtime::pollEvents(bool blocking) {
484487
if (isActive() && !isRestart()) {
485488
SDL_Event ev;
486-
SDL_Keymod mod;
487489
if (blocking ? SDL_WaitEvent(&ev) : SDL_PollEvent(&ev)) {
488490
MAEvent *maEvent = NULL;
491+
SDL_Keymod mod;
489492
switch (ev.type) {
490493
case SDL_TEXTINPUT:
491494
// pre-transformed/composted text
@@ -590,7 +593,6 @@ void Runtime::pollEvents(bool blocking) {
590593
case SDL_WINDOWEVENT:
591594
switch (ev.window.event) {
592595
case SDL_WINDOWEVENT_FOCUS_GAINED:
593-
SDL_SetModState(KMOD_NONE);
594596
break;
595597
case SDL_WINDOWEVENT_RESIZED:
596598
onResize(ev.window.data1, ev.window.data2);

src/platform/sdl/runtime.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of SmallBASIC
22
//
3-
// Copyright(C) 2001-2014 Chris Warren-Smith.
3+
// Copyright(C) 2001-2019 Chris Warren-Smith.
44
//
55
// This program is distributed under the terms of the GPL v2.0 or later
66
// Download the GNU Public License (GPL) from www.gnu.org
@@ -10,7 +10,9 @@
1010
#define RUNTIME_H
1111

1212
#include "config.h"
13-
#include <SDL.h>
13+
14+
#include <SDL_keycode.h>
15+
#include <SDL_mouse.h>
1416

1517
#include "lib/maapi.h"
1618
#include "ui/ansiwidget.h"

src/ui/canvas.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of SmallBASIC
22
//
3-
// Copyright(C) 2001-2018 Chris Warren-Smith.
3+
// Copyright(C) 2001-2019 Chris Warren-Smith.
44
//
55
// This program is distributed under the terms of the GPL v2.0 or later
66
// Download the GNU Public License (GPL) from www.gnu.org
@@ -10,7 +10,8 @@
1010
#define UI_CANVAS
1111

1212
#if defined(_SDL)
13-
#include <SDL.h>
13+
#include <SDL_rect.h>
14+
#include <SDL_surface.h>
1415
#define MAX_CANVAS_SIZE 20
1516

1617
struct Canvas {

0 commit comments

Comments
 (0)