id Software have released the (supposedly much improved!) source code for all the campaigns included in the 2021 re-release of Quake (id1, hipnotic, rogue and dopa) under the GPLv2: https://github.com/id-software/quake-rerelease-qc
This repository contains the QuakeC source code for the four codebases that were used in the 2021 re-release of Quake: the base campaign, Scourge of Armagon, Dissolution of Eternity, and Dimension of the Machine. Dimension of the Past shares the same codebase as Dimension of the Machine.
In comparison with the original QuakeC, these codebases have been updated to replace all instances of strings with placeholder strings that can be used for localization. This requires some support on the engine side in order to handle printing messages correctly. There have also been bug fixes and modifications to behaviors from the original game.
These progs also use some advanced QuakeC features that are only available in modern compilers.