|
38 | 38 | #include <unistd.h>
|
39 | 39 |
|
40 | 40 |
|
| 41 | + |
41 | 42 | /* Old Windows versions lack these functions
|
42 | 43 | *
|
43 | 44 | * credit: Petar Korponaić
|
@@ -1153,7 +1154,6 @@ ctr_object* ctr_media_screen(ctr_object* myself, ctr_argument* argumentList) {
|
1153 | 1154 | controllableObject = NULL;
|
1154 | 1155 | focusObject = NULL;
|
1155 | 1156 | CtrMediaSteps = 0;
|
1156 |
| - SDL_StartTextInput(); |
1157 | 1157 | SDL_Rect dimensions;
|
1158 | 1158 | SDL_Texture* texture;
|
1159 | 1159 | char* imageFileStr = ctr_heap_allocate_cstring(ctr_internal_cast2string(argumentList->object));
|
@@ -1261,6 +1261,24 @@ ctr_object* ctr_media_screen(ctr_object* myself, ctr_argument* argumentList) {
|
1261 | 1261 | }
|
1262 | 1262 | if (ctr_internal_media_mouse_down(event)) return CtrStdFlow;
|
1263 | 1263 | break;
|
| 1264 | + case SDL_FINGERDOWN: |
| 1265 | + if (event.tfinger.x * windowWidth > player->x) { |
| 1266 | + ctr_internal_media_keydown_right(&dir); |
| 1267 | + } |
| 1268 | + else if (event.tfinger.x * windowWidth < player->x - (player->w/player->anims)) { |
| 1269 | + ctr_internal_media_keydown_left(&dir); |
| 1270 | + } |
| 1271 | + if (event.tfinger.y * windowHeight > player->y - player->h) { |
| 1272 | + ctr_internal_media_keydown_down(&dir, &c4speed); |
| 1273 | + } |
| 1274 | + else if (event.tfinger.y * windowHeight < player->y - player->h) { |
| 1275 | + ctr_internal_media_keydown_up(&dir, &c4speed); |
| 1276 | + } |
| 1277 | + break; |
| 1278 | + case SDL_FINGERUP: |
| 1279 | + ctr_internal_media_keyup_right(&dir, &c4speed); |
| 1280 | + ctr_internal_media_keyup_down(&dir, &c4speed); |
| 1281 | + break; |
1264 | 1282 | case SDL_CONTROLLERBUTTONDOWN:
|
1265 | 1283 | if (CtrMediaEventListenFlagGamePadBtnDown) {
|
1266 | 1284 | ctr_media_event(myself, CTR_DICT_ON_GAMEPAD_DOWN, SDL_GameControllerGetStringForButton(event.cbutton.button));
|
@@ -3388,7 +3406,11 @@ void ctr_internal_media_init() {
|
3388 | 3406 | CtrMediaAudioVolume = MIX_MAX_VOLUME;
|
3389 | 3407 | if (SDL_Init(SDL_INIT_VIDEO) < 0) ctr_internal_media_fatalerror("SDL failed to init", SDL_GetError());
|
3390 | 3408 | IMG_Init(IMG_INIT_PNG | IMG_INIT_JPG);
|
| 3409 | + #ifdef FULLSCREEN |
| 3410 | + CtrMediaWindow = SDL_CreateWindow("Citrine", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 100, 100, SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN); |
| 3411 | + #else |
3391 | 3412 | CtrMediaWindow = SDL_CreateWindow("Citrine", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 100, 100, SDL_WINDOW_OPENGL);
|
| 3413 | + #endif |
3392 | 3414 | if (CtrMediaWindow == NULL) ctr_internal_media_fatalerror("Unable to create window", SDL_GetError());
|
3393 | 3415 | CtrMediaRenderer = SDL_CreateRenderer(CtrMediaWindow, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
|
3394 | 3416 | if (!CtrMediaRenderer) {
|
|
0 commit comments