mirror of
https://github.com/nishiowo/nishbox
synced 2025-04-21 04:04:39 +00:00
add stuff
This commit is contained in:
parent
ee09444d05
commit
0b378fbcc6
22
engine/engine.rc
Normal file
22
engine/engine.rc
Normal file
@ -0,0 +1,22 @@
|
||||
#include <windows.h>
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,0,0,0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "GoldFish contributors\0"
|
||||
VALUE "FileDescription", "GoldFish Engine\0"
|
||||
VALUE "LegalCopyright", "Public domain, original by GoldFish contributors\0"
|
||||
VALUE "FileVersion", "0.0.0.0\0"
|
||||
VALUE "ProductName", "GoldFish Engine\0"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 65001
|
||||
END
|
||||
END
|
@ -28,6 +28,7 @@ void gf_engine_begin(void) {
|
||||
#endif
|
||||
gf_get_version(&ver);
|
||||
gf_function_log(NULL, "GoldFish Engine %s", ver.full);
|
||||
gf_function_log(NULL, "Build date: %s", ver.date);
|
||||
gf_function_log(NULL, "Lua %s", ver.lua);
|
||||
gf_function_log(NULL, "zlib %s", ver.zlib);
|
||||
gf_function_log(NULL, "Thread model: %s", ver.thread);
|
||||
|
@ -21,6 +21,8 @@ void gf_get_version(gf_version_t* version) {
|
||||
int incr = 0;
|
||||
int old = 0;
|
||||
|
||||
strcpy(version->date, __DATE__);
|
||||
|
||||
strcpy(version->full, GF_VERSION);
|
||||
strcpy(version->zlib, ZLIB_VERSION);
|
||||
|
||||
|
@ -15,6 +15,7 @@ GF_DECLARE_TYPE(version, {
|
||||
int major;
|
||||
int minor;
|
||||
int patch;
|
||||
char date[64];
|
||||
char full[64];
|
||||
char backend[32];
|
||||
char driver[32];
|
||||
|
@ -248,6 +248,14 @@ project("GoldFish")
|
||||
"external/lua/l*.h",
|
||||
"external/lua/l*.c",
|
||||
})
|
||||
filter({
|
||||
"system:windows",
|
||||
"options:engine=dynamic"
|
||||
})
|
||||
files({
|
||||
"engine.rc"
|
||||
})
|
||||
filter({})
|
||||
removefiles({
|
||||
"external/lua/ltests.c",
|
||||
"external/lua/ltests.h"
|
||||
|
@ -94,6 +94,9 @@ project("EngineInfo")
|
||||
-- Call this if you are gonna use my engine...
|
||||
gf_link_stuffs("options:engine=static")
|
||||
filter("system:windows")
|
||||
defines({
|
||||
"FD_ENGINEINFO"
|
||||
})
|
||||
files({
|
||||
"src/*.rc"
|
||||
})
|
||||
@ -127,6 +130,9 @@ project("NishBoxServer")
|
||||
-- Call this if you are gonna use my engine...
|
||||
gf_link_stuffs("options:engine=static")
|
||||
filter("system:windows")
|
||||
defines({
|
||||
"FD_SERVER"
|
||||
})
|
||||
files({
|
||||
"src/*.rc"
|
||||
})
|
||||
@ -160,6 +166,9 @@ project("NishBox")
|
||||
-- Call this if you are gonna use my engine...
|
||||
gf_link_stuffs("options:engine=static")
|
||||
filter("system:windows")
|
||||
defines({
|
||||
"FD_NISHBOX"
|
||||
})
|
||||
files({
|
||||
"src/*.rc"
|
||||
})
|
||||
|
@ -7,7 +7,10 @@
|
||||
/* Standard */
|
||||
#include <stdio.h>
|
||||
|
||||
#define GUI_BUTTON_OK 1000
|
||||
|
||||
HINSTANCE hInst;
|
||||
HWND button_ok;
|
||||
HFONT monospace;
|
||||
gf_version_t ver;
|
||||
char vertxt[512];
|
||||
@ -30,6 +33,14 @@ void ShowBitmapSize(HWND hWnd, HDC hdc, const char* name, int x, int y, int w, i
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
|
||||
switch(msg) {
|
||||
case WM_COMMAND: {
|
||||
int trig = LOWORD(wp);
|
||||
int ev = HIWORD(wp);
|
||||
if(trig == GUI_BUTTON_OK && ev == BN_CLICKED) {
|
||||
SendMessage(hWnd, WM_CLOSE, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_CLOSE: {
|
||||
DestroyWindow(hWnd);
|
||||
break;
|
||||
@ -39,7 +50,20 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
|
||||
break;
|
||||
}
|
||||
case WM_CREATE: {
|
||||
RECT rc;
|
||||
int sz;
|
||||
int width;
|
||||
int height;
|
||||
int padding;
|
||||
|
||||
GetClientRect(hWnd, &rc);
|
||||
width = rc.right - rc.left;
|
||||
height = rc.bottom - rc.top;
|
||||
sz = height * 4 / 5;
|
||||
padding = height / 2 - sz / 2;
|
||||
|
||||
monospace = (HFONT)GetStockObject(SYSTEM_FIXED_FONT);
|
||||
button_ok = CreateWindow("BUTTON", "&OK", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, width - padding - 40, height - padding - 20, 40, 20, hWnd, (HMENU)GUI_BUTTON_OK, hInst, NULL);
|
||||
break;
|
||||
}
|
||||
case WM_PAINT: {
|
||||
@ -121,8 +145,9 @@ int WINAPI WinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst, LPSTR lpsCmdLine, in
|
||||
gf_get_version(&ver);
|
||||
vertxt[0] = 0;
|
||||
sprintf(vertxt + strlen(vertxt), "GoldFish Engine %s\n", ver.full);
|
||||
sprintf(vertxt + strlen(vertxt), "Thread Model: %s\n", ver.thread);
|
||||
sprintf(vertxt + strlen(vertxt), "Renderer : %s on %s\n", ver.driver, ver.backend);
|
||||
sprintf(vertxt + strlen(vertxt), "Build Date : %s\n", ver.date);
|
||||
sprintf(vertxt + strlen(vertxt), "Thread Model : %s\n", ver.thread);
|
||||
sprintf(vertxt + strlen(vertxt), "Renderer : %s on %s\n", ver.driver, ver.backend);
|
||||
|
||||
if(!InitApp()) {
|
||||
return FALSE;
|
||||
|
@ -1,4 +1,35 @@
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef FD_NISHBOX
|
||||
#define FILE_DESCRIPTION "NishBox\0"
|
||||
#endif
|
||||
#ifdef FD_SERVER
|
||||
#define FILE_DESCRIPTION "NishBox Dedicated Server\0"
|
||||
#endif
|
||||
#ifdef FD_ENGINEINFO
|
||||
#define FILE_DESCRIPTION "GoldFish Engine Info\0"
|
||||
#endif
|
||||
|
||||
GAME ICON "./internal/icon.ico"
|
||||
GOLDFISH_BMP BITMAP "./internal/goldfish.bmp"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,0,0,0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "NishBox contributors\0"
|
||||
VALUE "FileDescription", FILE_DESCRIPTION
|
||||
VALUE "LegalCopyright", "Public domain, original by NishBox contributors\0"
|
||||
VALUE "FileVersion", "0.0.0.0\0"
|
||||
VALUE "ProductName", "NishBox Component\0"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 65001
|
||||
END
|
||||
END
|
||||
|
Loading…
x
Reference in New Issue
Block a user