- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
118 lines
2.9 KiB
C++
118 lines
2.9 KiB
C++
//----------------------------------------------------------------------------
|
|
// ObjectWindows - (C) Copyright 1991, 1993 by Borland International
|
|
//----------------------------------------------------------------------------
|
|
#include <owl\owlpch.h>
|
|
#include <owl\buttonga.h>
|
|
#include <stdlib.h>
|
|
#include "appmgr.h"
|
|
|
|
//
|
|
// Constructor. Create an app rec from a string. The string consists of
|
|
// fields separated by ';'. Here is the format:
|
|
// <program path>;<program args>;<icon path>;<prompt for input>;<startup opts>
|
|
// If the format is not correct an error state is set.
|
|
//
|
|
TAppRec::TAppRec(const string& rec)
|
|
{
|
|
// holds each field of the record.
|
|
//
|
|
char* pp;
|
|
char* pa;
|
|
char* ip;
|
|
char* pfi;
|
|
char* ss;
|
|
char* temp = new char[rec.length()+1];
|
|
string nullStr;
|
|
|
|
Error = 0;
|
|
strcpy(temp, rec.c_str());
|
|
if ((pp = strtok(temp, ";")) != 0 &&
|
|
(pa = strtok(0, ";")) != 0 &&
|
|
(ip = strtok(0, ";")) != 0 &&
|
|
(pfi= strtok(0, ";")) != 0 &&
|
|
(ss = strtok(0, ";")) != 0 ) {
|
|
ProgramPath = pp;
|
|
ProgramArgs = pa;
|
|
IconPath = ip;
|
|
PromptForInput = atoi(pfi);
|
|
StartupStyle = atoi(ss);
|
|
Error = (StartupStyle != 1 && StartupStyle != 2 && StartupStyle != 3);
|
|
} else
|
|
Error = 1;
|
|
|
|
delete temp;
|
|
}
|
|
|
|
//
|
|
// ReturnAsString(). Contatenate a TAppRec's values into a string and return
|
|
// it. Any empty (or null) fields are converted to 1 space strings for
|
|
// easier manipulation later.
|
|
//
|
|
string
|
|
TAppRec::AsString()
|
|
{
|
|
char num[5];
|
|
string empty(" ");
|
|
string str;
|
|
|
|
str = ProgramPath + ";";
|
|
str += ProgramArgs.is_null() ? empty : ProgramArgs;
|
|
str += ";";
|
|
str += IconPath.is_null() ? empty : IconPath;
|
|
str += ";";
|
|
itoa(PromptForInput, num, 10);
|
|
str += num;
|
|
str += ";";
|
|
itoa(StartupStyle, num, 10);
|
|
str += num;
|
|
|
|
return str;
|
|
}
|
|
|
|
//
|
|
// GetIconPath(). Return the path to the icon for current app through
|
|
// 'iconPath'. If the 'IconPath' member is not empty use it, else use
|
|
// program path.
|
|
//
|
|
string
|
|
TAppRec::GetIconPath()
|
|
{
|
|
string iconPath = ProgramPath;
|
|
if (!IconPath.is_null() && IconPath[0] != ' ')
|
|
iconPath = IconPath;
|
|
return iconPath;
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
// Assignment operator. Copy recs to recieving object.
|
|
//
|
|
TAppMgr&
|
|
TAppMgr::operator =(const TAppMgr& am)
|
|
{
|
|
unsigned end = am.Limit();
|
|
|
|
for (unsigned i = 0; i < end; i++) {
|
|
if (am[i] != 0)
|
|
Add(new TAppRec(*am[i]));
|
|
}
|
|
return *this;
|
|
}
|
|
|
|
//
|
|
// AddFromString(). Parses given string into a TAppRec and stores it.
|
|
// Assumes the string contains the correct info. Does check for correct
|
|
// number of items.
|
|
//
|
|
int
|
|
TAppMgr::AddFromString(const string& rec, unsigned loc)
|
|
{
|
|
TAppRec* appRec = new TAppRec(rec);
|
|
|
|
if (!appRec->IsBad())
|
|
return AddAt(appRec, loc);
|
|
return 0;
|
|
}
|
|
|