Subversion Repositories Kolibri OS

Rev

Rev 1769 | Rev 8133 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1769 Rev 8129
Line 1... Line 1...
1
#include 
1
#include 
2
#include 
2
#include 
3
#include 
3
#include 
4
#include "lifegen.h"
4
#include "lifegen.h"
5
#include "life_bmp.h"
5
#include "life_bmp.h"
6
#include "me_cdlg.h"
6
#include "kos_cdlg.h"
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
using namespace Menuet;
8
using namespace Kolibri;
9
 
9
 
10
/***
10
/***
11
#define StrLen   LibbStrLen
11
#define StrLen   LibbStrLen
Line 18... Line 18...
18
char *(*StrCopy)(char *dest, const char *src) = 0;
18
char *(*StrCopy)(char *dest, const char *src) = 0;
19
void *(*MemCopy)(void *dest, const void *src, unsigned int n) = 0;
19
void *(*MemCopy)(void *dest, const void *src, unsigned int n) = 0;
20
void *(*MemSet)(void *s, char c, unsigned int n) = 0;
20
void *(*MemSet)(void *s, char c, unsigned int n) = 0;
21
double (*Floor)(double x) = 0;
21
double (*Floor)(double x) = 0;
Line 22... Line -...
22
 
-
 
23
#include 
22
 
24
void LibbInit()
23
void LibbInit()
25
{
24
{
26
	HINSTANCE hLib = LoadLibrary("Libb.dll");
25
	HINSTANCE hLib = LoadLibrary("Libb.dll");
27
	if (!hLib)
26
	if (!hLib)
28
	{
27
	{
29
		DebugPutString("Can't load the library.\n");
28
		DebugPutString("Can't load the library.\n");
30
		Menuet::Abort();
29
		Kolibri::Abort();
31
	}
30
	}
32
	StrLen = (unsigned int(*)(const char *str))GetProcAddress(hLib, "StrLen");
31
	StrLen = (unsigned int(*)(const char *str))GetProcAddress(hLib, "StrLen");
33
	StrCopy = (char *(*)(char *dest, const char *src))GetProcAddress(hLib, "StrCopy");
32
	StrCopy = (char *(*)(char *dest, const char *src))GetProcAddress(hLib, "StrCopy");
34
	MemCopy = (void *(*)(void *dest, const void *src, unsigned int n))GetProcAddress(hLib, "MemCopy");
33
	MemCopy = (void *(*)(void *dest, const void *src, unsigned int n))GetProcAddress(hLib, "MemCopy");
Line 1787... Line 1786...
1787
		Paint((res < 0 || res > WAIT_TIME) ? (PaintWNull | PaintWNow) : PaintWNull, th);
1786
		Paint((res < 0 || res > WAIT_TIME) ? (PaintWNull | PaintWNow) : PaintWNull, th);
1788
	}
1787
	}
1789
	return res;
1788
	return res;
1790
}
1789
}
Line 1791... Line 1790...
1791
 
1790
 
1792
void MenuetOnSize(int window_rect[], Menuet::TThreadData th)
1791
void MenuetOnSize(int window_rect[], Kolibri::TThreadData th)
1793
{
1792
{
1794
	unsigned short w, h;
1793
	unsigned short w, h;
1795
	GetClientSize(w, h, window_rect[2], window_rect[3], th);
1794
	GetClientSize(w, h, window_rect[2], window_rect[3], th);
1796
	SetPictureSize(w, h);
1795
	SetPictureSize(w, h);
Line 1962... Line 1961...
1962
{
1961
{
1963
	HINSTANCE hLib = LoadLibrary("LifeGen.dll");
1962
	HINSTANCE hLib = LoadLibrary("LifeGen.dll");
1964
	if (!hLib)
1963
	if (!hLib)
1965
	{
1964
	{
1966
		DebugPutString("Can't load the library.\n");
1965
		DebugPutString("Can't load the library.\n");
1967
		Menuet::Abort();
1966
		Kolibri::Abort();
1968
	}
1967
	}
1969
	DllOneGeneration = (void(__stdcall*)(int, int, void*, const void*, int))GetProcAddress(hLib, "OneGeneration");
1968
	DllOneGeneration = (void(__stdcall*)(int, int, void*, const void*, int))GetProcAddress(hLib, "OneGeneration");
1970
	if (!DllOneGeneration)
1969
	if (!DllOneGeneration)
1971
	{
1970
	{
1972
		DebugPutString("Can't get a library function.\n");
1971
		DebugPutString("Can't get a library function.\n");
1973
		Menuet::Abort();
1972
		Kolibri::Abort();
1974
	}
1973
	}
1975
}
1974
}
Line 1976... Line 1975...
1976
 
1975
 
1977
void __stdcall OneGeneration(int w, int h, void *dest, const void *src, int flag)
1976
void __stdcall OneGeneration(int w, int h, void *dest, const void *src, int flag)