V-Graphics.asm
资源名称:VeMU.rar [点击查看]
上传用户:santakups8
上传日期:2021-03-23
资源大小:544k
文件大小:5k
源码类别:
模拟服务器
开发平台:
Asm
- ;EasyCodeName=Module1,1
- ;-----------------------------------------------------------------------------------
- ; VeMU
- ; Its a package that allows the user to set his own server of the game
- ; "MuOnline", this is not an emulator since i am not "emulating"
- ; what the actual games does, i am "creating" a method for set a Server
- ; of this Game.
- ;
- ; Copyright (C) 2010 Felipe Ya馿z
- ;
- ; 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 3 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/.
- ;-----------------------------------------------------------------------------------
- ;-----------------------------------------------------------------------------------
- ; -----------------
- ; Coded /
- ; By /
- ; -={FeN$x)=-
- ; / Felipe Y.
- ; /
- ; -----------------
- ; Programming Lang: ASM
- ; Country: Chile
- ; My respect for all those who lost their lifes
- ; In the earthquake of my country...
- ; Let god take their spirits home...
- ;-----------------------------------------------------------------------------------
- V_Print_TimerRecv Proto :Dword, :Dword, :Dword, :Dword
- VPRINTs Struct
- vString DB MAXPRINTCHAR Dup(?)
- vStringLength DWord ?
- vRGB DWord ?
- VPRINTs EndS
- .Const
- ;LEFTSQUARECORD equ 4A0h
- TOPSQUARECORD equ 80h
- RIGHTSQUARECORD equ 1
- BOTTOMSQUARECORD equ 0
- .Data?
- .Data
- TestString DB "TotalPlayers:[%d] TotalMobs:[%d] MaxUsers:[%d] ShopsLoaded:[%d] ", 0
- ProjectName DB "VeMU ", 0
- VersionString DB 50 Dup(0)
- ValkBarInfo DB 100 Dup(0)
- .Code
- ;///////////////////////////////////////////////////////////////////////////////////////////////
- ;This procedure display the rectangle in top with the text
- ;IT ISNT ENDED YET, ITS BETA MODE !
- ;///////////////////////////////////////////////////////////////////////////////////////////////
- V_DisplayRect Proc
- Local pPaint:PAINTSTRUCT
- Local hdc:HDC
- Local rect:RECT
- Local BarLength:Dword
- local VersionLength:Dword
- local YPos:Dword
- local Font1:Dword
- local Font2:Dword
- invoke GetDC, GShWnd
- mov hdc, eax
- invoke GetSystemMetrics, SM_CXSCREEN
- mov YPos, eax
- shr eax, 1
- mov rect.left, eax
- mov rect.top, TOPSQUARECORD
- mov rect.right, RIGHTSQUARECORD
- mov rect.bottom, BOTTOMSQUARECORD
- invoke MemCopy, addr ProjectName, addr VersionString, SizeOf ProjectName
- invoke lstrcat, addr VersionString, addr ServerVersion
- invoke StrLen, addr VersionString
- mov VersionLength, eax
- invoke wsprintf, addr ValkBarInfo, addr TestString, 0, MonsterSetBaseCounter, MAXSERVERUSER, TotalShopsLoaded
- invoke StrLen, addr ValkBarInfo
- mov BarLength, eax
- invoke SetBkMode, hdc, TRANSPARENT
- RGB 99, 184, 255
- invoke CreateSolidBrush, eax
- invoke FillRect, hdc, addr rect, eax
- invoke CreateFont, 60, 30, 0, 0, 100, 0, 1, 0, OEM_CHARSET,
- OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
- DEFAULT_QUALITY, DEFAULT_PITCH or FF_MODERN,
- $CTA0 ("Impact")
- mov Font1, eax
- invoke CreateFont, 20, 0, 0, 0, 900, 0, 0, 0, OEM_CHARSET,
- OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
- DEFAULT_QUALITY, DEFAULT_PITCH or FF_MODERN,
- $CTA0 ("Arial")
- mov Font2, eax
- invoke SelectObject, hdc, Font1
- RGB 154, 255, 154
- invoke SetTextColor, hdc, eax
- mov eax, YPos
- shr eax, 3 ;/2
- invoke TextOut, hdc, eax, 20, addr VersionString, VersionLength
- invoke DeleteObject, Font1
- invoke SelectObject, hdc, Font2
- RGB 0, 0, 0
- invoke SetTextColor, hdc, eax
- invoke TextOut, hdc, 0, 0, addr ValkBarInfo, BarLength
- invoke DeleteObject, Font2
- invoke ReleaseDC, GShWnd, Addr pPaint
- Ret
- V_DisplayRect EndP
- V_Print_Run Proc
- Local LinesCounter:DWord
- Local pPaint:PAINTSTRUCT
- Local hdc:HDC
- Local rect:RECT
- Mov LinesCounter, 0
- invoke BeginPaint, GShWnd, addr pPaint
- invoke GetDC, GShWnd
- Mov hdc, Eax
- Assume Eax:Ptr VPRINTs
- .Repeat
- pObj LinesCounter, SizeOf VPRINTs, pObjectPaint
- Mov Edx, [Eax].vRGB ;RGB value collor
- .If (Edx != 0)
- Push Eax
- Invoke SetTextColor, hdc, Edx ;set collor
- Pop Eax
- .EndIf
- Mov Edx, LinesCounter
- IMul Edx, Edx, 11H
- Add Edx, 90H
- .if ([eax].vString != NULL) ;If we dont found a 00 at start it means we have no problem when printing
- Invoke TextOut, hdc, 0, Edx, Addr [Eax].vString, [Eax].vStringLength ;print it
- .else
- .endif
- Add LinesCounter, 1
- .Until (LinesCounter == MAXPRINTLINES)
- invoke ReleaseDC, GShWnd, addr pPaint
- invoke EndPaint, GShWnd, Addr pPaint
- Mov VPrintNewLine, 0 ;lets wait till we print a new message
- Ret
- V_Print_Run EndP