Kaynağa Gözat

Bugfix SDL2 surface init + add some labels in UI

Yann Weber 5 yıl önce
ebeveyn
işleme
027c9e4f40
2 değiştirilmiş dosya ile 28 ekleme ve 15 silme
  1. 24
    1
      yaglitch.asm
  2. 4
    14
      yaglitch_ui.asm

+ 24
- 1
yaglitch.asm Dosyayı Görüntüle

@@ -422,8 +422,31 @@ sdl_init:
422 422
 	jz sdl_error
423 423
 	pop rcx
424 424
 	pop rcx
425
+
426
+	%ifdef SDL2
427
+		; call memeset to alloc pixels
428
+		push rax
429
+		mov rdi, rax
430
+		call SDL_LockSurface
431
+
432
+		xor rdx, rdx
433
+		xor rcx, rcx
434
+		MOV_surf_w ecx, visu_surf
435
+		xor rax, rax
436
+		MOV_surf_pitch eax, visu_surf
437
+		mul ecx
438
+		MOV_surf_pixels rdi, visu_surf
439
+		xor rsi, rsi
440
+		;mov rsi, 0xFF ;white
441
+		mov rdx, rax
442
+		call SDL_memset ; seems to malloc the pixels
443
+
444
+		pop rdi ; surface addr
445
+		call SDL_UnlockSurface
446
+	%endif
447
+
425 448
 	; RAZ surface & blit
426
-	call clear_screen
449
+	;call clear_screen ;useless
427 450
 
428 451
 	%ifdef MIX_AUDIO
429 452
 		; init callback heap infos

+ 4
- 14
yaglitch_ui.asm Dosyayı Görüntüle

@@ -3,20 +3,6 @@ clear_screen:
3 3
 	push rdi
4 4
 	call SDL_LockSurface
5 5
 
6
-	%ifdef SDL2
7
-		xor rdx, rdx
8
-		xor rcx, rcx
9
-		MOV_surf_w ecx, visu_surf
10
-		xor rax, rax
11
-		MOV_surf_pitch eax, visu_surf
12
-		mul ecx
13
-		MOV_surf_pixels rdi, visu_surf
14
-		xor rsi, rsi
15
-		;mov rsi, 0xFF ;white
16
-		mov rdx, rax
17
-		call SDL_memset ; seems to malloc the pixels
18
-	%endif
19
-
20 6
 	%ifdef SDL1
21 7
 		xor rcx, rcx
22 8
 		MOV_surf_w ecx, visu_surf
@@ -41,6 +27,8 @@ clear_screen:
41 27
 	pop rdi ; surface addr
42 28
 	call SDL_UnlockSurface
43 29
 
30
+blitflip_visu:
31
+
44 32
 	mov rdi, [visu_surf]
45 33
 	xor rsi, rsi
46 34
 	mov rdx, [visu_scr]
@@ -49,6 +37,8 @@ clear_screen:
49 37
 	test rax, rax
50 38
 	jnz sdl_error
51 39
 
40
+flip_visu:
41
+
52 42
 	%ifdef SDL2
53 43
 		mov rdi, [visu_win]
54 44
 		call SDL_UpdateWindowSurface

Loading…
İptal
Kaydet