Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #1  
Old 08-12-2024, 02:51
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 673
Thanks: 479
Thanked 2,421 Times in 547 Posts
BLACKFIRE69 is on a distinguished road
Arrow Layered.dll - Re-Written in Pure Zig

A few days ago, I met some of my classmates, and I learned that several of them had started game development projects using Zig . After talking to them, I felt motivated and, on my way home, decided to start my own project in Zig. However, my mind was blank, and I realized I had forgotten much of the language since I hadn't worked with Zig for months.

To refresh my skills, I began converting some of old C++ projects into Zig. One of these was the Layered project, originally developed by David D. Rocco.


Why Zig?
Quote:
Zig is a modern, straightforward language that's easy to learn and enforces strict type matching for safer, more predictable code.
Designed as a powerful alternative to C, it combines performance and simplicity with seamless C interoperability,
advanced memory management, and built-in tooling for streamlined development.

Here is the Layered project, completely re-written in pure Zig.

Code:
Module:          Layered.dll
Rewritten by:    BLACKFIRE69
Compiler:        Zig v0.14.0-dev.2371+c013f45ad
I started this project just for fun and don't intend to develop it further. For those who are interested, I've included the Zig source code, so feel free to take a look.

Also, if anyone has the latest version of the Layered C++ source code, I'd appreciate it if you could share it with me.

Example:
Code:
procedure TimerProc(hwnd: HWND; uMsg: UINT; idEvent: UINT_PTR; dwTime: DWORD);
begin
  lBeginRender(scene);
    lRenderHint(true);

    lFillRectangle(b1, 0, 0, WizardForm.Width, WizardForm.Height);
    lDrawRectangle(pen, 0, 0, WizardForm.Width, WizardForm.Height);

    lSetImageTransparent(70);
    lDrawImage(skip, 110, 210);
 
    lSetStringAlignment(StringAlignmentCenter);
    lSetStringLineAlignment(StringAlignmentCenter);

    lDrawStringRectW(WizardForm.Caption, 0, 190, WizardForm.Width, 25, font, b7);

  lEndRender();
end;
Code:
procedure InitializeWizard();
begin
  lStartup;

  scene := lCreateScene(WizardForm.Handle, WizardForm.Width, WizardForm.Height);

  skip := lCreateTextureW(ExpandConstant('{tmp}\skip.gif'))
  tex := lCreateTextureW(ExpandConstant('{tmp}\tex.png'));

  b1 := lCreateTextureBrush(tex);
  b6 := lCreateGradientBrush(0, 0, WizardForm.Width, 0, $ff00ff00, $ff0000ff);
  b7 := lCreateSolidBrush($ffffffff);
  pen := lCreatePen($ffff0000, 2);

  TimerID := SetTimer(0, 0, 100, wrapEventProc(@TimerProc,4));
end;

procedure DeinitializeSetup();
begin
  lShutdown;
end;

.
Attached Images
File Type: png 0.png (142.8 KB, 96 views)
File Type: png 1.png (92.8 KB, 95 views)
File Type: png 2.png (81.8 KB, 92 views)
File Type: png 3.png (142.6 KB, 94 views)
Attached Files
File Type: rar Test - Layered Library.rar (595.6 KB, 17 views)
File Type: rar Src - Layered Library.rar (17.0 KB, 11 views)
Reply With Quote
The Following 8 Users Say Thank You to BLACKFIRE69 For This Useful Post:
audiofeel (08-12-2024), Cesar82 (08-12-2024), Ele (20-12-2024), hitman797 (10-12-2024), L33THAK0R (08-12-2024), ScOOt3r (10-12-2024), Sergey3695 (09-12-2024), Wanterlude (09-12-2024)
Sponsored Links
  #2  
Old 08-12-2024, 05:16
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,035
Thanks: 1,743
Thanked 2,220 Times in 759 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by BLACKFIRE69 View Post
Also, if anyone has the latest version of the Layered C++ source code, I'd appreciate it if you could share it with me.
I don't know if that's it, or if this is the most recent version, but I decided to attach it here anyway.
Attached Files
File Type: rar Layered DLL.rar (15.42 MB, 10 views)
Reply With Quote
The Following 2 Users Say Thank You to Cesar82 For This Useful Post:
BLACKFIRE69 (08-12-2024), ScOOt3r (10-12-2024)
  #3  
Old 09-12-2024, 07:42
Sergey3695 Sergey3695 is offline
Registered User
 
Join Date: Mar 2013
Location: Russia
Posts: 83
Thanks: 43
Thanked 74 Times in 40 Posts
Sergey3695 is on a distinguished road
A little from me
https://krinkels.org/resources/layer...d-version.403/
Attached Files
File Type: 7z Layered 0.2.1 src (no Check).7z (576.3 KB, 5 views)

Last edited by Sergey3695; 09-12-2024 at 07:45.
Reply With Quote
The Following 2 Users Say Thank You to Sergey3695 For This Useful Post:
BLACKFIRE69 (10-12-2024), ScOOt3r (10-12-2024)
  #4  
Old 10-12-2024, 11:58
Sergey3695 Sergey3695 is offline
Registered User
 
Join Date: Mar 2013
Location: Russia
Posts: 83
Thanks: 43
Thanked 74 Times in 40 Posts
Sergey3695 is on a distinguished road
_SizeReduced2

Without debug messages. 58 -> 43 Kb.
Attached Files
File Type: rar Layered.rar (16.5 KB, 4 views)

Last edited by Sergey3695; 10-12-2024 at 14:03.
Reply With Quote
The Following User Says Thank You to Sergey3695 For This Useful Post:
BLACKFIRE69 (10-12-2024)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PURE [Multi3 & Multi7] (DVD9 to 2x DVD5) ravd PC Games - CD/DVD Conversions 29 25-03-2011 07:14
Pure nando2002 PC Games - Protection List 3 23-01-2009 20:22
What language are game .exe files written in??? Simon Ulrich Game Coders 11 19-10-2005 13:53
srs soundtrack mCrvn Media Files 0 14-06-2005 12:44
I've written the NOLF nocd all language 0R3G0N PC Games 0 12-12-2000 17:49



All times are GMT -7. The time now is 14:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com