Changeset 323
- Timestamp:
- May 17, 2009, 2:19:35 PM (16 years ago)
- Location:
- Daodan
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/build.bat
r297 r323 1 gcc -O3 -s -Wall -shared -fomit-frame-pointer -o build\binkw32.dll src\Oni_Symbols.S src\Daodan.c src\Daodan_DLLStubs.c src\Daodan_Patch.c src\Daodan_Utility.c src\ daodan_gl.c1 gcc -O3 -s -Wall -shared -fomit-frame-pointer -o build\binkw32.dll src\Oni_Symbols.S src\Daodan.c src\Daodan_DLLStubs.c src\Daodan_Patch.c src\Daodan_Utility.c src\Daodan_Win32.c src\daodan_gl.c -lgdi32 -
Daodan/src/Daodan.c
r322 r323 2 2 #include "Daodan_Patch.h" 3 3 #include "Daodan_Utility.h" 4 #include "Daodan_Win32.h" 4 5 5 6 #include "Oni.h" … … 82 83 DDrPatch_MakeJump(UUrMachineTime_Sixtieths, DDrMachineTime_Sixtieths); 83 84 85 // Windowed mode 86 DDrPatch_MakeJump(ONrPlatform_Initialize, DDrPlatform_Initialize); 87 84 88 ONiMain(argc, argv); 85 89 } -
Daodan/src/Daodan_Win32.c
r322 r323 1 #include <windows.h> 2 3 #include "Daodan.h" 4 #include "Daodan_Win32.h" 5 6 #include "Oni.h" 7 8 short ONICALL DDrPlatform_Initialize(ONtPlatformData *PlatformData) 9 { 10 WNDCLASSEX WndClass; 11 RECT Rect; 12 const int Width = 640, Height = 480; 13 14 PlatformData->Instance = g_Instance; 15 16 WndClass.cbSize = sizeof(WndClass); 17 WndClass.style = WS_OVERLAPPED | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | CS_VREDRAW | CS_HREDRAW | CS_OWNDC; 18 WndClass.cbClsExtra = 0; 19 WndClass.cbWndExtra = 0; 20 WndClass.hInstance = PlatformData->Instance; 21 WndClass.hCursor = LoadCursor(NULL, IDC_ARROW); 22 WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); 23 WndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); 24 WndClass.hbrBackground = GetStockObject(BLACK_BRUSH); 25 WndClass.lpszMenuName = NULL; 26 WndClass.lpszClassName = "ONI "; 27 WndClass.lpfnWndProc = ONrPlatform_WindowProc; 28 29 RegisterClassEx(&WndClass); 30 31 Rect.left = (GetSystemMetrics(SM_CXSCREEN) / 2) - (Width / 2); 32 Rect.top = (GetSystemMetrics(SM_CYSCREEN) / 2) - (Height / 2); 33 Rect.right = Rect.left + Width; 34 Rect.bottom = Rect.top + Height; 35 AdjustWindowRect(&Rect, WndClass.style, FALSE); 36 37 PlatformData->Window = CreateWindowEx(0, "ONI ", "ONI ", WS_POPUP, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, NULL, NULL, PlatformData->Instance, NULL); 38 ShowWindow(PlatformData->Window, SW_SHOWNORMAL); 39 UpdateWindow(PlatformData->Window); 40 41 ShowCursor(FALSE); 42 43 return 0; 44 } -
Daodan/src/Daodan_Win32.h
r322 r323 1 #pragma once 2 #ifndef DAODAN_WIN32_H 3 #define DAODAN_WIN32_H 4 5 #include "Daodan.h" 6 #include "Oni.h" 7 8 short ONICALL DDrPlatform_Initialize(ONtPlatformData *PlatformData); 9 10 #endif -
Daodan/src/Oni.h
r322 r323 11 11 void __cdecl ONiMain(int ArgCount, char *ArgList[]); 12 12 short ONICALL ONrPlatform_Initialize(ONtPlatformData *PlatformData); 13 LRESULT CALLBACK ONrPlatform_WindowProc(HWND Window, UINT Message, WPARAM WParam, LPARAM LParam); 14 15 extern HINSTANCE g_Instance; 13 16 14 17 #endif -
Daodan/src/Oni_Symbols.S
r322 r323 12 12 // Oni Engine 13 13 symbol ( _ONiMain , 0x000d3280 ) 14 symbol ( @ONrPlatform_Initialize@4 , 0x0010f670 ) 15 symbol ( _ONrPlatform_WindowProc@16 , 0x0010f7a0 ) 16 17 symbol ( _g_Instance , 0x0021f9e4 ) 14 18 15 19 // BFW_Utility
Note:
See TracChangeset
for help on using the changeset viewer.