New game
git-svn-id: svn://kolibrios.org@5312 a494cfbc-eb01-0410-851d-a64ba20cac60
3428
programs/games/Dungeons/AKODE/AKODE.inc
Normal file
19
programs/games/Dungeons/AKODE/data.inc
Normal file
@ -0,0 +1,19 @@
|
||||
; ================================== Data ==================================== ;
|
||||
|
||||
align 4
|
||||
akode_data.Angle0 dd 0
|
||||
|
||||
akode_data.ImageBufferPtr dd 0
|
||||
akode_data.TrigonometricTablePtr dd 0
|
||||
akode_data.BlockWidthTanTablePtr dd 0
|
||||
|
||||
akode_data.DepthBufferPtr dd 0
|
||||
|
||||
akode_data.CurrentLevelGridPtr dd 0
|
||||
akode_data.CurrentLevelObjectsPtr dd 0
|
||||
akode_data.CurrentLevelAddTexturesPtr dd 0
|
||||
|
||||
akode_data.ShadingTablePtr dd 0
|
||||
|
||||
akode_data.LevelLoadCallback dd 0
|
||||
akode_data.ActionCallback dd 0
|
127
programs/games/Dungeons/AKODE/datadef.inc
Normal file
@ -0,0 +1,127 @@
|
||||
; ============================ Data definitions ============================== ;
|
||||
|
||||
struct akode.Point
|
||||
X dd ?
|
||||
Y dd ?
|
||||
ends
|
||||
|
||||
struct akode.Point3D akode.Point
|
||||
Z dd ?
|
||||
ends
|
||||
|
||||
struct akode.Size
|
||||
Width dd ?
|
||||
Height dd ?
|
||||
ends
|
||||
|
||||
struct akode.Rect
|
||||
X dd ?
|
||||
Y dd ?
|
||||
Width dd ?
|
||||
Height dd ?
|
||||
ends
|
||||
|
||||
struct akode.Camera
|
||||
Position akode.Point3D
|
||||
Direction dd ?
|
||||
FieldOfView dd ?
|
||||
ends
|
||||
|
||||
struct akode.ProjectionPlane
|
||||
MidY dd ?
|
||||
Size akode.Size
|
||||
ends
|
||||
|
||||
struct akode.CombinedTexture ; combine 2 textures
|
||||
DescPtr1 dd ? ; main texture
|
||||
DescPtr2 dd ? ; 2nd optional texture
|
||||
ends
|
||||
|
||||
AKODE_TEXTURE_TYPE.IMAGE = 0
|
||||
AKODE_TEXTURE_TYPE.COLOR = 1
|
||||
|
||||
AKODE_TEXTURE_USAGE.ENVIRONMENT = 0
|
||||
AKODE_TEXTURE_USAGE.OBJECT = 1
|
||||
|
||||
AKODE_VIRTUAL_SCALE_MODE.TOPLEFT = 00h
|
||||
AKODE_VIRTUAL_SCALE_MODE.TOPCENTER = 01h
|
||||
AKODE_VIRTUAL_SCALE_MODE.TOPRIGHT = 02h
|
||||
AKODE_VIRTUAL_SCALE_MODE.CENTERLEFT = 10h
|
||||
AKODE_VIRTUAL_SCALE_MODE.CENTER = 11h
|
||||
AKODE_VIRTUAL_SCALE_MODE.CENTERRIGHT = 12h
|
||||
AKODE_VIRTUAL_SCALE_MODE.BOTTOMLEFT = 20h
|
||||
AKODE_VIRTUAL_SCALE_MODE.BOTTOMCENTER = 21h
|
||||
AKODE_VIRTUAL_SCALE_MODE.BOTTOMRIGHT = 22h
|
||||
|
||||
struct akode.TextureDesc
|
||||
Type dd ? ; AKODE_TEXTURE_TYPE
|
||||
|
||||
union
|
||||
ImagePathPtr dd ?
|
||||
Color dd ?
|
||||
ends
|
||||
|
||||
ImageDataPtr dd ?
|
||||
|
||||
HasMagicPink db ? ; boolean
|
||||
TileWalls db ? ; boolean
|
||||
Usage db ? ; AKODE_TEXTURE_USAGE
|
||||
VirtualScale db ? ; AKODE_VIRTUAL_SCALE_MODE, not supported yet
|
||||
VirtualSize akode.Size ; (0, 0) for original size, not supported yet
|
||||
ends
|
||||
|
||||
struct akode.GridCell
|
||||
WallTexture1 akode.CombinedTexture ; 4 combined textures for walls
|
||||
WallTexture2 akode.CombinedTexture
|
||||
WallTexture3 akode.CombinedTexture
|
||||
WallTexture4 akode.CombinedTexture
|
||||
|
||||
FloorTexture akode.CombinedTexture
|
||||
CeilingTexture akode.CombinedTexture
|
||||
|
||||
Passable dd ? ; boolean
|
||||
|
||||
ActionCallback dd ? ; proc callback AKODE_ACTION, cell x, cell y
|
||||
ends
|
||||
|
||||
struct akode.Object
|
||||
TextureDescPtr dd ?
|
||||
Position akode.Point
|
||||
Visible dd ? ; boolean
|
||||
DisableShading dd ? ; boolean
|
||||
Tag dd ?
|
||||
|
||||
; for internal use
|
||||
Distance dd ?
|
||||
ShadingDistance dd ?
|
||||
Angle dd ?
|
||||
ends
|
||||
|
||||
AKODE_DIRECTION.EAST = 0
|
||||
AKODE_DIRECTION.NORTH = 1
|
||||
AKODE_DIRECTION.WEST = 2
|
||||
AKODE_DIRECTION.SOUTH = 3
|
||||
|
||||
struct akode.LevelHeader
|
||||
Size akode.Size
|
||||
StartPosition akode.Point
|
||||
StartDirection dd ? ; AKODE_DIRECTION
|
||||
BackgroundColor dd ? ; FF00FF for no background color
|
||||
ShadingColor dd ?
|
||||
ShadingDistance dd ? ; 0 for no shading
|
||||
|
||||
ObjectCount dd ?
|
||||
TextureCount dd ? ; number of additional textures
|
||||
|
||||
InitCallback dd ?
|
||||
DestroyCallback dd ?
|
||||
ActionCallback dd ? ; proc callback AKODE_ACTION, cell x, cell y
|
||||
ends
|
||||
|
||||
AKODE_LEVEL_LOAD.START = 0
|
||||
AKODE_LEVEL_LOAD.END = 1
|
||||
AKODE_LEVEL_LOAD.UNLOADED = 2
|
||||
|
||||
AKODE_ACTION.CELL_LEAVE = 0
|
||||
AKODE_ACTION.CELL_ENTER = 1
|
||||
AKODE_ACTION.CUSTOM = 0100h
|
19
programs/games/Dungeons/AKODE/import.inc
Normal file
@ -0,0 +1,19 @@
|
||||
; ================================= Import =================================== ;
|
||||
|
||||
library libio, 'libio.obj', \
|
||||
libimg, 'libimg.obj'
|
||||
|
||||
import libio, \
|
||||
file_size, 'file_size', \
|
||||
file_open, 'file_open', \
|
||||
file_read, 'file_read', \
|
||||
file_close, 'file_close'
|
||||
|
||||
import libimg, \
|
||||
img_decode, 'img_decode', \
|
||||
img_convert, 'img_convert', \
|
||||
img_scale, 'img_scale', \
|
||||
img_flip, 'img_flip', \
|
||||
img_rotate, 'img_rotate', \
|
||||
img_to_rgb, 'img_to_rgb', \
|
||||
img_destroy, 'img_destroy'
|
34
programs/games/Dungeons/AKODE/udata.inc
Normal file
@ -0,0 +1,34 @@
|
||||
; =========================== Uninitialized data ============================= ;
|
||||
|
||||
align 4
|
||||
akode_data.BlockSize akode.Size ; first - width and height of the block base, must be power of 2
|
||||
; second - height of the block
|
||||
akode_data.BlockWidthPowerOf2 dd ?
|
||||
akode_data.Camera akode.Camera
|
||||
akode_data.ProjectionPlane akode.ProjectionPlane
|
||||
|
||||
akode_data.CameraToPlaneDistance dd ?
|
||||
akode_data.WallHeightDividend dd ?
|
||||
akode_data.FloorDistanceDividend dd ?
|
||||
akode_data.CeilingDistanceDividend dd ?
|
||||
|
||||
akode_data.Angle90 dd ?
|
||||
akode_data.Angle180 dd ?
|
||||
akode_data.Angle270 dd ?
|
||||
akode_data.Angle360 dd ?
|
||||
|
||||
akode_data.ShadingColor dd ?
|
||||
akode_data.ShadingDistance dd ?
|
||||
|
||||
akode_data.CurrentLevel akode.LevelHeader
|
||||
|
||||
akode_data.MovementSpeed dd ?
|
||||
akode_data.TurningSpeed dd ?
|
||||
akode_data.MovementDirection dd ?
|
||||
akode_data.TurningDirection dd ?
|
||||
akode_data.LastMoveTimestamp dd ?
|
||||
akode_data.LastTurnTimestamp dd ?
|
||||
|
||||
akode_data.ImageBufferSize dd ?
|
||||
|
||||
akode_data.OptimizedGetImage dd ?
|
974
programs/games/Dungeons/Dungeons.asm
Normal file
@ -0,0 +1,974 @@
|
||||
; Copyright (C) 2014 Anton_K
|
||||
;
|
||||
; This program is free software: you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation, either version 2 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
format binary as 'kex'
|
||||
|
||||
__DEBUG__ = 1 ; 0 - disable debug output / 1 - enable debug output
|
||||
__DEBUG_LEVEL__ = DEBUG_FINE ; DEBUG_FINE - all debug messages / DEBUG_INFO - info and errors / DEBUG_ERR - only errors
|
||||
|
||||
DEBUG_FINE = 0
|
||||
DEBUG_INFO = 1
|
||||
DEBUG_ERR = 2
|
||||
|
||||
include 'macros.inc'
|
||||
purge mov, add, sub
|
||||
|
||||
; ================================= Header =================================== ;
|
||||
MEOS_APP_START
|
||||
store dword StartupPath at $ - 4
|
||||
|
||||
; ================================ Includes ================================== ;
|
||||
include '../../debug-fdo.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../dll.inc'
|
||||
|
||||
include 'AKODE/AKODE.inc'
|
||||
include 'datadef.inc'
|
||||
|
||||
; =============================== Entry point ================================ ;
|
||||
CODE
|
||||
DEBUGF DEBUG_INFO, 'Started\n'
|
||||
|
||||
mcall 68, 11 ; initialize heap
|
||||
test eax, eax
|
||||
jz .exit_fail_heap_init
|
||||
|
||||
stdcall dll.Load, @IMPORT ; load libraries
|
||||
test eax, eax
|
||||
jnz .exit_fail_load_libs
|
||||
|
||||
mcall 40, MAIN_EVENT_MASK ; used events
|
||||
mcall 66, 1, 1 ; use scancodes
|
||||
|
||||
stdcall draw_window
|
||||
|
||||
mcall 9, ThreadInfoBuffer, -1 ; get real window size
|
||||
mov eax, [ebx + process_information.client_box.width]
|
||||
inc eax
|
||||
mov [MainWindowWidth], eax
|
||||
mov edx, [ebx + process_information.client_box.height]
|
||||
inc edx
|
||||
mov [MainWindowHeight], edx
|
||||
DEBUGF DEBUG_FINE, 'Window width: %u\nWindow height: %u\n', eax, edx
|
||||
|
||||
mov ecx, eax
|
||||
shl ecx, 2
|
||||
imul ecx, edx ; ecx = width * 4 * height
|
||||
|
||||
sub edx, HUD_PANEL_HEIGHT
|
||||
mov [WorldViewHeight], edx
|
||||
|
||||
if FSAA
|
||||
shl eax, FSAA
|
||||
shl edx, FSAA
|
||||
end if
|
||||
|
||||
stdcall akode.init, eax, edx, FIELD_OF_VIEW, BLOCK_BASE_SIZE, BLOCK_HEIGHT
|
||||
test eax, eax
|
||||
jz .exit_fail_akode_init
|
||||
|
||||
mcall 68, 12 ; alloc ecx bytes for image buffer
|
||||
test eax, eax
|
||||
jz .exit_fail_alloc
|
||||
|
||||
mov [ImageBufferPtr], eax
|
||||
push eax
|
||||
|
||||
stdcall set_startup_path
|
||||
|
||||
stdcall load_hud_images
|
||||
test eax, eax
|
||||
jnz @f
|
||||
DEBUGF DEBUG_ERR, 'Failed to load HUD images\n'
|
||||
jmp .exit_fail_load_hud
|
||||
|
||||
@@:
|
||||
cld
|
||||
xor eax, eax
|
||||
mov edi, PressedKeys
|
||||
mov ecx, 128 * 2
|
||||
rep stosd
|
||||
|
||||
mov edi, Inventory
|
||||
mov ecx, INVENTORY_SIZE * 2
|
||||
rep stosd
|
||||
|
||||
stdcall akode.set_callbacks, level_load_callback, action_callback
|
||||
|
||||
stdcall akode.load_level, levels.level1
|
||||
|
||||
if FULLSCREEN
|
||||
stdcall hide_cursor
|
||||
push eax
|
||||
end if
|
||||
|
||||
stdcall main_loop
|
||||
|
||||
if FULLSCREEN
|
||||
pop ecx
|
||||
test ecx, ecx
|
||||
jz @f
|
||||
mcall 37, 6 ; delete cursor
|
||||
@@:
|
||||
end if
|
||||
|
||||
.exit_fail_load_hud:
|
||||
stdcall free_hud_images
|
||||
|
||||
pop ecx
|
||||
mcall 68, 13 ; free image buffer
|
||||
|
||||
jmp .exit
|
||||
|
||||
.exit_fail_heap_init:
|
||||
DEBUGF DEBUG_ERR, 'Heap initialization failed\n'
|
||||
jmp .exit
|
||||
|
||||
.exit_fail_load_libs:
|
||||
DEBUGF DEBUG_ERR, 'Failed to load libraries\n'
|
||||
jmp .exit
|
||||
|
||||
.exit_fail_akode_init:
|
||||
DEBUGF DEBUG_ERR, 'AKODE initialization failed\n'
|
||||
jmp .exit
|
||||
|
||||
.exit_fail_alloc:
|
||||
DEBUGF DEBUG_ERR, 'Memory allocation for image buffer failed\n'
|
||||
;jmp .exit
|
||||
|
||||
.exit:
|
||||
stdcall akode.cleanup
|
||||
DEBUGF DEBUG_INFO, 'Exiting\n'
|
||||
|
||||
xor eax, eax
|
||||
dec eax
|
||||
mcall ; kill this thread
|
||||
|
||||
; ============================================================================ ;
|
||||
proc set_startup_path
|
||||
cld
|
||||
mov esi, StartupPath
|
||||
mov ecx, esi
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
test al, al
|
||||
jnz @b
|
||||
|
||||
sub esi, 2
|
||||
std
|
||||
|
||||
@@:
|
||||
lodsb
|
||||
cmp al, '/'
|
||||
jne @b
|
||||
|
||||
mov [esi + 1], byte 0
|
||||
|
||||
mcall 30, 1 ; set current directory
|
||||
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
; < eax = 0 - fail ;
|
||||
; ============================================================================ ;
|
||||
proc load_hud_images
|
||||
mov ebx, [MainWindowWidth]
|
||||
mov ecx, [MainWindowHeight]
|
||||
xor edx, edx
|
||||
|
||||
stdcall akode.load_and_scale_image, LevelLoadingImageFile, ebx, ecx, edx
|
||||
test eax, eax
|
||||
jz .exit
|
||||
|
||||
mov [LevelLoadingImagePtr], eax
|
||||
|
||||
stdcall akode.load_and_scale_image, DeathImageFile, ebx, ecx, edx
|
||||
test eax, eax
|
||||
jz .exit
|
||||
|
||||
mov [DeathImagePtr], eax
|
||||
|
||||
stdcall akode.load_and_scale_image, EndImageFile, ebx, ecx, edx
|
||||
test eax, eax
|
||||
jz .exit
|
||||
|
||||
mov [EndImagePtr], eax
|
||||
|
||||
stdcall akode.load_and_scale_image, HudPanelImageFile, ebx, HUD_PANEL_HEIGHT, edx
|
||||
test eax, eax
|
||||
jz .exit
|
||||
|
||||
mov [HudPanelImagePtr], eax
|
||||
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc free_hud_images
|
||||
xor edx, edx
|
||||
mov ebx, 13
|
||||
|
||||
mov ecx, [LevelLoadingImagePtr]
|
||||
test ecx, ecx
|
||||
jz @f
|
||||
mcall 68 ; free
|
||||
mov [LevelLoadingImagePtr], edx
|
||||
@@:
|
||||
mov ecx, [HudPanelImagePtr]
|
||||
test ecx, ecx
|
||||
jz @f
|
||||
mcall 68
|
||||
mov [HudPanelImagePtr], edx
|
||||
@@:
|
||||
mov ecx, [DeathImagePtr]
|
||||
test ecx, ecx
|
||||
jz @f
|
||||
mcall 68
|
||||
mov [DeathImagePtr], edx
|
||||
@@:
|
||||
mov ecx, [EndImagePtr]
|
||||
test ecx, ecx
|
||||
jz @f
|
||||
mcall 68
|
||||
mov [EndImagePtr], edx
|
||||
@@:
|
||||
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
; < eax = cursor handle / 0 - fail ;
|
||||
; ============================================================================ ;
|
||||
proc hide_cursor
|
||||
mcall 68, 12, 32 * 32 * 4
|
||||
test eax, eax
|
||||
jz .exit
|
||||
|
||||
mov edi, eax
|
||||
xor ebx, ebx
|
||||
shr ecx, 2
|
||||
@@: mov [eax], ebx
|
||||
add eax, 4
|
||||
loop @b
|
||||
|
||||
mcall 37, 4, edi, 2 ; load cursor
|
||||
mov ecx, eax
|
||||
inc ebx
|
||||
mcall 37 ; set cursor
|
||||
|
||||
xchg edi, ecx
|
||||
|
||||
mcall 68, 13
|
||||
|
||||
mov eax, edi
|
||||
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc draw_image uses eax ebx ecx edx esi edi, image_ptr, x, y, width, height
|
||||
mov ebx, [image_ptr]
|
||||
mpack ecx, [width], [height]
|
||||
mpack edx, [x], [y]
|
||||
mov esi, 32
|
||||
xor edi, edi
|
||||
xchg edi, ebp
|
||||
mcall 65
|
||||
mov ebp, edi
|
||||
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc draw_image_to_buffer uses eax ebx ecx edx esi edi, image_ptr, x, y, width, height
|
||||
cld
|
||||
mov esi, [image_ptr]
|
||||
mov edi, [ImageBufferPtr]
|
||||
mov ebx, [MainWindowWidth]
|
||||
mov eax, [y]
|
||||
mul ebx
|
||||
add eax, [x]
|
||||
lea edi, [edi + eax * 4]
|
||||
|
||||
sub ebx, [width]
|
||||
shl ebx, 2
|
||||
mov edx, [height]
|
||||
|
||||
@@:
|
||||
mov ecx, [width]
|
||||
rep movsd
|
||||
add edi, ebx
|
||||
|
||||
sub edx, 1
|
||||
jnz @b
|
||||
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc draw_image_with_transparency_to_buffer uses eax ebx ecx edx esi edi, image_ptr, x, y, width, height
|
||||
mov esi, [image_ptr]
|
||||
mov edi, [ImageBufferPtr]
|
||||
mov ebx, [MainWindowWidth]
|
||||
mov eax, [y]
|
||||
mul ebx
|
||||
add eax, [x]
|
||||
lea edi, [edi + eax * 4]
|
||||
|
||||
sub ebx, [width]
|
||||
shl ebx, 2
|
||||
mov edx, [height]
|
||||
|
||||
.y_draw_loop:
|
||||
mov ecx, [width]
|
||||
|
||||
.x_draw_loop:
|
||||
mov eax, [esi]
|
||||
cmp eax, 0FF00FFh
|
||||
je @f
|
||||
mov [edi], eax
|
||||
@@:
|
||||
add esi, 4
|
||||
add edi, 4
|
||||
|
||||
sub ecx, 1
|
||||
jnz .x_draw_loop
|
||||
|
||||
add edi, ebx
|
||||
|
||||
sub edx, 1
|
||||
jnz .y_draw_loop
|
||||
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc draw_window
|
||||
mcall 12, 1 ; start drawing
|
||||
|
||||
if FULLSCREEN
|
||||
mov ebx, 0FFFFh
|
||||
mov ecx, 0FFFFh
|
||||
else
|
||||
mcall 48, 4 ; eax - skin height
|
||||
|
||||
mpack ebx, MAIN_WINDOW_X, MAIN_WINDOW_WIDTH + 9
|
||||
mpack ecx, MAIN_WINDOW_Y, MAIN_WINDOW_HEIGHT + 4
|
||||
add ecx, eax
|
||||
end if
|
||||
mov edx, MAIN_WINDOW_STYLE
|
||||
mov esi, MAIN_WINDOW_STYLE2
|
||||
mov edi, MAIN_WINDOW_TITLE
|
||||
xor eax, eax
|
||||
mcall ; draw window
|
||||
|
||||
mcall 12, 2 ; end drawing
|
||||
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc draw_world
|
||||
mov ebx, [ImageBufferPtr]
|
||||
;test ebx, ebx
|
||||
;jz @f
|
||||
|
||||
stdcall akode.render
|
||||
stdcall akode.get_image, ebx, FSAA
|
||||
|
||||
mpack ecx, [MainWindowWidth], [WorldViewHeight]
|
||||
xor edx, edx
|
||||
mov esi, 32
|
||||
xor edi, edi
|
||||
xchg edi, ebp
|
||||
mcall 65
|
||||
mov ebp, edi
|
||||
|
||||
;@@:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc draw_hud
|
||||
mov eax, [HudPanelNeedsRedraw]
|
||||
test eax, eax
|
||||
jz .exit
|
||||
|
||||
xor eax, eax
|
||||
mov [HudPanelNeedsRedraw], eax
|
||||
|
||||
stdcall draw_image_to_buffer, [HudPanelImagePtr], eax, [WorldViewHeight], [MainWindowWidth], HUD_PANEL_HEIGHT
|
||||
|
||||
mov esi, Inventory + 4
|
||||
mov ebx, INVENTORY_Y
|
||||
add ebx, [WorldViewHeight]
|
||||
mov edx, 2
|
||||
|
||||
.y_inventory_loop:
|
||||
mov eax, INVENTORY_X
|
||||
mov ecx, INVENTORY_SIZE / 2
|
||||
|
||||
.x_inventory_loop:
|
||||
mov edi, [esi]
|
||||
add esi, 8
|
||||
test edi, edi
|
||||
jz @f
|
||||
stdcall draw_image_with_transparency_to_buffer, edi, eax, ebx, OBJECT_IMAGE_WIDTH, OBJECT_IMAGE_HEIGHT
|
||||
|
||||
@@:
|
||||
add eax, OBJECT_IMAGE_WIDTH + INVENTORY_PADDING_X
|
||||
|
||||
sub ecx, 1
|
||||
jnz .x_inventory_loop
|
||||
|
||||
add ebx, OBJECT_IMAGE_HEIGHT + INVENTORY_PADDING_Y
|
||||
|
||||
sub edx, 1
|
||||
jnz .y_inventory_loop
|
||||
|
||||
mpack ecx, [MainWindowWidth], HUD_PANEL_HEIGHT
|
||||
mov edx, [WorldViewHeight]
|
||||
mov ebx, [ImageBufferPtr]
|
||||
mov eax, [MainWindowWidth]
|
||||
imul eax, edx
|
||||
lea ebx, [ebx + eax * 4]
|
||||
mov esi, 32
|
||||
xor edi, edi
|
||||
xchg edi, ebp
|
||||
mcall 65
|
||||
mov ebp, edi
|
||||
|
||||
jmp draw_game_message
|
||||
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc draw_game_message
|
||||
mov esi, [GameMessage]
|
||||
test esi, esi
|
||||
jz .exit
|
||||
|
||||
mpack ebx, GAME_MESSAGE_X, GAME_MESSAGE_Y
|
||||
add ebx, [WorldViewHeight]
|
||||
mov ecx, GAME_MESSAGE_COLOR or (80h shl 24)
|
||||
|
||||
.draw_strings_loop:
|
||||
mov edx, esi
|
||||
|
||||
@@:
|
||||
mov al, [esi]
|
||||
add esi, 1
|
||||
|
||||
test al, al
|
||||
jz .draw_last_string
|
||||
cmp al, 0Ah
|
||||
jne @b
|
||||
|
||||
mov [esi - 1], byte 0
|
||||
|
||||
mcall 4
|
||||
|
||||
mov [esi - 1], byte 0Ah
|
||||
add ebx, 10
|
||||
jmp .draw_strings_loop
|
||||
|
||||
.draw_last_string:
|
||||
mcall 4
|
||||
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc main_loop
|
||||
locals
|
||||
frame_count dd 0
|
||||
last_timestamp dd 0
|
||||
endl
|
||||
|
||||
.main_loop:
|
||||
mcall 26, 9 ; get timestamp
|
||||
mov ebx, eax
|
||||
sub ebx, [last_timestamp]
|
||||
cmp ebx, 100
|
||||
jb @f
|
||||
|
||||
mov [last_timestamp], eax
|
||||
imul eax, [frame_count], 100
|
||||
xor edx, edx
|
||||
mov [frame_count], edx
|
||||
div ebx ; eax - fps
|
||||
|
||||
DEBUGF DEBUG_FINE, 'FPS: %u\n', eax
|
||||
|
||||
@@:
|
||||
mcall 11 ; check events
|
||||
|
||||
test eax, eax
|
||||
jz .idle
|
||||
|
||||
dec eax
|
||||
jz .redraw
|
||||
|
||||
dec eax
|
||||
jz .key
|
||||
|
||||
dec eax
|
||||
jz .button
|
||||
|
||||
sub eax, 3
|
||||
jz .mouse
|
||||
|
||||
jmp .idle
|
||||
|
||||
.redraw:
|
||||
stdcall draw_window
|
||||
mov [HudPanelNeedsRedraw], 1
|
||||
|
||||
.idle:
|
||||
mov eax, [GameStatus]
|
||||
test eax, eax
|
||||
jnz @f
|
||||
|
||||
stdcall akode.process
|
||||
|
||||
mov eax, [GameStatus]
|
||||
test eax, eax
|
||||
jnz @f
|
||||
|
||||
stdcall draw_hud
|
||||
stdcall draw_world
|
||||
|
||||
add [frame_count], 1
|
||||
jmp .main_loop
|
||||
|
||||
@@: cmp eax, GAME_STATUS.LEVEL_LOAD_FAILED
|
||||
jne @f
|
||||
jmp .exit
|
||||
|
||||
@@: cmp eax, GAME_STATUS.DEAD
|
||||
jne @f
|
||||
stdcall draw_image, [DeathImagePtr], 0, 0, [MainWindowWidth], [MainWindowHeight]
|
||||
jmp .main_loop
|
||||
|
||||
@@: cmp eax, GAME_STATUS.END
|
||||
jne @f
|
||||
stdcall draw_image, [EndImagePtr], 0, 0, [MainWindowWidth], [MainWindowHeight]
|
||||
@@:
|
||||
jmp .main_loop
|
||||
|
||||
.key:
|
||||
stdcall get_key
|
||||
test eax, eax
|
||||
jz .idle
|
||||
|
||||
cmp eax, 001h ; Esc
|
||||
je .exit
|
||||
|
||||
cmp eax, 039h ; Space
|
||||
je .space_pressed
|
||||
cmp eax, 002h ; 1
|
||||
jb @f
|
||||
cmp eax, 00Bh ; 0
|
||||
ja @f
|
||||
|
||||
; 0..9 pressed
|
||||
sub eax, 002h
|
||||
mov eax, dword [Inventory + eax * 8]
|
||||
test eax, eax
|
||||
jz @f
|
||||
shl eax, 16
|
||||
push eax
|
||||
|
||||
stdcall check_key, 02Ah ; left Shift
|
||||
test eax, eax
|
||||
jnz .shift_pressed
|
||||
|
||||
stdcall check_key, 036h ; right Shift
|
||||
test eax, eax
|
||||
jnz .shift_pressed
|
||||
|
||||
pop eax
|
||||
or eax, ACTION.USE_OBJECT
|
||||
stdcall akode.action, eax
|
||||
jmp @f
|
||||
|
||||
.shift_pressed:
|
||||
pop eax
|
||||
or eax, ACTION.LOOK_AT_OBJECT
|
||||
stdcall akode.action, eax
|
||||
jmp @f
|
||||
|
||||
.space_pressed:
|
||||
stdcall check_key, 02Ah ; left Shift
|
||||
test eax, eax
|
||||
jnz .shift_pressed2
|
||||
|
||||
stdcall check_key, 036h ; right Shift
|
||||
test eax, eax
|
||||
jnz .shift_pressed2
|
||||
|
||||
stdcall akode.action, ACTION.DO_SOMETHING
|
||||
jmp @f
|
||||
|
||||
.shift_pressed2:
|
||||
stdcall akode.action, ACTION.LOOK_AROUND
|
||||
|
||||
@@:
|
||||
xor esi, esi
|
||||
dec esi
|
||||
|
||||
stdcall check_key, 0E048h ; ^
|
||||
test eax, eax
|
||||
jz @f
|
||||
mov esi, AKODE_DIRECTION.NORTH
|
||||
jmp .set_moving_direction
|
||||
|
||||
@@: stdcall check_key, 0E050h ; v
|
||||
test eax, eax
|
||||
jz @f
|
||||
mov esi, AKODE_DIRECTION.SOUTH
|
||||
jmp .set_moving_direction
|
||||
|
||||
@@: stdcall check_key, 011h ; W
|
||||
test eax, eax
|
||||
jz @f
|
||||
mov esi, AKODE_DIRECTION.NORTH
|
||||
jmp .set_moving_direction
|
||||
|
||||
@@: stdcall check_key, 01Fh ; S
|
||||
test eax, eax
|
||||
jz @f
|
||||
mov esi, AKODE_DIRECTION.SOUTH
|
||||
;jmp .set_moving_direction
|
||||
|
||||
@@:
|
||||
|
||||
.set_moving_direction:
|
||||
test esi, esi
|
||||
js @f
|
||||
stdcall akode.start_moving, esi
|
||||
jmp .turn
|
||||
|
||||
@@:
|
||||
stdcall akode.stop_moving
|
||||
|
||||
.turn:
|
||||
xor esi, esi
|
||||
dec esi
|
||||
|
||||
stdcall check_key, 0E04Bh ; <-
|
||||
test eax, eax
|
||||
jz @f
|
||||
mov esi, AKODE_DIRECTION.WEST
|
||||
jmp .set_turning_direction
|
||||
|
||||
@@: stdcall check_key, 0E04Dh ; ->
|
||||
test eax, eax
|
||||
jz @f
|
||||
mov esi, AKODE_DIRECTION.EAST
|
||||
jmp .set_turning_direction
|
||||
|
||||
@@: stdcall check_key, 01Eh ; A
|
||||
test eax, eax
|
||||
jz @f
|
||||
mov esi, AKODE_DIRECTION.WEST
|
||||
jmp .set_turning_direction
|
||||
|
||||
@@: stdcall check_key, 020h ; D
|
||||
test eax, eax
|
||||
jz @f
|
||||
mov esi, AKODE_DIRECTION.EAST
|
||||
;jmp .set_turning_direction
|
||||
|
||||
@@:
|
||||
|
||||
.set_turning_direction:
|
||||
test esi, esi
|
||||
js @f
|
||||
stdcall akode.start_turning, esi
|
||||
jmp .key
|
||||
|
||||
@@:
|
||||
stdcall akode.stop_turning
|
||||
jmp .key
|
||||
|
||||
.mouse:
|
||||
|
||||
jmp .idle
|
||||
|
||||
.button:
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
; < eax = key scancode / 0 - no keys ;
|
||||
; ============================================================================ ;
|
||||
proc get_key
|
||||
mcall 2 ; get key scancode
|
||||
|
||||
test al, al
|
||||
jz @f
|
||||
xor eax, eax
|
||||
jmp .exit
|
||||
|
||||
@@:
|
||||
shr eax, 8
|
||||
|
||||
cmp eax, 0E1h
|
||||
jne @f
|
||||
mcall 2
|
||||
mcall 2
|
||||
xor eax, eax
|
||||
jmp .exit
|
||||
|
||||
@@:
|
||||
xor ebx, ebx
|
||||
mov ecx, eax
|
||||
|
||||
cmp eax, 0E0h
|
||||
jne @f
|
||||
mcall 2
|
||||
shr eax, 8
|
||||
mov ecx, eax
|
||||
or eax, 0E000h
|
||||
mov ebx, 128
|
||||
|
||||
@@:
|
||||
test ecx, 80h
|
||||
jnz .key_up
|
||||
|
||||
; key down
|
||||
add ebx, ecx
|
||||
lea ebx, [PressedKeys + ebx * 4]
|
||||
|
||||
mov edx, [ebx]
|
||||
test edx, edx
|
||||
jz @f
|
||||
|
||||
xor eax, eax
|
||||
jmp .exit
|
||||
|
||||
@@:
|
||||
inc edx
|
||||
mov [ebx], edx
|
||||
jmp .exit
|
||||
|
||||
.key_up:
|
||||
and ecx, 7Fh
|
||||
add ebx, ecx
|
||||
xor edx, edx
|
||||
mov [PressedKeys + ebx * 4], edx
|
||||
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
; < eax = 1 - key pressed / 0 - not pressed ;
|
||||
; ============================================================================ ;
|
||||
proc check_key scancode
|
||||
mov eax, [scancode]
|
||||
mov ecx, eax
|
||||
shr eax, 8
|
||||
and ecx, 7Fh
|
||||
xor ebx, ebx
|
||||
|
||||
cmp eax, 0E0h
|
||||
jne @f
|
||||
mov ebx, 128
|
||||
|
||||
@@:
|
||||
add ebx, ecx
|
||||
mov eax, [PressedKeys + ebx * 4]
|
||||
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc level_load_callback uses eax ebx ecx, load_action, action_result
|
||||
mov eax, [load_action]
|
||||
mov ebx, [action_result]
|
||||
xor ecx, ecx
|
||||
|
||||
cmp eax, AKODE_LEVEL_LOAD.START
|
||||
jne @f
|
||||
stdcall draw_image, [LevelLoadingImagePtr], ecx, ecx, [MainWindowWidth], [MainWindowHeight]
|
||||
|
||||
cmp ebx, -1
|
||||
je .level_load_failed
|
||||
|
||||
mov [GameMessage], ebx
|
||||
inc ecx
|
||||
mov [HudPanelNeedsRedraw], ecx
|
||||
jmp .exit
|
||||
|
||||
@@: cmp eax, AKODE_LEVEL_LOAD.END
|
||||
jne @f
|
||||
DEBUGF DEBUG_INFO, 'Level load result: %u\n', ebx
|
||||
|
||||
test ebx, ebx
|
||||
jnz .exit
|
||||
|
||||
.level_load_failed:
|
||||
DEBUGF DEBUG_ERR, 'Failed to load level\n'
|
||||
mov [GameStatus], GAME_STATUS.LEVEL_LOAD_FAILED
|
||||
;jmp .exit
|
||||
|
||||
@@:
|
||||
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc action_callback action, cell_x, cell_y, action_result
|
||||
m2m [GameMessage], [action_result]
|
||||
mov [HudPanelNeedsRedraw], 1
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc add_object_to_inventory uses eax ecx edi, object_id, object_image_ptr
|
||||
mov edi, Inventory
|
||||
mov ecx, INVENTORY_SIZE
|
||||
|
||||
.inventory_loop:
|
||||
mov eax, [edi]
|
||||
test eax, eax
|
||||
jnz @f
|
||||
|
||||
mov eax, [object_id]
|
||||
mov [edi], eax
|
||||
mov eax, [object_image_ptr]
|
||||
mov [edi + 4], eax
|
||||
mov [HudPanelNeedsRedraw], ecx
|
||||
jmp .exit
|
||||
|
||||
@@:
|
||||
add edi, 8
|
||||
|
||||
sub ecx, 1
|
||||
jnz .inventory_loop
|
||||
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc remove_object_from_inventory uses eax ecx esi, object_id
|
||||
mov eax, [object_id]
|
||||
mov esi, Inventory
|
||||
mov ecx, INVENTORY_SIZE
|
||||
|
||||
.inventory_loop:
|
||||
cmp [esi], eax
|
||||
jne @f
|
||||
|
||||
xor eax, eax
|
||||
mov [esi], eax
|
||||
mov [esi + 4], eax
|
||||
mov [HudPanelNeedsRedraw], ecx
|
||||
jmp .exit
|
||||
|
||||
@@:
|
||||
add esi, 8
|
||||
|
||||
sub ecx, 1
|
||||
jnz .inventory_loop
|
||||
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
; < eax = pointer to image data / 0 - fail ;
|
||||
; ============================================================================ ;
|
||||
proc load_object_image image_path_ptr
|
||||
stdcall akode.load_and_scale_image, [image_path_ptr], OBJECT_IMAGE_WIDTH, OBJECT_IMAGE_HEIGHT, 0
|
||||
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc free_object_image uses eax ebx ecx, image_ptr
|
||||
mov ecx, [image_ptr]
|
||||
test ecx, ecx
|
||||
jz .exit
|
||||
|
||||
mcall 68, 13
|
||||
|
||||
.exit:
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc player_death
|
||||
mov [GameStatus], GAME_STATUS.DEAD
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================================================================ ;
|
||||
proc game_over
|
||||
mov [GameStatus], GAME_STATUS.END
|
||||
ret
|
||||
endp
|
||||
; ============================================================================ ;
|
||||
|
||||
; ============================ Initialized data ============================== ;
|
||||
DATA
|
||||
include 'data.inc'
|
||||
|
||||
; for debug-fdo
|
||||
include_debug_strings
|
||||
|
||||
align 4
|
||||
@IMPORT:
|
||||
include 'import.inc'
|
||||
|
||||
; =========================== Uninitialized data ============================= ;
|
||||
UDATA
|
||||
include 'udata.inc'
|
||||
|
||||
; ================================= The End ================================== ;
|
||||
MEOS_APP_END
|
447
programs/games/Dungeons/Resources/Levels/1.inc
Normal file
@ -0,0 +1,447 @@
|
||||
|
||||
levels.level1 akode.LevelHeader <level1.Width, level1.Height>, <8, 1>, AKODE_DIRECTION.SOUTH, 0FF00FFh, 000000h, BLOCK_BASE_SIZE * 5, 6, 1, level1.init, 0, level1.action
|
||||
|
||||
level1:
|
||||
|
||||
.Width = 24
|
||||
.Height = 25
|
||||
|
||||
W equ level1.Wall
|
||||
w equ level1.OtherWall
|
||||
_ equ level1.PassableArea
|
||||
0 equ level1.NotPassableArea
|
||||
% equ level1.WallWithCrazyWoodDoor
|
||||
I equ level1.IronDoor
|
||||
L equ level1.WallWithLever1
|
||||
q equ level1.WallWithLever2
|
||||
v equ level1.WallWithLever3
|
||||
e equ level1.WallWithLever4
|
||||
c equ level1.ColumnArea
|
||||
o equ level1.OgreArea
|
||||
P equ level1.PortalArea
|
||||
|
||||
.Grid:
|
||||
dd W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W
|
||||
dd W,_,_,W,W,_,_,W,_,W,_,W,_,_,_,_,W,W,W,W,W,W,W,W
|
||||
dd W,_,_,W,W,_,_,W,_,W,_,W,_,_,_,_,_,_,_,_,_,_,_,W
|
||||
dd W,_,_,_,_,_,_,W,_,W,_,W,_,_,_,_,_,_,_,_,_,_,_,W
|
||||
dd W,W,W,_,_,W,W,W,_,W,L,W,_,_,_,W,W,W,_,_,_,W,W,W
|
||||
dd W,_,_,_,_,_,_,W,_,_,_,W,_,_,_,W,0,W,_,_,_,W,0,W
|
||||
dd W,_,W,_,W,_,_,W,_,W,W,W,W,W,_,W,c,_,_,_,_,_,c,W
|
||||
dd W,_,W,_,W,_,_,W,_,W,W,W,W,W,_,W,_,_,_,c,_,_,_,W
|
||||
dd W,W,W,_,W,W,W,W,%,W,W,W,W,W,_,W,_,_,W,0,W,_,_,W
|
||||
dd W,_,W,_,W,_,_,_,_,_,_,_,W,W,_,W,_,_,W,W,W,_,_,W
|
||||
dd W,_,W,W,W,_,_,_,_,_,_,_,I,_,_,W,_,_,_,_,_,_,_,W
|
||||
dd W,_,_,_,W,_,_,_,_,_,_,_,W,W,W,W,W,W,W,W,W,%,W,W
|
||||
dd W,_,_,_,W,W,W,W,q,v,e,W,W,_,_,_,_,_,_,_,_,_,_,W
|
||||
dd W,_,_,_,_,_,_,_,_,_,_,_,W,_,W,W,W,W,W,W,W,W,W,W
|
||||
dd W,_,_,_,W,_,_,_,_,_,_,_,W,o,W,_,_,_,_,_,_,_,_,W
|
||||
dd W,_,_,_,W,W,W,W,W,W,W,W,W,0,W,W,W,W,_,_,_,_,_,W
|
||||
dd W,_,_,_,W,_,_,_,_,_,_,W,_,_,_,_,_,W,w,w,w,w,w,w
|
||||
dd W,_,_,_,_,_,_,_,_,_,_,W,_,_,_,_,_,_,_,_,_,_,_,w
|
||||
dd W,_,_,_,_,_,_,_,_,_,_,W,W,W,W,W,_,w,w,_,w,w,_,w
|
||||
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,w,_,_,_,w,_,w
|
||||
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,_,_,P,_,_,_,w
|
||||
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,w,_,_,_,w,_,w
|
||||
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,w,w,_,w,w,_,w
|
||||
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,_,_,_,_,_,_,w
|
||||
dd W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,w,w,w,w,w,w,w,w,w
|
||||
|
||||
restore W, w, _, 0, %, I, L, q, v, e, c, o, P
|
||||
|
||||
.Chest akode.Object textures.Chest, <13, 2>, 1, 0
|
||||
.Column1 akode.Object textures.Column1, <16, 5>, 1, 0
|
||||
.Column2 akode.Object textures.Column2, <19, 8>, 1, 0
|
||||
.Column3 akode.Object textures.Column3, <22, 5>, 1, 0
|
||||
.Ogre akode.Object textures.Ogre, <13, 15>, 1, 0
|
||||
.Portal akode.Object textures.Portal, <19, 20>, 1, 1
|
||||
|
||||
.Column4TextureDescPtr dd textures.Column4
|
||||
|
||||
.Wall akode.GridCell <textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
0, 0
|
||||
|
||||
.OtherWall akode.GridCell <textures.GreenStone2, 0>, \
|
||||
<textures.GreenStone2, 0>, \
|
||||
<textures.GreenStone2, 0>, \
|
||||
<textures.GreenStone2, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
0, 0
|
||||
|
||||
.WallWithCrazyWoodDoor akode.GridCell <textures.GreenStone1, textures.CrazyWoodDoor>, \
|
||||
<textures.GreenStone1, textures.CrazyWoodDoor>, \
|
||||
<textures.GreenStone1, textures.CrazyWoodDoor>, \
|
||||
<textures.GreenStone1, textures.CrazyWoodDoor>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
0, 0
|
||||
|
||||
.IronDoor akode.GridCell <textures.IronDoor, 0>, \
|
||||
<textures.IronDoor, 0>, \
|
||||
<textures.IronDoor, 0>, \
|
||||
<textures.IronDoor, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
0, 0
|
||||
|
||||
.WallWithLever1 akode.GridCell <textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, textures.RedLeverDown>, \
|
||||
<textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, textures.RedLeverUp>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
0, 0
|
||||
|
||||
.WallWithLever2 akode.GridCell <textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, textures.RedLeverUp>, \
|
||||
<textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, textures.RedLeverDown>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
0, 0
|
||||
|
||||
.WallWithLever3 akode.GridCell <textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, textures.RedLeverUp>, \
|
||||
<textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, textures.RedLeverDown>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
0, 0
|
||||
|
||||
.WallWithLever4 akode.GridCell <textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, textures.RedLeverUp>, \
|
||||
<textures.GreenStone1, 0>, \
|
||||
<textures.GreenStone1, textures.RedLeverDown>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
0, 0
|
||||
|
||||
.PassableArea akode.GridCell <0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<textures.YellowStone1, 0>, \
|
||||
<textures.YellowStone1, 0>, \
|
||||
1, 0
|
||||
|
||||
.NotPassableArea akode.GridCell <0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<textures.YellowStone1, 0>, \
|
||||
<textures.YellowStone1, 0>, \
|
||||
0, 0
|
||||
|
||||
.ColumnArea akode.GridCell <0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<textures.YellowStone1, 0>, \
|
||||
<textures.YellowStone1, 0>, \
|
||||
1, level1.columns
|
||||
|
||||
.OgreArea akode.GridCell <0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<textures.YellowStone1, 0>, \
|
||||
<textures.YellowStone1, 0>, \
|
||||
1, level1.ogre
|
||||
|
||||
.PortalArea akode.GridCell <0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<0, 0>, \
|
||||
<textures.PortalFloor, 0>, \
|
||||
<textures.YellowStone1, 0>, \
|
||||
1, level1.portal
|
||||
|
||||
.CoinImagePtr dd 0
|
||||
.Sun1ImagePtr dd 0
|
||||
.Sun2ImagePtr dd 0
|
||||
.Sun3ImagePtr dd 0
|
||||
|
||||
proc level1.init
|
||||
stdcall load_object_image, .coin_file_path
|
||||
mov [level1.CoinImagePtr], eax
|
||||
stdcall load_object_image, .sun1_file_path
|
||||
mov [level1.Sun1ImagePtr], eax
|
||||
stdcall load_object_image, .sun2_file_path
|
||||
mov [level1.Sun2ImagePtr], eax
|
||||
stdcall load_object_image, .sun3_file_path
|
||||
mov [level1.Sun3ImagePtr], eax
|
||||
|
||||
mov eax, .message
|
||||
ret
|
||||
|
||||
.coin_file_path db 'Resources/Textures/Objects/Coin.png', 0
|
||||
.sun1_file_path db 'Resources/Textures/Objects/Sun1.png', 0
|
||||
.sun2_file_path db 'Resources/Textures/Objects/Sun2.png', 0
|
||||
.sun3_file_path db 'Resources/Textures/Objects/Sun3.png', 0
|
||||
|
||||
.message langstr0 ru, < \
|
||||
'<27>ë - ¨áŞ âĽŤě ᮪஢¨é. <20>ďŁ Ş Ś¨˘Ľ Żŕ¨˘ĽŤ ˘ á ˘ ', 10, \
|
||||
'ŤĽáăî ŻĽéĽŕă, Ł¤Ľ, ŻŽ ŕ á᪠§ Ź Ἅď, Ż ŕă á⎍Ľâ¨Š ', 10, \
|
||||
' § ¤, Ž¤¨ Żŕ ˘¨âĽŤě, áŻŕďâ Ť á˘Žî Ş §ă. <20> ŻĽéĽŕĽ ˘ë ', 10, \
|
||||
' 荨... ¤˘Ľŕě. <20>ᨍ¨Ľ - ¤˘Ľŕě ŽâŞŕëâ ! <20>ë ˘ŽčŤ¨ ˘ăâŕě', 10, \
|
||||
'¨ ¤˘Ľŕě á ŁŕŽĺŽâŽŹ § 华ŻăŤ áě. <20>Ž§ŹŽŚŽ, í⎠˘ č č á', 10, \
|
||||
' Šâ¨ ĽáŹĽâëĽ ĄŽŁ âá⢠¨Ť¨ ŻŽŁ¨Ąăâě... ' >
|
||||
|
||||
endp
|
||||
|
||||
proc level1.action uses ebx ecx edx, action, cell_x, cell_y
|
||||
mov eax, [action]
|
||||
mov ebx, [cell_x]
|
||||
mov ecx, [cell_y]
|
||||
|
||||
mov edx, ecx
|
||||
imul edx, level1.Width
|
||||
add edx, ebx
|
||||
lea edx, [level1.Grid + edx * 4]
|
||||
|
||||
cmp ax, ACTION.DO_SOMETHING
|
||||
jne .check_next_action
|
||||
|
||||
cmp edx, level1.Grid + (7 * level1.Width + 8) * 4
|
||||
jne @f
|
||||
cmp dword [level1.Grid + (8 * level1.Width + 8) * 4], level1.WallWithCrazyWoodDoor
|
||||
jne .exit_no_message
|
||||
|
||||
mov eax, .message_door1_closed
|
||||
jmp .exit
|
||||
.message_door1_closed langstr0 ru, < \
|
||||
'<27> ŻĽŕâŽ. <20> ¤˘Ľŕ¨ Ľâ ¨ ŕă窨, ¨ § ŹŽçŽŠ ᪢ Ś¨ë. ', 10, \
|
||||
'<27>ĽŕŽďâŽ, Ł¤Ľ-⎠¤ŽŤŚĽ Ąëâě áŞŕëâëŠ ŹĽĺ ¨§Ź... ' >
|
||||
|
||||
@@: cmp edx, level1.Grid + (10 * level1.Width + 21) * 4
|
||||
jne @f
|
||||
cmp dword [level1.Grid + (11 * level1.Width + 21) * 4], level1.WallWithCrazyWoodDoor
|
||||
jne .exit_no_message
|
||||
|
||||
mov eax, .message_door3_closed
|
||||
jmp .exit
|
||||
.message_door3_closed langstr0 ru, < \
|
||||
'<27> Şăî ¤˘Ľŕě ˘ë ㌼ ˘¨¤ĽŤ¨, ¨ ˘ ŻŕŽčŤëŠ ŕ § Ž â Ş ', 10, \
|
||||
'ŻŕŽá⎠Ľ ŽâŞŕëŤ áě. ' >
|
||||
|
||||
@@: cmp edx, level1.Grid + (5 * level1.Width + 10) * 4
|
||||
jne @f
|
||||
cmp dword [level1.Grid + (8 * level1.Width + 8) * 4], level1.WallWithCrazyWoodDoor
|
||||
jne .exit_no_message
|
||||
|
||||
mov [level1.WallWithLever1.WallTexture4.DescPtr2], textures.RedLeverDown
|
||||
mov dword [level1.Grid + (8 * level1.Width + 8) * 4], level1.PassableArea
|
||||
|
||||
mov eax, .message_door1_opens
|
||||
jmp .exit
|
||||
.message_door1_opens langstr0 ru, < \
|
||||
'<27>ë áŤëč¨âĽ §˘ăŞ ŤĽĄń¤Ş¨ ¨ áŞŕĽŚĽâ čĽáâĽŕńŽŞ. ' >
|
||||
|
||||
@@: cmp edx, level1.Grid + (11 * level1.Width + 8) * 4
|
||||
jne @f
|
||||
mov eax, [level1.WallWithLever2.WallTexture2.DescPtr2]
|
||||
mov ebx, [level1.WallWithLever2.WallTexture4.DescPtr2]
|
||||
mov [level1.WallWithLever2.WallTexture2.DescPtr2], ebx
|
||||
mov [level1.WallWithLever2.WallTexture4.DescPtr2], eax
|
||||
jmp .3levers
|
||||
|
||||
@@: cmp edx, level1.Grid + (11 * level1.Width + 9) * 4
|
||||
jne @f
|
||||
mov eax, [level1.WallWithLever3.WallTexture2.DescPtr2]
|
||||
mov ebx, [level1.WallWithLever3.WallTexture4.DescPtr2]
|
||||
mov [level1.WallWithLever3.WallTexture2.DescPtr2], ebx
|
||||
mov [level1.WallWithLever3.WallTexture4.DescPtr2], eax
|
||||
jmp .3levers
|
||||
|
||||
@@: cmp edx, level1.Grid + (11 * level1.Width + 10) * 4
|
||||
jne @f
|
||||
mov eax, [level1.WallWithLever4.WallTexture2.DescPtr2]
|
||||
mov ebx, [level1.WallWithLever4.WallTexture4.DescPtr2]
|
||||
mov [level1.WallWithLever4.WallTexture2.DescPtr2], ebx
|
||||
mov [level1.WallWithLever4.WallTexture4.DescPtr2], eax
|
||||
jmp .3levers
|
||||
|
||||
@@: cmp edx, level1.Grid + (10 * level1.Width + 11) * 4
|
||||
jne @f
|
||||
cmp dword [level1.Grid + (10 * level1.Width + 12) * 4], level1.IronDoor
|
||||
jne .exit_no_message
|
||||
mov eax, .message_door2_closed
|
||||
jmp .exit
|
||||
|
||||
@@: jmp .exit_no_message
|
||||
|
||||
.check_next_action:
|
||||
cmp ax, AKODE_ACTION.CELL_ENTER
|
||||
jne .exit_no_message
|
||||
|
||||
cmp edx, level1.Grid + (2 * level1.Width + 13) * 4
|
||||
jne @f
|
||||
cmp [level1.Chest.Visible], 1
|
||||
jne .exit_no_message
|
||||
|
||||
stdcall add_object_to_inventory, 4, [level1.CoinImagePtr]
|
||||
stdcall add_object_to_inventory, 1, [level1.Sun1ImagePtr]
|
||||
stdcall add_object_to_inventory, 2, [level1.Sun2ImagePtr]
|
||||
stdcall add_object_to_inventory, 3, [level1.Sun3ImagePtr]
|
||||
|
||||
mov [level1.Chest.Visible], 0
|
||||
mov eax, .message_chest
|
||||
jmp .exit
|
||||
.message_chest langstr0 ru, < \
|
||||
'<27>ë 荨 áă¤ăŞ á Ą ŕ 华Ź: 1 §ŽŤŽâŽŠ ŹŽĽâŞŽŠ ¨ ', 10, \
|
||||
'3-Źď ŹŽĽâ Ź¨ á ¨§ŽĄŕ ŚĽ¨ĽŹ áŽŤć ˘ ŕ §ëĺ ä § ĺ. ' >
|
||||
|
||||
@@: cmp edx, level1.Grid + (14 * level1.Width + 13) * 4
|
||||
jne @f
|
||||
cmp [level1.Ogre.Visible], 1
|
||||
jne .exit_no_message
|
||||
mov eax, .message_ogre
|
||||
jmp .exit
|
||||
|
||||
.message_ogre langstr0 ru, < \
|
||||
'- <20>⎊! <20>㤠í⎠âë? <20> ŤěčĽ ĺŽ¤ Ľâ. ' >
|
||||
|
||||
@@:
|
||||
|
||||
.exit_no_message:
|
||||
xor eax, eax
|
||||
|
||||
.exit:
|
||||
ret
|
||||
|
||||
.3levers:
|
||||
mov eax, [level1.WallWithLever2.WallTexture2.DescPtr2]
|
||||
mov ebx, [level1.WallWithLever3.WallTexture2.DescPtr2]
|
||||
mov ecx, [level1.WallWithLever4.WallTexture2.DescPtr2]
|
||||
|
||||
cmp eax, textures.RedLeverDown
|
||||
jne @f
|
||||
cmp ebx, textures.RedLeverUp
|
||||
jne @f
|
||||
cmp ecx, textures.RedLeverDown
|
||||
jne @f
|
||||
mov dword [level1.Grid + (10 * level1.Width + 12) * 4], level1.PassableArea
|
||||
mov eax, .message_door2_opens
|
||||
jmp .exit
|
||||
|
||||
@@:
|
||||
mov eax, .message_3levers
|
||||
jmp .exit
|
||||
|
||||
.message_3levers langstr0 ru, < \
|
||||
'<27>ë ŻĽŕĽáâ ˘¨Ť¨ íâŽâ ŕëç Ł ˘ ¤ŕ㣎Ľ ŻŽŤŽŚĽ¨Ľ. ' >
|
||||
.message_door2_closed langstr0 ru, < \
|
||||
'<27>Žâě ˘ë ¨ ŻŽŤë ᨍ, Ž ᤢ¨ăâě íâă ¤˘Ľŕě ĺŽâě ', 10, \
|
||||
'Ź¨ŤŤ¨ŹĽâŕ ă ˘ á Ľ ŻŽŤă稍Žáě. ' >
|
||||
.message_door2_opens langstr0 ru, < \
|
||||
'<27>Ž ˘ á ¤Žńááď ŹĽâ ŤŤ¨çĽáިŠ áŞŕĽŚĽâ. ' >
|
||||
endp
|
||||
|
||||
proc level1.columns uses ebx ecx, action, cell_x, cell_y
|
||||
mov eax, [action]
|
||||
cmp ax, ACTION.USE_OBJECT
|
||||
jne .exit_no_message
|
||||
|
||||
shr eax, 16
|
||||
mov ebx, eax
|
||||
|
||||
mov eax, [cell_x]
|
||||
|
||||
cmp eax, 16
|
||||
jne @f
|
||||
cmp ebx, 1
|
||||
jne .exit_no_message
|
||||
stdcall remove_object_from_inventory, 1
|
||||
mov eax, [level1.Column4TextureDescPtr]
|
||||
mov [level1.Column1.TextureDescPtr], eax
|
||||
mov [level1.Column1.DisableShading], 1
|
||||
mov eax, .message_activated
|
||||
jmp .exit
|
||||
|
||||
@@: cmp eax, 19
|
||||
jne @f
|
||||
cmp ebx, 2
|
||||
jne .exit_no_message
|
||||
stdcall remove_object_from_inventory, 2
|
||||
mov eax, [level1.Column4TextureDescPtr]
|
||||
mov [level1.Column2.TextureDescPtr], eax
|
||||
mov [level1.Column2.DisableShading], 1
|
||||
mov eax, .message_activated
|
||||
jmp .exit
|
||||
|
||||
@@: cmp eax, 22
|
||||
jne @f
|
||||
cmp ebx, 3
|
||||
jne .exit_no_message
|
||||
stdcall remove_object_from_inventory, 3
|
||||
mov eax, [level1.Column4TextureDescPtr]
|
||||
mov [level1.Column3.TextureDescPtr], eax
|
||||
mov [level1.Column3.DisableShading], 1
|
||||
mov eax, .message_activated
|
||||
jmp .exit
|
||||
|
||||
@@:
|
||||
.exit_no_message:
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.exit:
|
||||
mov ecx, [level1.Column1.DisableShading]
|
||||
and ecx, [level1.Column2.DisableShading]
|
||||
and ecx, [level1.Column3.DisableShading]
|
||||
jecxz @f
|
||||
mov dword [level1.Grid + (11 * level1.Width + 21) * 4], level1.PassableArea
|
||||
@@:
|
||||
ret
|
||||
|
||||
.message_activated langstr0 ru, < \
|
||||
'<27>ŽŤŽ ç Ť ᢼâ¨âěáď áâŕ ëŹ á˘ĽâŽŹ, ¤Ż¨áě ', 10, \
|
||||
'¨á缧Ť .' >
|
||||
endp
|
||||
|
||||
proc level1.ogre action, cell_x, cell_y
|
||||
mov eax, [action]
|
||||
|
||||
cmp ax, ACTION.DO_SOMETHING
|
||||
jne @f
|
||||
stdcall player_death
|
||||
xor eax, eax
|
||||
jmp .exit
|
||||
|
||||
@@: cmp ax, ACTION.USE_OBJECT
|
||||
jne .exit_default
|
||||
shr eax, 16
|
||||
cmp eax, 4
|
||||
jne .exit_default
|
||||
|
||||
mov dword [level1.Grid + (15 * level1.Width + 13) * 4], level1.PassableArea
|
||||
mov [level1.Ogre.Visible], 0
|
||||
stdcall remove_object_from_inventory, 4
|
||||
mov eax, .message_ogre
|
||||
jmp .exit
|
||||
|
||||
.exit_default:
|
||||
xor eax, eax
|
||||
dec eax
|
||||
.exit:
|
||||
ret
|
||||
|
||||
.message_ogre langstr0 ru, < \
|
||||
'- <20>Š! <20>ŽĽâŞ ! <20> ă ˘Ľŕ¨áě!!! ' >
|
||||
endp
|
||||
|
||||
proc level1.portal action, cell_x, cell_y
|
||||
mov eax, [action]
|
||||
cmp ax, AKODE_ACTION.CELL_ENTER
|
||||
jne @f
|
||||
stdcall game_over
|
||||
@@:
|
||||
xor eax, eax
|
||||
ret
|
||||
endp
|
2
programs/games/Dungeons/Resources/Levels/levels.inc
Normal file
@ -0,0 +1,2 @@
|
||||
align 4
|
||||
include '1.inc'
|
After Width: | Height: | Size: 379 KiB |
After Width: | Height: | Size: 150 KiB |
After Width: | Height: | Size: 156 KiB |
After Width: | Height: | Size: 143 KiB |
After Width: | Height: | Size: 101 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 160 KiB |
BIN
programs/games/Dungeons/Resources/Textures/HUD/Death.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
programs/games/Dungeons/Resources/Textures/HUD/End.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
programs/games/Dungeons/Resources/Textures/HUD/LevelLoading.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
programs/games/Dungeons/Resources/Textures/HUD/Panel.png
Normal file
After Width: | Height: | Size: 112 KiB |
10
programs/games/Dungeons/Resources/Textures/Licenses.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Textures/HUD/* - Anton_K, CC BY-SA 4.0
|
||||
|
||||
Textures/Environment/*.png - CC0 1.0 (Public Domain)
|
||||
Textures/Environment/IronDoor.jpg - CC0 1.0 (Public Domain)
|
||||
Textures/Environment/*Stone*.jpg - p0ss, GNU GPL 2.0, http://opengameart.org/content/117-stone-wall-tilable-textures-in-8-themes
|
||||
Textures/Environment/Portal.jpg - Clint Bellanger, CC BY 3.0, http://opengameart.org/content/teleporter-circle
|
||||
|
||||
Textures/Objects/*.png - CC0 1.0 (Public Domain)
|
||||
Textures/Objects/Chest.png - Daniel Cook, modified by Anton_K, CC BY 3.0, http://opengameart.org/content/planetcute-chest-closedpng
|
||||
Textures/Objects/Portal.png - Clint Bellanger, modified by Robert C., modified by Anton_K, CC BY 3.0, http://opengameart.org/content/teleporter-circle
|
BIN
programs/games/Dungeons/Resources/Textures/Objects/Chest.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Coin.png
Normal file
After Width: | Height: | Size: 521 B |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Column1.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Column2.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Column3.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Column4.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Ogre.png
Normal file
After Width: | Height: | Size: 266 KiB |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Portal.png
Normal file
After Width: | Height: | Size: 265 KiB |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Sun1.png
Normal file
After Width: | Height: | Size: 700 B |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Sun2.png
Normal file
After Width: | Height: | Size: 796 B |
BIN
programs/games/Dungeons/Resources/Textures/Objects/Sun3.png
Normal file
After Width: | Height: | Size: 725 B |
69
programs/games/Dungeons/Resources/Textures/textures.inc
Normal file
@ -0,0 +1,69 @@
|
||||
;struct akode.TextureDesc
|
||||
; Type dd ? ; AKODE_TEXTURE_TYPE
|
||||
;
|
||||
; union
|
||||
; ImagePathPtr dd ?
|
||||
; Color dd ?
|
||||
; ends
|
||||
;
|
||||
; ImageDataPtr dd ?
|
||||
;
|
||||
; HasMagicPink db ? ; boolean
|
||||
; TileWalls db ? ; boolean
|
||||
; Usage db ? ; AKODE_TEXTURE_USAGE
|
||||
; VirtualScale db ? ; AKODE_VIRTUAL_SCALE_MODE, not supported yet
|
||||
; VirtualSize akode.Size ; (0, 0) for original size, not supported yet
|
||||
;ends
|
||||
|
||||
align 4
|
||||
textures:
|
||||
|
||||
.GreenStone1 akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.GreenStone1, 0, 0, 0, AKODE_TEXTURE_USAGE.ENVIRONMENT
|
||||
.GreenStone2 akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.GreenStone2, 0, 0, 0, AKODE_TEXTURE_USAGE.ENVIRONMENT
|
||||
|
||||
.YellowStone1 akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.YellowStone1, 0, 0, 0, AKODE_TEXTURE_USAGE.ENVIRONMENT
|
||||
|
||||
.CrazyWoodDoor akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.CrazyWoodDoor, 0, 1, 0, AKODE_TEXTURE_USAGE.ENVIRONMENT
|
||||
.IronDoor akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.IronDoor, 0, 0, 0, AKODE_TEXTURE_USAGE.ENVIRONMENT
|
||||
|
||||
.RedLeverUp akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.RedLeverUp, 0, 1, 0, AKODE_TEXTURE_USAGE.ENVIRONMENT
|
||||
.RedLeverDown akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.RedLeverDown, 0, 1, 0, AKODE_TEXTURE_USAGE.ENVIRONMENT
|
||||
|
||||
.PortalFloor akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.PortalFloor, 0, 0, 0, AKODE_TEXTURE_USAGE.ENVIRONMENT
|
||||
|
||||
.Chest akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.Chest, 0, 1, 0, AKODE_TEXTURE_USAGE.OBJECT
|
||||
|
||||
.Column1 akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.Column1, 0, 1, 0, AKODE_TEXTURE_USAGE.OBJECT
|
||||
.Column2 akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.Column2, 0, 1, 0, AKODE_TEXTURE_USAGE.OBJECT
|
||||
.Column3 akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.Column3, 0, 1, 0, AKODE_TEXTURE_USAGE.OBJECT
|
||||
.Column4 akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.Column4, 0, 1, 0, AKODE_TEXTURE_USAGE.OBJECT
|
||||
|
||||
.Ogre akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.Ogre, 0, 1, 0, AKODE_TEXTURE_USAGE.OBJECT
|
||||
|
||||
.Portal akode.TextureDesc AKODE_TEXTURE_TYPE.IMAGE, texture_files.Portal, 0, 1, 0, AKODE_TEXTURE_USAGE.OBJECT
|
||||
|
||||
texture_files:
|
||||
|
||||
.GreenStone1 db 'Resources/Textures/Environment/GreenStone1.jpg', 0
|
||||
.GreenStone2 db 'Resources/Textures/Environment/GreenStone2.jpg', 0
|
||||
|
||||
.YellowStone1 db 'Resources/Textures/Environment/YellowStone1.jpg', 0
|
||||
|
||||
.CrazyWoodDoor db 'Resources/Textures/Environment/CrazyWoodDoor.png', 0
|
||||
.IronDoor db 'Resources/Textures/Environment/IronDoor.jpg', 0
|
||||
|
||||
.RedLeverUp db 'Resources/Textures/Environment/RedLeverUp.png', 0
|
||||
.RedLeverDown db 'Resources/Textures/Environment/RedLeverDown.png', 0
|
||||
|
||||
.PortalFloor db 'Resources/Textures/Environment/Portal.jpg', 0
|
||||
|
||||
.Chest db 'Resources/Textures/Objects/Chest.png', 0
|
||||
|
||||
.Column1 db 'Resources/Textures/Objects/Column1.png', 0
|
||||
.Column2 db 'Resources/Textures/Objects/Column2.png', 0
|
||||
.Column3 db 'Resources/Textures/Objects/Column3.png', 0
|
||||
.Column4 db 'Resources/Textures/Objects/Column4.png', 0
|
||||
|
||||
.Ogre db 'Resources/Textures/Objects/Ogre.png', 0
|
||||
|
||||
.Portal db 'Resources/Textures/Objects/Portal.png', 0
|
91
programs/games/Dungeons/data.inc
Normal file
@ -0,0 +1,91 @@
|
||||
include 'lang.inc'
|
||||
|
||||
struc langstr [lng, data]
|
||||
{
|
||||
if lang eq lng
|
||||
sz ., data
|
||||
end if
|
||||
}
|
||||
|
||||
struc langstr0 [lng, data]
|
||||
{
|
||||
if lang eq lng
|
||||
sz0 ., data
|
||||
end if
|
||||
}
|
||||
|
||||
include 'AKODE/data.inc'
|
||||
include 'Resources/Textures/textures.inc'
|
||||
include 'Resources/Levels/levels.inc'
|
||||
|
||||
FULLSCREEN = 0
|
||||
FSAA = 0
|
||||
DISABLE_SHADING = 0
|
||||
|
||||
FIELD_OF_VIEW = 60
|
||||
BLOCK_BASE_SIZE = 512
|
||||
BLOCK_HEIGHT = 512
|
||||
|
||||
INVENTORY_SIZE = 10
|
||||
|
||||
HUD_PANEL_HEIGHT = 120
|
||||
|
||||
INVENTORY_X = 570
|
||||
INVENTORY_Y = 15
|
||||
INVENTORY_PADDING_X = 10
|
||||
INVENTORY_PADDING_Y = 10
|
||||
OBJECT_IMAGE_WIDTH = 40
|
||||
OBJECT_IMAGE_HEIGHT = 40
|
||||
|
||||
GAME_MESSAGE_X = 150 + 15
|
||||
GAME_MESSAGE_Y = 15 + 15
|
||||
GAME_MESSAGE_COLOR = 000000h
|
||||
|
||||
if FULLSCREEN
|
||||
;MAIN_WINDOW_X = 0
|
||||
;MAIN_WINDOW_Y = 0
|
||||
;MAIN_WINDOW_WIDTH = 0FFFFh
|
||||
;MAIN_WINDOW_HEIGHT = 0FFFFh
|
||||
MAIN_WINDOW_STYLE = (01000001b) shl 24
|
||||
MAIN_WINDOW_STYLE2 = 1 shl 24
|
||||
else
|
||||
MAIN_WINDOW_X = 150
|
||||
MAIN_WINDOW_Y = 150
|
||||
MAIN_WINDOW_WIDTH = 960
|
||||
MAIN_WINDOW_HEIGHT = 720
|
||||
MAIN_WINDOW_STYLE = (01110100b) shl 24
|
||||
MAIN_WINDOW_STYLE2 = 0
|
||||
end if
|
||||
|
||||
MAIN_EVENT_MASK = EVM_REDRAW or EVM_KEY or EVM_BUTTON or EVM_MOUSE or EVM_MOUSE_FILTER
|
||||
|
||||
MAIN_WINDOW_TITLE langstr0 \
|
||||
en, 'Dungeons of Augastes 0.1', \
|
||||
ru, '<27>®¤§¥¬¥«ìï €ã£ áâ¥á 0.1'
|
||||
|
||||
LevelLoadingImageFile db 'Resources/Textures/HUD/LevelLoading.png', 0
|
||||
HudPanelImageFile db 'Resources/Textures/HUD/Panel.png', 0
|
||||
DeathImageFile db 'Resources/Textures/HUD/Death.png', 0
|
||||
EndImageFile db 'Resources/Textures/HUD/End.png', 0
|
||||
|
||||
align 4
|
||||
LevelLoadingImagePtr dd 0
|
||||
HudPanelImagePtr dd 0
|
||||
DeathImagePtr dd 0
|
||||
EndImagePtr dd 0
|
||||
|
||||
ImageBufferPtr dd 0
|
||||
|
||||
HudPanelNeedsRedraw dd 0
|
||||
|
||||
GameMessage dd 0
|
||||
GameStatus dd 0
|
||||
|
||||
GAME_STATUS.LEVEL_LOAD_FAILED = 1
|
||||
GAME_STATUS.DEAD = 2
|
||||
GAME_STATUS.END = 3
|
||||
|
||||
ACTION.DO_SOMETHING = AKODE_ACTION.CUSTOM + 1
|
||||
ACTION.LOOK_AROUND = AKODE_ACTION.CUSTOM + 2
|
||||
ACTION.USE_OBJECT = AKODE_ACTION.CUSTOM + 3
|
||||
ACTION.LOOK_AT_OBJECT = AKODE_ACTION.CUSTOM + 4
|
0
programs/games/Dungeons/datadef.inc
Normal file
1
programs/games/Dungeons/import.inc
Normal file
@ -0,0 +1 @@
|
||||
include 'AKODE/import.inc'
|
1
programs/games/Dungeons/lang.inc
Normal file
@ -0,0 +1 @@
|
||||
lang fix ru
|
14
programs/games/Dungeons/udata.inc
Normal file
@ -0,0 +1,14 @@
|
||||
include 'AKODE/udata.inc'
|
||||
|
||||
align 4
|
||||
StartupPath rb 1024
|
||||
|
||||
ThreadInfoBuffer process_information
|
||||
|
||||
MainWindowWidth dd ?
|
||||
MainWindowHeight dd ?
|
||||
|
||||
WorldViewHeight dd ?
|
||||
|
||||
PressedKeys rd 128 * 2
|
||||
Inventory rq INVENTORY_SIZE
|