mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Made notevil screen size aware.
svn path=/trunk/; revision=679
This commit is contained in:
parent
1d786dd865
commit
c33edc6cb7
3 changed files with 73 additions and 30 deletions
|
@ -1,4 +1,4 @@
|
||||||
# $Id: makefile,v 1.1 1999/05/15 07:23:34 ea Exp $
|
# $Id: makefile,v 1.2 1999/10/03 22:10:15 ekohl Exp $
|
||||||
#
|
#
|
||||||
# ReactOS makefile for notevil
|
# ReactOS makefile for notevil
|
||||||
# Compiler: egcs 1.1.2
|
# Compiler: egcs 1.1.2
|
||||||
|
@ -29,6 +29,26 @@ $(TARGET).exe: $(OBJECTS)
|
||||||
$(TARGET).coff: $(TARGET).rc
|
$(TARGET).coff: $(TARGET).rc
|
||||||
$(RC) $(RFLAGS) $(TARGET).rc $(TARGET).coff
|
$(RC) $(RFLAGS) $(TARGET).rc $(TARGET).coff
|
||||||
|
|
||||||
|
|
||||||
|
floppy: $(TARGET:%=$(FLOPPY_DIR)/apps/%)
|
||||||
|
|
||||||
|
$(TARGET:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
|
||||||
|
ifeq ($(DOSCLI),yes)
|
||||||
|
$(CP) $* $(FLOPPY_DIR)\apps\$*
|
||||||
|
else
|
||||||
|
$(CP) $* $(FLOPPY_DIR)/apps/$*
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
dist: $(TARGET:%=../$(DIST_DIR)/apps/%)
|
||||||
|
|
||||||
|
$(TARGET:%=../$(DIST_DIR)/apps/%): ../$(DIST_DIR)/apps/%: %
|
||||||
|
ifeq ($(DOSCLI),yes)
|
||||||
|
$(CP) $* ..\$(DIST_DIR)\apps\$*
|
||||||
|
else
|
||||||
|
$(CP) $* ../$(DIST_DIR)/apps/$*
|
||||||
|
endif
|
||||||
|
|
||||||
include ../rules.mak
|
include ../rules.mak
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: notevil.c,v 1.1 1999/05/15 07:23:34 ea Exp $
|
/* $Id: notevil.c,v 1.2 1999/10/03 22:10:15 ekohl Exp $
|
||||||
*
|
*
|
||||||
* notevil.c
|
* notevil.c
|
||||||
*
|
*
|
||||||
|
@ -36,6 +36,7 @@ LPCTSTR app_name = _TEXT("notevil");
|
||||||
|
|
||||||
HANDLE myself;
|
HANDLE myself;
|
||||||
HANDLE ScreenBuffer;
|
HANDLE ScreenBuffer;
|
||||||
|
CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo;
|
||||||
|
|
||||||
void
|
void
|
||||||
WriteStringAt(
|
WriteStringAt(
|
||||||
|
@ -47,7 +48,8 @@ WriteStringAt(
|
||||||
DWORD cWritten = 0;
|
DWORD cWritten = 0;
|
||||||
WORD wLen = lstrlen(lpString);
|
WORD wLen = lstrlen(lpString);
|
||||||
|
|
||||||
if (0 == wLen) return;
|
if (0 == wLen)
|
||||||
|
return;
|
||||||
WriteConsoleOutputCharacter(
|
WriteConsoleOutputCharacter(
|
||||||
ScreenBuffer,
|
ScreenBuffer,
|
||||||
lpString,
|
lpString,
|
||||||
|
@ -74,7 +76,7 @@ WriteCoord(COORD c)
|
||||||
|
|
||||||
wsprintf(
|
wsprintf(
|
||||||
buf,
|
buf,
|
||||||
_TEXT("x=%d y=%d"),
|
_TEXT("x=%02d y=%02d"),
|
||||||
c.X,
|
c.X,
|
||||||
c.Y
|
c.Y
|
||||||
);
|
);
|
||||||
|
@ -115,17 +117,20 @@ GetNextString(
|
||||||
VOID
|
VOID
|
||||||
DisplayTitle(VOID)
|
DisplayTitle(VOID)
|
||||||
{
|
{
|
||||||
COORD xy = {24,12};
|
LPTSTR szTitle = _TEXT("ReactOS Coders Console Parade");
|
||||||
|
COORD xy;
|
||||||
|
|
||||||
|
xy.X = (ScreenBufferInfo.dwSize.X - lstrlen(szTitle)) / 2;
|
||||||
|
xy.Y = ScreenBufferInfo.dwSize.Y / 2;
|
||||||
|
|
||||||
WriteStringAt(
|
WriteStringAt(
|
||||||
_TEXT("ReactOS Coders Console Parade"),
|
szTitle,
|
||||||
xy,
|
xy,
|
||||||
(FOREGROUND_GREEN | FOREGROUND_INTENSITY)
|
(FOREGROUND_GREEN | FOREGROUND_INTENSITY)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define RES_DELAY_CHANGE 12
|
#define RES_DELAY_CHANGE 12
|
||||||
#define RES_BUFFER_SIZE 1024
|
#define RES_BUFFER_SIZE 1024
|
||||||
void
|
void
|
||||||
|
@ -134,11 +139,14 @@ MainLoop(void)
|
||||||
TCHAR NameString [RES_BUFFER_SIZE];
|
TCHAR NameString [RES_BUFFER_SIZE];
|
||||||
DWORD NameIndex = 1;
|
DWORD NameIndex = 1;
|
||||||
INT NameLength = 0;
|
INT NameLength = 0;
|
||||||
COORD xy = {40,12};
|
COORD xy;
|
||||||
INT n = RES_DELAY_CHANGE;
|
INT n = RES_DELAY_CHANGE;
|
||||||
INT dir_y = 1;
|
INT dir_y = 1;
|
||||||
INT dir_x = 1;
|
INT dir_x = 1;
|
||||||
WORD wColor = 0;
|
WORD wColor = 1;
|
||||||
|
|
||||||
|
xy.X = ScreenBufferInfo.dwSize.X / 2;
|
||||||
|
xy.Y = ScreenBufferInfo.dwSize.Y / 2;
|
||||||
|
|
||||||
for ( ; 1; ++n )
|
for ( ; 1; ++n )
|
||||||
{
|
{
|
||||||
|
@ -150,25 +158,31 @@ MainLoop(void)
|
||||||
& NameIndex
|
& NameIndex
|
||||||
);
|
);
|
||||||
NameLength = lstrlen(NameString);
|
NameLength = lstrlen(NameString);
|
||||||
++wColor;
|
wColor++;
|
||||||
|
if ((wColor & 0x000F) == 0)
|
||||||
|
wColor = 1;
|
||||||
}
|
}
|
||||||
if (!xy.X)
|
if (xy.X == 0)
|
||||||
{
|
{
|
||||||
if (dir_x == -1) dir_x = 1;
|
if (dir_x == -1)
|
||||||
|
dir_x = 1;
|
||||||
}
|
}
|
||||||
else if (xy.X > 80 - NameLength)
|
else if (xy.X >= ScreenBufferInfo.dwSize.X - NameLength - 1)
|
||||||
{
|
{
|
||||||
if (dir_x == 1) dir_x = -1;
|
if (dir_x == 1)
|
||||||
|
dir_x = -1;
|
||||||
}
|
}
|
||||||
xy.X += dir_x;
|
xy.X += dir_x;
|
||||||
switch (xy.Y)
|
|
||||||
|
if (xy.Y == 0)
|
||||||
{
|
{
|
||||||
case 0:
|
if (dir_y == -1)
|
||||||
if (dir_y == -1) dir_y = 1;
|
dir_y = 1;
|
||||||
break;
|
}
|
||||||
case 24:
|
else if (xy.Y >= ScreenBufferInfo.dwSize.Y - 1)
|
||||||
if (dir_y == 1) dir_y = -1;
|
{
|
||||||
break;
|
if (dir_y == 1)
|
||||||
|
dir_y = -1;
|
||||||
}
|
}
|
||||||
xy.Y += dir_y;
|
xy.Y += dir_y;
|
||||||
#ifdef DISPLAY_COORD
|
#ifdef DISPLAY_COORD
|
||||||
|
@ -178,7 +192,7 @@ MainLoop(void)
|
||||||
WriteStringAt(
|
WriteStringAt(
|
||||||
NameString,
|
NameString,
|
||||||
xy,
|
xy,
|
||||||
(wColor & 0x000F)
|
wColor
|
||||||
);
|
);
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
WriteStringAt(
|
WriteStringAt(
|
||||||
|
@ -198,6 +212,14 @@ main(
|
||||||
{
|
{
|
||||||
myself = GetModuleHandle(NULL);
|
myself = GetModuleHandle(NULL);
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
GetConsoleScreenBufferInfo (GetStdHandle(STD_OUTPUT_HANDLE),
|
||||||
|
&ScreenBufferInfo);
|
||||||
|
#else
|
||||||
|
ScreenBufferInfo.dwSize.X = 80;
|
||||||
|
ScreenBufferInfo.dwSize.Y = 25;
|
||||||
|
#endif
|
||||||
|
|
||||||
ScreenBuffer = CreateConsoleScreenBuffer(
|
ScreenBuffer = CreateConsoleScreenBuffer(
|
||||||
GENERIC_WRITE,
|
GENERIC_WRITE,
|
||||||
0,
|
0,
|
||||||
|
@ -214,6 +236,7 @@ main(
|
||||||
);
|
);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetConsoleActiveScreenBuffer(ScreenBuffer);
|
SetConsoleActiveScreenBuffer(ScreenBuffer);
|
||||||
MainLoop();
|
MainLoop();
|
||||||
CloseHandle(ScreenBuffer);
|
CloseHandle(ScreenBuffer);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: notevil.rc,v 1.1 1999/05/15 07:23:34 ea Exp $ */
|
/* $Id: notevil.rc,v 1.2 1999/10/03 22:10:15 ekohl Exp $ */
|
||||||
#include "../../reactos/include/defines.h"
|
#include "../../reactos/include/defines.h"
|
||||||
#include "../../reactos/include/reactos/resource.h"
|
#include "../../reactos/include/reactos/resource.h"
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
/* Version information. */
|
/* Version information. */
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 0,0,13,RES_UINT_FILE_VERSION
|
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
|
||||||
PRODUCTVERSION 0,0,13,0
|
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
|
Loading…
Reference in a new issue